]> www.infradead.org Git - users/jedix/linux-maple.git/commit
selftests/bpf: check program redirect in xdp_cpumap_attach
authorAlexis Lothoré (eBPF Foundation) <alexis.lothore@bootlin.com>
Wed, 9 Oct 2024 10:12:09 +0000 (12:12 +0200)
committerMartin KaFai Lau <martin.lau@kernel.org>
Fri, 11 Oct 2024 01:01:52 +0000 (18:01 -0700)
commitd124d984c8a2d677e1cea6740a01ccdd0371a38d
treeb58ef040904b5fb94737ffe3135e6d14ea170106
parentd5fbcf46ee82574aee443423f3e4132d1154372b
selftests/bpf: check program redirect in xdp_cpumap_attach

xdp_cpumap_attach, in its current form, only checks that an xdp cpumap
program can be executed, but not that it performs correctly the cpu
redirect as configured by userspace (bpf_prog_test_run_opts will return
success even if the redirect program returns an error)

Add a check to ensure that the program performs the configured redirect
as well. The check is based on a global variable incremented by a
chained program executed only if the redirect program properly executes.

Signed-off-by: Alexis Lothoré (eBPF Foundation) <alexis.lothore@bootlin.com>
Link: https://lore.kernel.org/r/20241009-convert_xdp_tests-v3-3-51cea913710c@bootlin.com
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
tools/testing/selftests/bpf/prog_tests/xdp_cpumap_attach.c
tools/testing/selftests/bpf/progs/test_xdp_with_cpumap_helpers.c