Magnus Karlsson aa61d81f39 selftests/xsk: load and attach XDP program only once per mode
Load and attach the XDP program only once per XDP mode that is being
executed. Today, the XDP program is loaded and attached for every
test, then unloaded, which takes a long time on real NICs, since they
have to reconfigure their HW, in contrast to veth. The test suite now
completes in 21 seconds, instead of 207 seconds previously on my
machine. This is a speed-up of around 10x.

This is accomplished by moving the XDP loading from the worker threads
to the main thread and replacing the XDP loading interfaces of xsk.c
that was taken from the xsk support in libbpf, with something more
explicit that is more useful for these tests. Instead, the relevant
file descriptors and ifindexes are just passed down to the new
functions.

Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com>
Acked-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Link: https://lore.kernel.org/r/20230111093526.11682-10-magnus.karlsson@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2023-01-11 18:16:52 -08:00
..
2022-12-13 19:29:45 -08:00
2022-12-21 18:57:24 -08:00
2022-11-30 20:16:49 -04:00
2022-12-13 09:14:50 -08:00
2022-11-18 13:55:08 -08:00
2022-07-01 10:41:09 +02:00
2022-12-13 19:29:45 -08:00
2022-12-12 16:39:38 -08:00
2022-12-14 09:15:43 -08:00