]> www.infradead.org Git - users/jedix/linux-maple.git/commit
selftest/bpf/benchs: Add benchmark for sockmap usage
authorJiayuan Chen <jiayuan.chen@linux.dev>
Mon, 7 Apr 2025 14:21:23 +0000 (22:21 +0800)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 10 Apr 2025 02:59:00 +0000 (19:59 -0700)
commit7b2fa44de5e718a3053dea37e4a3d893b0f40e42
tree86b9efa0fb7b02a3c5383b273c6455a37d82d221
parent5ca2e29f6834c64c0e5a9ccf1278c21fb49b827e
selftest/bpf/benchs: Add benchmark for sockmap usage

Add TCP+sockmap-based benchmark.
Since sockmap's own update and delete operations are generally less
critical, the performance of the fast forwarding framework built upon
it is the key aspect.

Also with cgset/cgexec, we can observe the behavior of sockmap under
memory pressure.

The benchmark can be run with:
'''
./bench sockmap -c 2 -p 1 -a --rx-verdict-ingress
'''

In the future, we plan to move socket_helpers.h out of the prog_tests
directory to make it accessible for the benchmark. This will enable
better support for various socket types.

Signed-off-by: Jiayuan Chen <jiayuan.chen@linux.dev>
Link: https://lore.kernel.org/r/20250407142234.47591-5-jiayuan.chen@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/Makefile
tools/testing/selftests/bpf/bench.c
tools/testing/selftests/bpf/benchs/bench_sockmap.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/bench_sockmap_prog.c [new file with mode: 0644]