summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/xskxceiver.h
diff options
context:
space:
mode:
authorMagnus Karlsson <magnus.karlsson@intel.com>2023-07-19 15:24:20 +0200
committerAlexei Starovoitov <ast@kernel.org>2023-07-19 09:56:51 -0700
commit807bf4da204938f01ad2e994ba92e82ac486ea2b (patch)
tree9463af34c98afd7f753f562de44f1ee9139c490a /tools/testing/selftests/bpf/xskxceiver.h
parentf80ddbec476257a064ee0f57aa018bfc0f4d54d7 (diff)
downloadlwn-807bf4da204938f01ad2e994ba92e82ac486ea2b.tar.gz
lwn-807bf4da204938f01ad2e994ba92e82ac486ea2b.zip
selftests/xsk: add test for too many frags
Add a test that will exercise maximum number of supported fragments. This number depends on mode of the test - for SKB and DRV it will be 18 whereas for ZC this is defined by a value from NETDEV_A_DEV_XDP_ZC_MAX_SEGS netlink attribute. Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com> Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com> # made use of new netlink attribute Link: https://lore.kernel.org/r/20230719132421.584801-24-maciej.fijalkowski@intel.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/xskxceiver.h')
-rw-r--r--tools/testing/selftests/bpf/xskxceiver.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/xskxceiver.h b/tools/testing/selftests/bpf/xskxceiver.h
index 9e1f66e0a3b6..233b66cef64a 100644
--- a/tools/testing/selftests/bpf/xskxceiver.h
+++ b/tools/testing/selftests/bpf/xskxceiver.h
@@ -53,6 +53,7 @@
#define XSK_UMEM__LARGE_FRAME_SIZE (3 * 1024)
#define XSK_UMEM__MAX_FRAME_SIZE (4 * 1024)
#define XSK_DESC__INVALID_OPTION (0xffff)
+#define XSK_DESC__MAX_SKB_FRAGS 18
#define HUGEPAGE_SIZE (2 * 1024 * 1024)
#define PKT_DUMP_NB_TO_PRINT 16
@@ -93,6 +94,7 @@ enum test_type {
TEST_TYPE_UNALIGNED_MB,
TEST_TYPE_ALIGNED_INV_DESC_MB,
TEST_TYPE_UNALIGNED_INV_DESC_MB,
+ TEST_TYPE_TOO_MANY_FRAGS,
TEST_TYPE_MAX
};
@@ -155,6 +157,7 @@ struct ifobject {
int ifindex;
int mtu;
u32 bind_flags;
+ u32 xdp_zc_max_segs;
bool tx_on;
bool rx_on;
bool use_poll;