mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-21 04:53:46 -04:00
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
This commit is contained in:
committed by
Alexei Starovoitov
parent
f87c1930ac
commit
cbdb1461dc
@@ -25,6 +25,7 @@
|
||||
#include "bpf_util.h"
|
||||
#include "bpf_rlimit.h"
|
||||
#include "test_maps.h"
|
||||
#include "testing_helpers.h"
|
||||
|
||||
#ifndef ENOTSUPP
|
||||
#define ENOTSUPP 524
|
||||
@@ -830,21 +831,21 @@ static void test_sockmap(unsigned int tasks, void *data)
|
||||
}
|
||||
|
||||
/* Load SK_SKB program and Attach */
|
||||
err = bpf_prog_load(SOCKMAP_PARSE_PROG,
|
||||
err = bpf_prog_test_load(SOCKMAP_PARSE_PROG,
|
||||
BPF_PROG_TYPE_SK_SKB, &obj, &parse_prog);
|
||||
if (err) {
|
||||
printf("Failed to load SK_SKB parse prog\n");
|
||||
goto out_sockmap;
|
||||
}
|
||||
|
||||
err = bpf_prog_load(SOCKMAP_TCP_MSG_PROG,
|
||||
err = bpf_prog_test_load(SOCKMAP_TCP_MSG_PROG,
|
||||
BPF_PROG_TYPE_SK_MSG, &obj, &msg_prog);
|
||||
if (err) {
|
||||
printf("Failed to load SK_SKB msg prog\n");
|
||||
goto out_sockmap;
|
||||
}
|
||||
|
||||
err = bpf_prog_load(SOCKMAP_VERDICT_PROG,
|
||||
err = bpf_prog_test_load(SOCKMAP_VERDICT_PROG,
|
||||
BPF_PROG_TYPE_SK_SKB, &obj, &verdict_prog);
|
||||
if (err) {
|
||||
printf("Failed to load SK_SKB verdict prog\n");
|
||||
|
||||
Reference in New Issue
Block a user