]> git.hungrycats.org Git - linux/commit
selftests/bpf: attach struct_ops maps before test prog runs
authorEduard Zingerman <eddyz87@gmail.com>
Thu, 29 Aug 2024 21:08:27 +0000 (14:08 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 30 Aug 2024 01:15:45 +0000 (18:15 -0700)
commita0dbf6d0b21e197bf919591081ff2eb7a34ef982
tree6f9775e32c9c35493efb9e9c4ff5a32a6fd79d37
parent866d571e6201cb8ccb18cb8407ab3ad3adb474b8
selftests/bpf: attach struct_ops maps before test prog runs

In test_loader based tests to bpf_map__attach_struct_ops()
before call to bpf_prog_test_run_opts() in order to trigger
bpf_struct_ops->reg() callbacks on kernel side.
This allows to use __retval macro for struct_ops tests.

Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Link: https://lore.kernel.org/r/20240829210833.388152-6-martin.lau@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/test_loader.c