selftests/xsk: Iterate over all the sockets in the receive pkts function
authorTushar Vyavahare <tushar.vyavahare@intel.com>
Wed, 27 Sep 2023 13:52:37 +0000 (19:22 +0530)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 4 Oct 2023 13:26:02 +0000 (15:26 +0200)
commit8913e653e9b8e08f15c2c25d1b7a6d897350985b
treed535601c54348839eb12749e358d11e00cb3950d
parent985fd2145a2932c9d7bda219271e3f453d4607ef
selftests/xsk: Iterate over all the sockets in the receive pkts function

Improve the receive_pkt() function to enable it to receive packets from
multiple sockets. Define a sock_num variable to iterate through all the
sockets in the Rx path. Add nb_valid_entries to check that all the
expected number of packets are received.

Revise the function __receive_pkts() to only inspect the receive ring
once, handle any received packets, and promptly return. Implement a bitmap
to store the value of number of sockets. Update Makefile to include
find_bit.c for compiling xskxceiver.

Signed-off-by: Tushar Vyavahare <tushar.vyavahare@intel.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Magnus Karlsson <magnus.karlsson@intel.com>
Link: https://lore.kernel.org/bpf/20230927135241.2287547-5-tushar.vyavahare@intel.com
tools/testing/selftests/bpf/Makefile
tools/testing/selftests/bpf/xskxceiver.c
tools/testing/selftests/bpf/xskxceiver.h