aboutsummaryrefslogtreecommitdiff
path: root/tools/lib/bpf/libbpf_common.h
diff options
context:
space:
mode:
authorGravatar Andrii Nakryiko <andrii@kernel.org> 2021-12-01 15:28:24 -0800
committerGravatar Alexei Starovoitov <ast@kernel.org> 2021-12-02 15:23:41 -0800
commitc93faaaf2f67ba5396840316651cdc7640d9fa9e (patch)
treedad6591838a9b35d8414ed4e80d0763b02ff2287 /tools/lib/bpf/libbpf_common.h
parentsamples/bpf: Get rid of deprecated libbpf API uses (diff)
downloadlinux-c93faaaf2f67ba5396840316651cdc7640d9fa9e.tar.gz
linux-c93faaaf2f67ba5396840316651cdc7640d9fa9e.tar.bz2
linux-c93faaaf2f67ba5396840316651cdc7640d9fa9e.zip
libbpf: Deprecate bpf_prog_load_xattr() API
bpf_prog_load_xattr() is high-level API that's named as a low-level BPF_PROG_LOAD wrapper APIs, but it actually operates on struct bpf_object. It's badly and confusingly misnamed as it will load all the progs insige bpf_object, returning prog_fd of the very first BPF program. It also has a bunch of ad-hoc things like log_level override, map_ifindex auto-setting, etc. All this can be expressed more explicitly and cleanly through existing libbpf APIs. This patch marks bpf_prog_load_xattr() for deprecation in libbpf v0.8 ([0]). [0] Closes: https://github.com/libbpf/libbpf/issues/308 Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/20211201232824.3166325-10-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 b21cefc9c3b6..000e37798ff2 100644
--- a/tools/lib/bpf/libbpf_common.h
+++ b/tools/lib/bpf/libbpf_common.h
@@ -40,6 +40,11 @@
#else
#define __LIBBPF_MARK_DEPRECATED_0_7(X)
#endif
+#if __LIBBPF_CURRENT_VERSION_GEQ(0, 8)
+#define __LIBBPF_MARK_DEPRECATED_0_8(X) X
+#else
+#define __LIBBPF_MARK_DEPRECATED_0_8(X)
+#endif
/* This set of internal macros allows to do "function overloading" based on
* number of arguments provided by used in backwards-compatible way during the