]> Gentwo Git Trees - linux/.git/commit
selftests/bpf: Add multi_st_ops that supports multiple instances
authorAmery Hung <ameryhung@gmail.com>
Wed, 6 Aug 2025 16:25:39 +0000 (09:25 -0700)
committerMartin KaFai Lau <martin.lau@kernel.org>
Wed, 6 Aug 2025 23:01:56 +0000 (16:01 -0700)
commiteeb52b6279cfebae07703f772621fb9d5972e541
tree224105f80187b8b967f24547756653ad0bf98947
parentd87a513d093726d121dd5c816e26803111a259d0
selftests/bpf: Add multi_st_ops that supports multiple instances

Current struct_ops in bpf_testmod only support attaching single instance.
Add multi_st_ops that supports multiple instances. The struct_ops uses map
id as the struct_ops id and will reject attachment with an existing id.

Signed-off-by: Amery Hung <ameryhung@gmail.com>
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Link: https://patch.msgid.link/20250806162540.681679-3-ameryhung@gmail.com
tools/testing/selftests/bpf/test_kmods/bpf_testmod.c
tools/testing/selftests/bpf/test_kmods/bpf_testmod.h
tools/testing/selftests/bpf/test_kmods/bpf_testmod_kfunc.h