aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.h
diff options
context:
space:
mode:
authorEduard Zingerman <[email protected]>2024-03-06 10:45:20 +0000
committerAndrii Nakryiko <[email protected]>2024-03-06 23:18:15 +0000
commitc1b93c07b3ac3204c6a42a7f7b6217e36f44df4f (patch)
treebc5013bfc1d6b5f26f1a7cf9796c0f11b7639022 /tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.h
parentselftests/bpf: Utility functions to capture libbpf log in test_progs (diff)
downloadkernel-c1b93c07b3ac3204c6a42a7f7b6217e36f44df4f.tar.gz
kernel-c1b93c07b3ac3204c6a42a7f7b6217e36f44df4f.zip
selftests/bpf: Bad_struct_ops test
When loading struct_ops programs kernel requires BTF id of the struct_ops type and member index for attachment point inside that type. This makes impossible to use same BPF program in several struct_ops maps that have different struct_ops type. Check if libbpf rejects such BPF objects files. Signed-off-by: Eduard Zingerman <[email protected]> Signed-off-by: Andrii Nakryiko <[email protected]> Acked-by: Andrii Nakryiko <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.h')
-rw-r--r--tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.h4
1 files changed, 4 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 622d24e29d35..23fa1872ee67 100644
--- a/tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.h
+++ b/tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.h
@@ -89,4 +89,8 @@ struct bpf_testmod_ops {
int (*tramp_40)(int value);
};
+struct bpf_testmod_ops2 {
+ int (*test_1)(void);
+};
+
#endif /* _BPF_TESTMOD_H */