selftests/xsk: Update poll test cases
authorShibin Koikkara Reeny <shibin.koikkara.reeny@intel.com>
Wed, 3 Aug 2022 14:43:54 +0000 (14:43 +0000)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 10 Aug 2022 15:13:31 +0000 (17:13 +0200)
commit3143d10b094596f3e5d5964b2660375e586652a3
treeba8c98387e9c7b716798e93a2971fbb5bea9b1e9
parentdc444be8bae45019396aedd53c745e685a4eb235
selftests/xsk: Update poll test cases

Poll test case was not testing all the functionality of the poll feature
in the test suite. This patch updates the poll test case which contains 2
test cases to test the RX and the TX poll functionality and additional 2
more test cases to check the timeout feature of the poll event.

Poll test suite has 4 test cases:

1. TEST_TYPE_RX_POLL: Check if RX path POLLIN function works as expect.
   TX path can use any method to send the traffic.

2. TEST_TYPE_TX_POLL: Check if TX path POLLOUT function works as expect.
   RX path can use any method to receive the traffic.

3. TEST_TYPE_POLL_RXQ_EMPTY: Call poll function with parameter POLLIN on
   empty RX queue will cause timeout. If timeout then test case passes.

4. TEST_TYPE_POLL_TXQ_FULL: When TX queue is filled and packets are not
   cleaned by the kernel then if we invoke the poll function with POLLOUT
   it should trigger timeout.

Signed-off-by: Shibin Koikkara Reeny <shibin.koikkara.reeny@intel.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Link: https://lore.kernel.org/bpf/20220803144354.98122-1-shibin.koikkara.reeny@intel.com
tools/testing/selftests/bpf/xskxceiver.c
tools/testing/selftests/bpf/xskxceiver.h