summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/xskxceiver.h
diff options
context:
space:
mode:
authorMaciej Fijalkowski <maciej.fijalkowski@intel.com>2022-09-01 14:48:13 +0300
committerDaniel Borkmann <daniel@iogearbox.net>2022-09-02 16:38:08 +0300
commitfe2ad08e1e1df77b6941916b87d4871d751b88b6 (patch)
treec41871e800a7c4cd61b5e6311fa03af9a5bb7415 /tools/testing/selftests/bpf/xskxceiver.h
parentc29fe883defcbc6cd16176787a2084b8e05dabf0 (diff)
downloadlinux-fe2ad08e1e1df77b6941916b87d4871d751b88b6.tar.xz
selftests/xsk: Add support for zero copy testing
Introduce new mode to xdpxceiver responsible for testing AF_XDP zero copy support of driver that serves underlying physical device. When setting up test suite, determine whether driver has ZC support or not by trying to bind XSK ZC socket to the interface. If it succeeded, interpret it as ZC support being in place and do softirq and busy poll tests for zero copy mode. Note that Rx dropped tests are skipped since ZC path is not touching rx_dropped stat at all. Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Magnus Karlsson <magnus.karlsson@intel.com> Link: https://lore.kernel.org/bpf/20220901114813.16275-7-maciej.fijalkowski@intel.com
Diffstat (limited to 'tools/testing/selftests/bpf/xskxceiver.h')
-rw-r--r--tools/testing/selftests/bpf/xskxceiver.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/xskxceiver.h b/tools/testing/selftests/bpf/xskxceiver.h
index 11f017785986..edb76d2def9f 100644
--- a/tools/testing/selftests/bpf/xskxceiver.h
+++ b/tools/testing/selftests/bpf/xskxceiver.h
@@ -62,6 +62,7 @@
enum test_mode {
TEST_MODE_SKB,
TEST_MODE_DRV,
+ TEST_MODE_ZC,
TEST_MODE_MAX
};
@@ -167,6 +168,7 @@ struct test_spec {
u16 current_step;
u16 nb_sockets;
bool fail;
+ enum test_mode mode;
char name[MAX_TEST_NAME_SIZE];
};