bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next 0/7] Improve set_attach_target() and deprecate open_opts.attach_prog_fd
@ 2021-09-16  1:58 Andrii Nakryiko
  2021-09-16  1:58 ` [PATCH bpf-next 1/7] libbpf: use pre-setup sec_def in libbpf_find_attach_btf_id() Andrii Nakryiko
                   ` (7 more replies)
  0 siblings, 8 replies; 19+ messages in thread
From: Andrii Nakryiko @ 2021-09-16  1:58 UTC (permalink / raw)
  To: bpf, ast, daniel; +Cc: andrii, kernel-team

This patch set deprecates bpf_object_open_opts.attach_prog_fd (in libbpf 0.7+)
by extending bpf_program__set_attach_target() to support some more flexible
scenarios. Existing fexit_bpf2bpf selftest is updated accordingly to not use
deprecated APIs.

While at it, also deprecate no-op relaxed_core_relocs option (they are always
"relaxed").

Last patch also const-ifies all high-level libbpf attach APIs, as there is no
reason for them to assume bpf_program/bpf_map modifications.

Patch #1 also removes one more unneeded use of find_sec_def(), relying on
prog->sec_def that's set during bpf_object__open() operation, simplifying
upcoming refactoring a little bit more.

All these changes are preparatory patches before SEC() handling refactoring
that will come next.

Andrii Nakryiko (7):
  libbpf: use pre-setup sec_def in libbpf_find_attach_btf_id()
  selftests/bpf: stop using relaxed_core_relocs which has no effect
  libbpf: deprecated bpf_object_open_opts.relaxed_core_relocs
  libbpf: allow skipping attach_func_name in
    bpf_program__set_attach_target()
  selftests/bpf: switch fexit_bpf2bpf selftest to set_attach_target()
    API
  libbpf: schedule open_opts.attach_prog_fd deprecation since v0.7
  libbpf: constify all high-level program attach APIs

 tools/lib/bpf/libbpf.c                        | 98 ++++++++++---------
 tools/lib/bpf/libbpf.h                        | 39 ++++----
 tools/lib/bpf/libbpf_common.h                 |  5 +
 .../selftests/bpf/prog_tests/core_reloc.c     |  3 +-
 .../selftests/bpf/prog_tests/fexit_bpf2bpf.c  | 43 ++++----
 5 files changed, 107 insertions(+), 81 deletions(-)

-- 
2.30.2


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

end of thread, other threads:[~2021-09-17 18:04 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-16  1:58 [PATCH bpf-next 0/7] Improve set_attach_target() and deprecate open_opts.attach_prog_fd Andrii Nakryiko
2021-09-16  1:58 ` [PATCH bpf-next 1/7] libbpf: use pre-setup sec_def in libbpf_find_attach_btf_id() Andrii Nakryiko
2021-09-16  2:52   ` Yonghong Song
2021-09-16  1:58 ` [PATCH bpf-next 2/7] selftests/bpf: stop using relaxed_core_relocs which has no effect Andrii Nakryiko
2021-09-16  2:57   ` Yonghong Song
2021-09-16  1:58 ` [PATCH bpf-next 3/7] libbpf: deprecated bpf_object_open_opts.relaxed_core_relocs Andrii Nakryiko
2021-09-16  2:57   ` Yonghong Song
2021-09-16  1:58 ` [PATCH bpf-next 4/7] libbpf: allow skipping attach_func_name in bpf_program__set_attach_target() Andrii Nakryiko
2021-09-16  4:17   ` Yonghong Song
2021-09-17 16:09     ` Alexei Starovoitov
2021-09-17 18:04       ` Andrii Nakryiko
2021-09-16  1:58 ` [PATCH bpf-next 5/7] selftests/bpf: switch fexit_bpf2bpf selftest to set_attach_target() API Andrii Nakryiko
2021-09-16  4:24   ` Yonghong Song
2021-09-16 17:14     ` Andrii Nakryiko
2021-09-16  1:58 ` [PATCH bpf-next 6/7] libbpf: schedule open_opts.attach_prog_fd deprecation since v0.7 Andrii Nakryiko
2021-09-16  4:26   ` Yonghong Song
2021-09-16  1:58 ` [PATCH bpf-next 7/7] libbpf: constify all high-level program attach APIs Andrii Nakryiko
2021-09-16  4:29   ` Yonghong Song
2021-09-17 16:10 ` [PATCH bpf-next 0/7] Improve set_attach_target() and deprecate open_opts.attach_prog_fd patchwork-bot+netdevbpf

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).