summaryrefslogtreecommitdiffstats
path: root/tools/lib/bpf/libbpf_common.h
diff options
context:
space:
mode:
authorAndrii Nakryiko <andrii@kernel.org>2021-09-16 03:58:35 +0200
committerAlexei Starovoitov <ast@kernel.org>2021-09-17 18:05:41 +0200
commit91b555d73e53879fc6d4cf82c8c0e14c00ce212d (patch)
tree4af595a6acc6fc236991b4f3ec25949d82df53e0 /tools/lib/bpf/libbpf_common.h
parentselftests/bpf: Switch fexit_bpf2bpf selftest to set_attach_target() API (diff)
downloadlinux-91b555d73e53879fc6d4cf82c8c0e14c00ce212d.tar.xz
linux-91b555d73e53879fc6d4cf82c8c0e14c00ce212d.zip
libbpf: Schedule open_opts.attach_prog_fd deprecation since v0.7
bpf_object_open_opts.attach_prog_fd makes a pretty strong assumption that bpf_object contains either only single freplace BPF program or all of BPF programs in BPF object are freplaces intended to replace different subprograms of the same target BPF program. This seems both a bit confusing, too assuming, and limiting. We've had bpf_program__set_attach_target() API which allows more fine-grained control over this, on a per-program level. As such, mark open_opts.attach_prog_fd as deprecated starting from v0.7, so that we have one more universal way of setting freplace targets. With previous change to allow NULL attach_func_name argument, and especially combined with BPF skeleton, arguable bpf_program__set_attach_target() is a more convenient and explicit API as well. Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Yonghong Song <yhs@fb.com> Link: https://lore.kernel.org/bpf/20210916015836.1248906-7-andrii@kernel.org
Diffstat (limited to 'tools/lib/bpf/libbpf_common.h')
-rw-r--r--tools/lib/bpf/libbpf_common.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/lib/bpf/libbpf_common.h b/tools/lib/bpf/libbpf_common.h
index 36ac77f2bea2..aaa1efbf6f51 100644
--- a/tools/lib/bpf/libbpf_common.h
+++ b/tools/lib/bpf/libbpf_common.h
@@ -35,6 +35,11 @@
#else
#define __LIBBPF_MARK_DEPRECATED_0_6(X)
#endif
+#if __LIBBPF_CURRENT_VERSION_GEQ(0, 7)
+#define __LIBBPF_MARK_DEPRECATED_0_7(X) X
+#else
+#define __LIBBPF_MARK_DEPRECATED_0_7(X)
+#endif
/* Helper macro to declare and initialize libbpf options struct
*