netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next 0/5] Introduce libbpf_attach_type_by_name
@ 2018-09-26 22:24 Andrey Ignatov
  2018-09-26 22:24 ` [PATCH bpf-next 1/5] libbpf: " Andrey Ignatov
                   ` (6 more replies)
  0 siblings, 7 replies; 10+ messages in thread
From: Andrey Ignatov @ 2018-09-26 22:24 UTC (permalink / raw)
  To: netdev; +Cc: Andrey Ignatov, ast, daniel, kernel-team

This patch set introduces libbpf_attach_type_by_name function in libbpf to
identify attach type by section name.

This is useful to avoid writing same logic over and over again in user
space applications that leverage libbpf.

Patch 1 has more details on the new function and problem being solved.
Patches 2 and 3 add support for new section names.
Patch 4 uses new function in a selftest.
Patch 5 adds selftest for libbpf_{prog,attach}_type_by_name.

As a side note there are a lot of inconsistencies now between names used by
libbpf and bpftool (e.g. cgroup/skb vs cgroup_skb, cgroup_device and device
vs cgroup/dev, sockops vs sock_ops, etc). This patch set does not address
it but it tries not to make it harder to address it in the future.


Andrey Ignatov (5):
  libbpf: Introduce libbpf_attach_type_by_name
  libbpf: Support cgroup_skb/{e,in}gress section names
  libbpf: Support sk_skb/stream_{parser,verdict} section names
  selftests/bpf: Use libbpf_attach_type_by_name in test_socket_cookie
  selftests/bpf: Test libbpf_{prog,attach}_type_by_name

 tools/lib/bpf/libbpf.c                        | 129 +++++++----
 tools/lib/bpf/libbpf.h                        |   2 +
 tools/testing/selftests/bpf/Makefile          |   2 +-
 .../selftests/bpf/test_section_names.c        | 208 ++++++++++++++++++
 .../selftests/bpf/test_socket_cookie.c        |   6 +-
 5 files changed, 302 insertions(+), 45 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/test_section_names.c

-- 
2.17.1

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

end of thread, other threads:[~2018-09-28  1:41 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-26 22:24 [PATCH bpf-next 0/5] Introduce libbpf_attach_type_by_name Andrey Ignatov
2018-09-26 22:24 ` [PATCH bpf-next 1/5] libbpf: " Andrey Ignatov
2018-09-26 22:24 ` [PATCH bpf-next 2/5] libbpf: Support cgroup_skb/{e,in}gress section names Andrey Ignatov
2018-09-26 22:24 ` [PATCH bpf-next 3/5] libbpf: Support sk_skb/stream_{parser,verdict} " Andrey Ignatov
2018-09-26 22:24 ` [PATCH bpf-next 4/5] selftests/bpf: Use libbpf_attach_type_by_name in test_socket_cookie Andrey Ignatov
2018-09-26 22:24 ` [PATCH bpf-next 5/5] selftests/bpf: Test libbpf_{prog,attach}_type_by_name Andrey Ignatov
2018-09-26 23:20 ` [PATCH bpf-next 0/5] Introduce libbpf_attach_type_by_name Jakub Kicinski
2018-09-26 23:54   ` Andrey Ignatov
2018-09-27  2:06     ` Jakub Kicinski
2018-09-27 19:21 ` Daniel Borkmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).