aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/xdping.c
diff options
context:
space:
mode:
authorAndrii Nakryiko <andrii@kernel.org>2021-11-03 15:08:44 -0700
committerAlexei Starovoitov <ast@kernel.org>2021-11-07 08:34:23 -0800
commitcbdb1461dcf45765a036e9f6975ffe19e69bdc33 (patch)
tree826122e1a461694a54fbf27a68dc7aec64e94aa2 /tools/testing/selftests/bpf/xdping.c
parentselftests/bpf: Merge test_stub.c into testing_helpers.c (diff)
downloadlinux-dev-cbdb1461dcf45765a036e9f6975ffe19e69bdc33.tar.xz
linux-dev-cbdb1461dcf45765a036e9f6975ffe19e69bdc33.zip
selftests/bpf: Use explicit bpf_prog_test_load() calls everywhere
-Dbpf_prog_load_deprecated=bpf_prog_test_load trick is both ugly and breaks when deprecation goes into effect due to macro magic. Convert all the uses to explicit bpf_prog_test_load() calls which avoid deprecation errors and makes everything less magical. Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Dave Marchevsky <davemarchevsky@fb.com> Link: https://lore.kernel.org/bpf/20211103220845.2676888-12-andrii@kernel.org
Diffstat (limited to 'tools/testing/selftests/bpf/xdping.c')
-rw-r--r--tools/testing/selftests/bpf/xdping.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/testing/selftests/bpf/xdping.c b/tools/testing/selftests/bpf/xdping.c
index 30f12637f4e4..baa870a759a2 100644
--- a/tools/testing/selftests/bpf/xdping.c
+++ b/tools/testing/selftests/bpf/xdping.c
@@ -22,6 +22,7 @@
#include "bpf/libbpf.h"
#include "xdping.h"
+#include "testing_helpers.h"
static int ifindex;
static __u32 xdp_flags = XDP_FLAGS_UPDATE_IF_NOEXIST;
@@ -173,7 +174,7 @@ int main(int argc, char **argv)
snprintf(filename, sizeof(filename), "%s_kern.o", argv[0]);
- if (bpf_prog_load(filename, BPF_PROG_TYPE_XDP, &obj, &prog_fd)) {
+ if (bpf_prog_test_load(filename, BPF_PROG_TYPE_XDP, &obj, &prog_fd)) {
fprintf(stderr, "load of %s failed\n", filename);
return 1;
}