selftests: xsk: Simplify xsk and umem arrays
authorMagnus Karlsson <magnus.karlsson@intel.com>
Tue, 7 Sep 2021 07:19:09 +0000 (09:19 +0200)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 10 Sep 2021 19:15:30 +0000 (21:15 +0200)
commited7b74dc777777254a97de3e18e5dcbcebf3f015
treea10a0a2747ac49a16b0d5b63ffd2ab0d01fa27a3
parent0b46b755056043dccfe078b96b256502b88f2464
selftests: xsk: Simplify xsk and umem arrays

Simplify the xsk_info and umem_info allocation by allocating them
upfront in an array, instead of allocating an array of pointers to
future creations of these. Allocating them upfront also has the
advantage that configuration information can be stored in these
structures instead of relying on global variables. With the previous
structure, xsk_info and umem_info were created too late to be able to
store most configuration information. This will be used to eliminate
most global variables in later patches in this series.

Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Link: https://lore.kernel.org/bpf/20210907071928.9750-2-magnus.karlsson@gmail.com
tools/testing/selftests/bpf/xdpxceiver.c
tools/testing/selftests/bpf/xdpxceiver.h