RFC Add bpf_link support for sk_msg prog
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest5 patches 17 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | bpf: Add link support for sk_msg proginclude/ include/ kernel/ +3 more | +181 | 6 replies | |
| 2/5 | libbpf: Refactor bpf_program_attach_fd()tools/ | +13 | 2 replies | |
| 3/5 | libbpf: Add link support for BPF_PROG_TYPE_SK_MSGtools/ tools/ tools/ | +12 | 2 replies | |
| 4/5 | bpftool: Add link dump support for BPF_LINK_TYPE_SK_MSGtools/ | +8 | 2 replies | |
| 5/5 | selftests/bpf: Add some tests with new bpf_program__attach_sk_msg() APItools/ tools/ | +65 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [RFC PATCH bpf-next 0/5] Add bpf_link support for sk_msg prog
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.
I marked the patch as RFC as not all functionality are covered by tests yet, e.g. update_prog(). Maybe somebody can suggest an existing test which I can look into.
Or maybe some other tests need to be added as well.
Yonghong Song (5):
bpf: Add link support for sk_msg prog
libbpf: Refactor bpf_program_attach_fd()
libbpf: Add link support for BPF_PROG_TYPE_SK_MSG
bpftool: Add link dump support for BPF_LINK_TYPE_SK_MSG selftests/bpf: Add some tests with new bpf_program__attach_sk_msg()
API
include/linux/bpf.h | 13 ++ include/uapi/linux/bpf.h | 5 + kernel/bpf/syscall.c | 3 + net/core/skmsg.c | 153 ++++++++++++++++++ net/core/sock_map.c | 6 +- tools/bpf/bpftool/link.c | 8 + tools/include/uapi/linux/bpf.h | 5 + tools/lib/bpf/libbpf.c | 26 ++- tools/lib/bpf/libbpf.h | 3 + tools/lib/bpf/libbpf.map | 1 + .../selftests/bpf/prog_tests/sockmap_basic.c | 27 ++++ .../selftests/bpf/prog_tests/sockmap_listen.c | 38 +++++ 12 files changed, 279 insertions(+), 9 deletions(-)
Signature · 1 line
2.43.0