selftests/xsk: populate fill ring based on frags needed
authorMagnus Karlsson <magnus.karlsson@intel.com>
Tue, 16 May 2023 10:31:07 +0000 (12:31 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 17 May 2023 05:31:51 +0000 (22:31 -0700)
commit86e41755b43227858ef04b452c25b9dbcf667622
tree3621d8a2076ec951d3beb2db708685890a307e91
parent041b68f688a38865434d7b8fbfe64beb03e54ff2
selftests/xsk: populate fill ring based on frags needed

Populate the fill ring based on the number of frags a packet
needs. With multi-buffer support, a packet might require more than a
single fragment/buffer, so the function xsk_populate_fill_ring() needs
to consider how many buffers a packet will consume, and put that many
buffers on the fill ring for each packet it should receive. As we are
still not sending any multi-buffer packets, the function will only
produce one buffer per packet at the moment.

Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com>
Link: https://lore.kernel.org/r/20230516103109.3066-9-magnus.karlsson@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/xsk.h
tools/testing/selftests/bpf/xskxceiver.c