]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/bpf: Introduce xsk statistics tests
authorCiara Loftus <ciara.loftus@intel.com>
Tue, 23 Feb 2021 16:23:04 +0000 (16:23 +0000)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 26 Feb 2021 20:08:49 +0000 (12:08 -0800)
commitddbcd7493d8e8327891ac24a87a08afa0e19a75f
treed4fa8fc2092b1d1d385bb5a5060b43f5ee8e51f4
parentbae6e0c11c7a4c106c28ff0ad49bce088393d1fe
selftests/bpf: Introduce xsk statistics tests

This commit introduces a range of tests to the xsk testsuite
for validating xsk statistics.

A new test type called 'stats' is added. Within it there are
four sub-tests. Each test configures a scenario which should
trigger the given error statistic. The test passes if the statistic
is successfully incremented.

The four statistics for which tests have been created are:
1. rx dropped
Increase the UMEM frame headroom to a value which results in
insufficient space in the rx buffer for both the packet and the headroom.
2. tx invalid
Set the 'len' field of tx descriptors to an invalid value (umem frame
size + 1).
3. rx ring full
Reduce the size of the RX ring to a fraction of the fill ring size.
4. fill queue empty
Do not populate the fill queue and then try to receive pkts.

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-5-ciara.loftus@intel.com
tools/testing/selftests/bpf/xdpxceiver.c
tools/testing/selftests/bpf/xdpxceiver.h