aboutsummaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.h
diff options
context:
space:
mode:
authorMartin KaFai Lau <martin.lau@kernel.org>2024-07-22 11:30:47 -0700
committerAndrii Nakryiko <andrii@kernel.org>2024-07-29 13:09:10 -0700
commit4009c95fede6b783802ad01f264a7a0541f5ea60 (patch)
tree120a17e784ca02ef0cfdd75aecc71ff839e06be5 /tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.h
parente44b4fc40cb429f6dedc4518a16221115035f654 (diff)
selftests/bpf: Ensure the unsupported struct_ops prog cannot be loaded
There is an existing "bpf_tcp_ca/unsupp_cong_op" test to ensure the unsupported tcp-cc "get_info" struct_ops prog cannot be loaded. This patch adds a new test in the bpf_testmod such that the unsupported ops test does not depend on other kernel subsystem where its supporting ops may be changed in the future. Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org> Link: https://lore.kernel.org/r/20240722183049.2254692-4-martin.lau@linux.dev Signed-off-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.h')
-rw-r--r--tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.h b/tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.h
index 23fa1872ee67..fe0d402b0d65 100644
--- a/tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.h
+++ b/tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.h
@@ -35,6 +35,7 @@ struct bpf_testmod_ops {
void (*test_2)(int a, int b);
/* Used to test nullable arguments. */
int (*test_maybe_null)(int dummy, struct task_struct *task);
+ int (*unsupported_ops)(void);
/* The following fields are used to test shadow copies. */
char onebyte;