All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf-next 00/15] selftests/xsk: speed-ups, fixes, and new XDP programs
@ 2022-12-06  9:08 Magnus Karlsson
  2022-12-06  9:08 ` [PATCH bpf-next 01/15] selftests/xsk: print correct payload for packet dump Magnus Karlsson
                   ` (14 more replies)
  0 siblings, 15 replies; 28+ messages in thread
From: Magnus Karlsson @ 2022-12-06  9:08 UTC (permalink / raw)
  To: magnus.karlsson, bjorn, ast, daniel, netdev, maciej.fijalkowski,
	bpf, yhs, andrii, martin.lau, song, john.fastabend, kpsingh, sdf,
	haoluo, jolsa
  Cc: Magnus Karlsson, jonathan.lemon

This is a patch set of various performance improvements, fixes and the
introduction of more than one XDP program to the xsk selftests
framework so we can test more things in the future such as upcoming
multi-buffer and metadata support for AF_XDP. The new programs just
reuses the framework that all the other eBPF selftests use. The new
feature is used to implement one new test that does XDP_DROP on every
other packet. More tests using this will be added in future commits.

Contents:

* The run-time of the test suite is cut by 10x when executing the
  tests on a real NIC, by only attaching the XDP program once per mode
  we test, instead of once per test program.

* Over 700 lines of code have been removed. The xsk.c control file was
  moved straight over from libbpf when the xsk support was deprecated
  there. As it is now not used as library code that has to work with
  all kinds of versions of Linux, a lot of code could be dropped or
  simplified.

* Add a new command line option "-d" that can be used when a test
  fails and you want to debug it with gdb or some other debugger. The
  option creates the two veth netdevs and prints them to the screen
  without deleting them afterwards. This way these veth netdevs can be
  used when running xskxceiver in a debugger.

* Implemented the possibility to load external XDP programs so we can
  have more than the default one. This feature is used to implement a
  test where every other packet is dropped. Good exercise for the
  recycling mechanism of the xsk buffer pool used in zero-copy mode.

* Various clean-ups and small fixes in patches 1 to 5. None of these
  fixes has any impact on the correct execution of the tests when they
  pass, though they can be irritating when a test fails. IMHO, they do
  not need to go to bpf as they will not fix anything there. The first
  version of patches 1, 2, and 4 where previously sent to bpf, but has
  now been included here.

Patches:
1-5:   Small fixes and clean-ups
6:     New convenient debug option when using a debugger such as gdb
7-8:   Removal of unnecessary code
9:     Add the ability to load external XDP programs
10-11: Removal of more unnecessary code
12:    Implement a new test where every other packet is XDP_DROP:ed
13:    Unify the thread dispatching code
14-15: Simplify the way tests are written when using custom packet_streams
       or custom XDP programs

Thanks: Magnus

Magnus Karlsson (15):
  selftests/xsk: print correct payload for packet dump
  selftests/xsk: do not close unused file descriptors
  selftests/xsk: submit correct number of frames in populate_fill_ring
  selftests/xsk: print correct error codes when exiting
  selftests/xsk: remove unused variable outstanding_tx
  selftests/xsk: add debug option for creating netdevs
  selftests/xsk: get rid of asm store/release implementations
  selftests/xsk: remove namespaces
  selftests/xsk: load and attach XDP program only once per mode
  selftests/xsk: remove unnecessary code in control path
  selftests/xsk: get rid of built-in XDP program
  selftests/xsk: add test when some packets are XDP_DROPed
  selftests/xsk: merge dual and single thread dispatchers
  selftests/xsk: automatically restore packet stream
  selftests/xsk: automatically switch XDP programs

 tools/testing/selftests/bpf/Makefile          |   2 +-
 .../selftests/bpf/progs/xsk_def_prog.c        |  19 +
 .../selftests/bpf/progs/xsk_xdp_drop.c        |  25 +
 tools/testing/selftests/bpf/test_xsk.sh       |  42 +-
 tools/testing/selftests/bpf/xsk.c             | 674 +-----------------
 tools/testing/selftests/bpf/xsk.h             |  97 +--
 tools/testing/selftests/bpf/xsk_prereqs.sh    |  12 +-
 tools/testing/selftests/bpf/xskxceiver.c      | 376 +++++-----
 tools/testing/selftests/bpf/xskxceiver.h      |  19 +-
 9 files changed, 333 insertions(+), 933 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/progs/xsk_def_prog.c
 create mode 100644 tools/testing/selftests/bpf/progs/xsk_xdp_drop.c


base-commit: 08388efe593106d2fcd6ddf7a269db58a62a5dda
--
2.34.1

^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2022-12-14 10:54 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-06  9:08 [PATCH bpf-next 00/15] selftests/xsk: speed-ups, fixes, and new XDP programs Magnus Karlsson
2022-12-06  9:08 ` [PATCH bpf-next 01/15] selftests/xsk: print correct payload for packet dump Magnus Karlsson
2022-12-06  9:08 ` [PATCH bpf-next 02/15] selftests/xsk: do not close unused file descriptors Magnus Karlsson
2022-12-06  9:08 ` [PATCH bpf-next 03/15] selftests/xsk: submit correct number of frames in populate_fill_ring Magnus Karlsson
2022-12-06  9:08 ` [PATCH bpf-next 04/15] selftests/xsk: print correct error codes when exiting Magnus Karlsson
2022-12-06  9:08 ` [PATCH bpf-next 05/15] selftests/xsk: remove unused variable outstanding_tx Magnus Karlsson
2022-12-06  9:08 ` [PATCH bpf-next 06/15] selftests/xsk: add debug option for creating netdevs Magnus Karlsson
2022-12-07 13:39   ` Björn Töpel
2022-12-06  9:08 ` [PATCH bpf-next 07/15] selftests/xsk: get rid of asm store/release implementations Magnus Karlsson
2022-12-06 23:48   ` Daniel Borkmann
2022-12-07  8:23     ` Magnus Karlsson
2022-12-06  9:08 ` [PATCH bpf-next 08/15] selftests/xsk: remove namespaces Magnus Karlsson
2022-12-12 14:19   ` Maciej Fijalkowski
2022-12-14 10:44     ` Magnus Karlsson
2022-12-06  9:08 ` [PATCH bpf-next 09/15] selftests/xsk: load and attach XDP program only once per mode Magnus Karlsson
2022-12-12 15:01   ` Maciej Fijalkowski
2022-12-14 10:50     ` Magnus Karlsson
2022-12-06  9:08 ` [PATCH bpf-next 10/15] selftests/xsk: remove unnecessary code in control path Magnus Karlsson
2022-12-06  9:08 ` [PATCH bpf-next 11/15] selftests/xsk: get rid of built-in XDP program Magnus Karlsson
2022-12-06  9:08 ` [PATCH bpf-next 12/15] selftests/xsk: add test when some packets are XDP_DROPed Magnus Karlsson
2022-12-12 15:13   ` Maciej Fijalkowski
2022-12-14 10:53     ` Magnus Karlsson
2022-12-06  9:08 ` [PATCH bpf-next 13/15] selftests/xsk: merge dual and single thread dispatchers Magnus Karlsson
2022-12-12 16:10   ` Maciej Fijalkowski
2022-12-14 10:53     ` Magnus Karlsson
2022-12-06  9:08 ` [PATCH bpf-next 14/15] selftests/xsk: automatically restore packet stream Magnus Karlsson
2022-12-06  9:08 ` [PATCH bpf-next 15/15] selftests/xsk: automatically switch XDP programs Magnus Karlsson
2022-12-13 13:33   ` Maciej Fijalkowski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.