]> git.ipfire.org Git - thirdparty/linux.git/commit
bpf/selftests: Add selftest for bpf_smc_hs_ctrl
authorD. Wythe <alibuda@linux.alibaba.com>
Fri, 7 Nov 2025 03:56:32 +0000 (11:56 +0800)
committerMartin KaFai Lau <martin.lau@kernel.org>
Mon, 10 Nov 2025 20:00:45 +0000 (12:00 -0800)
commitbeb3c67297d92f9428484410cf79135d38d0aff3
tree3707d47833cf933a8f04d4f682617ff05e33a8ea
parent15f295f55656658e65bdbc9b901d6b2e49d68d72
bpf/selftests: Add selftest for bpf_smc_hs_ctrl

This tests introduces a tiny smc_hs_ctrl for filtering SMC connections
based on IP pairs, and also adds a realistic topology model to verify it.

Also, we can only use SMC loopback under CI test, so an additional
configuration needs to be enabled.

Follow the steps below to run this test.

make -C tools/testing/selftests/bpf
cd tools/testing/selftests/bpf
sudo ./test_progs -t smc

Results shows:
Summary: 1/1 PASSED, 0 SKIPPED, 0 FAILED

Signed-off-by: D. Wythe <alibuda@linux.alibaba.com>
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Tested-by: Saket Kumar Bhaskar <skb99@linux.ibm.com>
Reviewed-by: Zhu Yanjun <yanjun.zhu@linux.dev>
Link: https://patch.msgid.link/20251107035632.115950-4-alibuda@linux.alibaba.com
tools/testing/selftests/bpf/config
tools/testing/selftests/bpf/prog_tests/test_bpf_smc.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/bpf_smc.c [new file with mode: 0644]