selftests/bpf: test case for register_bpf_struct_ops().
authorKui-Feng Lee <thinker.li@gmail.com>
Fri, 19 Jan 2024 22:50:05 +0000 (14:50 -0800)
committerMartin KaFai Lau <martin.lau@kernel.org>
Wed, 24 Jan 2024 01:12:52 +0000 (17:12 -0800)
commit0253e0590e2dc46996534371d56b5297099aed4e
tree85add1361db079527e9798ff1f78d180e9f08180
parent7c81c2490c73e614c6d48e4f339f4f224140b565
selftests/bpf: test case for register_bpf_struct_ops().

Create a new struct_ops type called bpf_testmod_ops within the bpf_testmod
module. When a struct_ops object is registered, the bpf_testmod module will
invoke test_2 from the module.

Signed-off-by: Kui-Feng Lee <thinker.li@gmail.com>
Link: https://lore.kernel.org/r/20240119225005.668602-15-thinker.li@gmail.com
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c
tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.h
tools/testing/selftests/bpf/prog_tests/test_struct_ops_module.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/struct_ops_module.c [new file with mode: 0644]