diff options
author | Andrii Nakryiko <andrii@kernel.org> | 2021-11-04 01:08:44 +0300 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2021-11-07 19:34:23 +0300 |
commit | cbdb1461dcf45765a036e9f6975ffe19e69bdc33 (patch) | |
tree | 826122e1a461694a54fbf27a68dc7aec64e94aa2 /tools/testing/selftests/bpf/test_tcpnotify_user.c | |
parent | f87c1930ac2951d7fb3bacb523c24046c81015ed (diff) | |
download | linux-cbdb1461dcf45765a036e9f6975ffe19e69bdc33.tar.xz |
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/test_tcpnotify_user.c')
-rw-r--r-- | tools/testing/selftests/bpf/test_tcpnotify_user.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/testing/selftests/bpf/test_tcpnotify_user.c b/tools/testing/selftests/bpf/test_tcpnotify_user.c index 4a39304cc5a6..63111cb082fe 100644 --- a/tools/testing/selftests/bpf/test_tcpnotify_user.c +++ b/tools/testing/selftests/bpf/test_tcpnotify_user.c @@ -25,6 +25,7 @@ #include "test_tcpnotify.h" #include "trace_helpers.h" +#include "testing_helpers.h" #define SOCKET_BUFFER_SIZE (getpagesize() < 8192L ? getpagesize() : 8192L) @@ -92,7 +93,7 @@ int main(int argc, char **argv) if (cg_fd < 0) goto err; - if (bpf_prog_load(file, BPF_PROG_TYPE_SOCK_OPS, &obj, &prog_fd)) { + if (bpf_prog_test_load(file, BPF_PROG_TYPE_SOCK_OPS, &obj, &prog_fd)) { printf("FAILED: load_bpf_file failed for: %s\n", file); goto err; } |