selftests/bpf: Restructure xsk selftests
authorCiara Loftus <ciara.loftus@intel.com>
Tue, 23 Feb 2021 16:23:03 +0000 (16:23 +0000)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 26 Feb 2021 20:08:48 +0000 (12:08 -0800)
commitd3e3bf5b4c673e79c5a11608f53d4e0059a7ec79
tree0c78987200848093168c47fdf8e03aade77056a3
parentd2b0dfd5d1f94fe74ed580b5a1d5fdb5bf11f2fb
selftests/bpf: Restructure xsk selftests

Prior to this commit individual xsk tests were launched from the
shell script 'test_xsk.sh'. When adding a new test type, two new test
configurations had to be added to this file - one for each of the
supported XDP 'modes' (skb or drv). Should zero copy support be added to
the xsk selftest framework in the future, three new test configurations
would need to be added for each new test type. Each new test type also
typically requires new CLI arguments for the xdpxceiver program.

This commit aims to reduce the overhead of adding new tests, by launching
the test configurations from within the xdpxceiver program itself, using
simple loops. Every test is run every time the C program is executed. Many
of the CLI arguments can be removed as a result.

Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Link: https://lore.kernel.org/bpf/20210223162304.7450-4-ciara.loftus@intel.com
tools/testing/selftests/bpf/test_xsk.sh
tools/testing/selftests/bpf/xdpxceiver.c
tools/testing/selftests/bpf/xdpxceiver.h
tools/testing/selftests/bpf/xsk_prereqs.sh