BPF List
 help / color / mirror / Atom feed
* [PATCH bpf-next v2 0/6] bpf: Add bpf_link support for sk_msg and sk_skb progs
@ 2024-03-19 17:54 Yonghong Song
  2024-03-19 17:54 ` [PATCH bpf-next v2 1/6] " Yonghong Song
                   ` (5 more replies)
  0 siblings, 6 replies; 20+ messages in thread
From: Yonghong Song @ 2024-03-19 17:54 UTC (permalink / raw)
  To: bpf
  Cc: Alexei Starovoitov, Andrii Nakryiko, Daniel Borkmann,
	Jakub Sitnicki, John Fastabend, kernel-team, Martin KaFai Lau

One of our internal services started to use sk_msg program and currently
it used existing prog attach/detach2 as demonstrated in selftests.
But attach/detach of all other bpf programs are based on bpf_link.
Consistent attach/detach APIs for all programs will make things easy to
undersand and less error prone. So this patch added bpf_link
support for BPF_PROG_TYPE_SK_MSG. Based on comments from
previous RFC patch, I added BPF_PROG_TYPE_SK_SKB support as well
as both program types have similar treatment w.r.t. bpf_link
handling.

For the patch series, patch 1 added kernel support. Patches 2/3
added libbpf support. Patch 4 added bpftool support and
patches 5/6 added some new tests.

Yonghong Song (6):
  bpf: Add bpf_link support for sk_msg and sk_skb progs
  libbpf: Add new sec_def "sk_skb/verdict"
  libbpf: Add bpf_link support for BPF_PROG_TYPE_SK_{MSG,SKB}
  bpftool: Add link dump support for BPF_LINK_TYPE_SK_{MSG,SKB}
  selftests/bpf: Refactor out helper functions for a few tests
  selftests/bpf: Add some tests with new
    bpf_program__attach_sk_{msg,skb}() APIs

 include/linux/bpf.h                           |  13 ++
 include/uapi/linux/bpf.h                      |  10 ++
 kernel/bpf/syscall.c                          |   4 +
 net/core/skmsg.c                              | 164 ++++++++++++++++++
 net/core/sock_map.c                           |   6 +-
 tools/bpf/bpftool/link.c                      |  18 ++
 tools/include/uapi/linux/bpf.h                |  10 ++
 tools/lib/bpf/libbpf.c                        |  15 ++
 tools/lib/bpf/libbpf.h                        |   4 +
 tools/lib/bpf/libbpf.map                      |   2 +
 .../selftests/bpf/prog_tests/sockmap_basic.c  | 121 +++++++++++--
 .../selftests/bpf/prog_tests/sockmap_listen.c |  38 ++++
 .../bpf/progs/test_skmsg_load_helpers.c       |  15 +-
 .../bpf/progs/test_sockmap_pass_prog.c        |  11 +-
 .../progs/test_sockmap_skb_verdict_attach.c   |   2 +-
 15 files changed, 410 insertions(+), 23 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2024-03-22 21:41 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-19 17:54 [PATCH bpf-next v2 0/6] bpf: Add bpf_link support for sk_msg and sk_skb progs Yonghong Song
2024-03-19 17:54 ` [PATCH bpf-next v2 1/6] " Yonghong Song
2024-03-21  8:02   ` kernel test robot
2024-03-21 20:33   ` kernel test robot
2024-03-21 21:25   ` kernel test robot
2024-03-22 18:45   ` Andrii Nakryiko
2024-03-22 19:17     ` Yonghong Song
2024-03-22 20:16       ` Andrii Nakryiko
2024-03-22 21:33         ` Yonghong Song
2024-03-22 21:35           ` Andrii Nakryiko
2024-03-19 17:54 ` [PATCH bpf-next v2 2/6] libbpf: Add new sec_def "sk_skb/verdict" Yonghong Song
2024-03-22 18:47   ` Andrii Nakryiko
2024-03-22 19:19     ` Yonghong Song
2024-03-19 17:54 ` [PATCH bpf-next v2 3/6] libbpf: Add bpf_link support for BPF_PROG_TYPE_SK_{MSG,SKB} Yonghong Song
2024-03-22 18:48   ` Andrii Nakryiko
2024-03-22 19:23     ` Yonghong Song
2024-03-19 17:54 ` [PATCH bpf-next v2 4/6] bpftool: Add link dump support for BPF_LINK_TYPE_SK_{MSG,SKB} Yonghong Song
2024-03-20 17:11   ` Quentin Monnet
2024-03-19 17:54 ` [PATCH bpf-next v2 5/6] selftests/bpf: Refactor out helper functions for a few tests Yonghong Song
2024-03-19 17:54 ` [PATCH bpf-next v2 6/6] selftests/bpf: Add some tests with new bpf_program__attach_sk_{msg,skb}() APIs Yonghong Song

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox