Skip to content

selftests: move the AF_XDP test suite from bpf to net

Maciej Fijalkowski bpf netdev 2 versions – Applied

Status from this message: This series was applied to netdev/net-next.git (main)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 5 repliesApplied 4/4
  2. v14 patches 4 repliesSuperseded

Changes in v2 from the cover letter

* Patch 4: add xdp_hw_metadata to TEST_GEN_FILES via COND_GEN_FILES, as net/lib/Makefile does for xskxceiver, so that net/Makefile passes NIPA's check_selftest.
* Add Stanislav's tag.

Patches in v2 All 4 applied

#Subject and filesSizeRepliesApplied
1/4selftests/bpf: drop the test_progs AF_XDP wrappertools/testing/selftests/bpf/prog_tests/test_xsk.h tools/testing/selftests/bpf/prog_tests/xsk.c tools/testing/selftests/bpf/xskxceiver.c+2 -1810 repliesApplied
2/4selftests: net: add a generic rule for BPF skeletonstools/testing/selftests/net/bpf.mk+11 -20 repliesApplied
3/4selftests: xsk: move the AF_XDP test suite to selftests/netDocumentation/networking/af_xdp.rst MAINTAINERS tools/testing/selftests/bpf/.gitignore +18 more+108 -861 replyApplied
4/4selftests: net: move xdp_hw_metadata from selftests/bpfDocumentation/networking/xsk-tx-metadata.rst MAINTAINERS tools/testing/selftests/bpf/.gitignore +6 more+190 -270 repliesApplied

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchBjörn TöpelStanislav FomichevAlexei Starovoitov
SeriesA-b
1/4R-b A-b
2/4A-b
3/4R-b A-b
4/4A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v2 thread

Cover letter [PATCH v2 net-next 0/4] selftests: move the AF_XDP test suite from bpf to net

v1:
https://lore.kernel.org/netdev/[email protected]/
v1->v2:

* Patch 4: add xdp_hw_metadata to TEST_GEN_FILES via COND_GEN_FILES, as net/lib/Makefile does for xskxceiver, so that net/Makefile passes NIPA's check_selftest.
* Add Stanislav's tag.

Hi,

As the maintainers asked, this series is the first step of moving the AF_XDP selftests from selftests/bpf to selftests/net: the code moves and builds from its new location, without changing what the tests do. The rework [0] posted as "selftests: net: migrate AF_XDP test suite over to net" (v4) will follow on top of this move.

Patch 1 drops the test_progs wrapper of the AF_XDP tests, patch 2 adds a generic BPF skeleton rule to net/bpf.mk, patch 3 moves xskxceiver, its library and test_xsk.sh to selftests/net, and patch 4 (new, not covered at [0]) moves xdp_hw_metadata, which is built from the same library.

The xdp_metadata test stays in test_progs: it covers BPF core behaviour, and moving it would mean rewriting it for the kselftest harness. It keeps using xsk.c from net/lib/xsk.

xskxceiver and xdp_hw_metadata are the first users of bpftool at build time in selftests/net. NIPA has bpftool, but 0-day and KernelCI build net without it, so both tools are skipped with a warning when bpftool is missing or does not run.

test_xsk.sh is installed but not run by run_tests, so NIPA does not pick it up: it runs every case, including flaky ones, and some cases leak page_pool pages after skb_pp_cow_data() in generic XDP mode on veth-based runs. Until a later step makes the suite fit for NIPA, no CI runs the AF_XDP tests. test_xsk.sh is being removed by [0] but it is kept here as there is no other feasible way to run the test suite (if needed) until we come up with an upstreamable Python runner.

Thanks,
Maciej

[0]: https://lore.kernel.org/bpf/[email protected]/

Maciej Fijalkowski (4):
selftests/bpf: drop the test_progs AF_XDP wrapper
selftests: net: add a generic rule for BPF skeletons
selftests: xsk: move the AF_XDP test suite to selftests/net
selftests: net: move xdp_hw_metadata from selftests/bpf

 Documentation/networking/af_xdp.rst           |   6 +-
 Documentation/networking/xsk-tx-metadata.rst  |   2 +-
 MAINTAINERS                                   |   4 +-
 tools/testing/selftests/bpf/.gitignore        |   2 -
 tools/testing/selftests/bpf/Makefile          |  29 +--
 .../testing/selftests/bpf/Makefile.buildvars  |   6 +-
 tools/testing/selftests/bpf/network_helpers.c |  48 -----
 tools/testing/selftests/bpf/network_helpers.h |   2 -
 tools/testing/selftests/bpf/prog_tests/xsk.c  | 170 ------------------
 tools/testing/selftests/net/.gitignore        |   2 +
 tools/testing/selftests/net/Makefile          |  22 +++
 tools/testing/selftests/net/bpf.mk            |  13 +-
 tools/testing/selftests/net/config            |   1 +
 tools/testing/selftests/net/lib/.gitignore    |   2 +
 tools/testing/selftests/net/lib/Makefile      |  25 +++
 .../prog_tests => net/lib/xsk}/test_xsk.c     |   2 +-
 .../prog_tests => net/lib/xsk}/test_xsk.h     |   5 +-
 .../selftests/{bpf => net/lib/xsk}/xsk.c      |  49 ++++-
 .../selftests/{bpf => net/lib/xsk}/xsk.h      |   4 +
 .../{bpf => net/lib/xsk}/xsk_xdp_common.h     |   0
 .../lib/xsk/xsk_xdp_progs.bpf.c}              |   2 +-
 .../{bpf => net/lib/xsk}/xskxceiver.c         |  17 +-
 .../{bpf => net/lib/xsk}/xskxceiver.h         |   0
 .../selftests/{bpf => net}/test_xsk.sh        |   5 +
 .../xdp_hw_metadata.bpf.c}                    |  35 +++-
 .../selftests/{bpf => net}/xdp_hw_metadata.c  |  81 ++++++++-
 tools/testing/selftests/net/xdp_metadata.h    |  67 +++++++
 .../selftests/{bpf => net}/xsk_prereqs.sh     |   2 +-
 28 files changed, 309 insertions(+), 294 deletions(-)
 delete mode 100644 tools/testing/selftests/bpf/prog_tests/xsk.c
 rename tools/testing/selftests/{bpf/prog_tests => net/lib/xsk}/test_xsk.c (99%)
 rename tools/testing/selftests/{bpf/prog_tests => net/lib/xsk}/test_xsk.h (99%)
 rename tools/testing/selftests/{bpf => net/lib/xsk}/xsk.c (95%)
 rename tools/testing/selftests/{bpf => net/lib/xsk}/xsk.h (97%)
 rename tools/testing/selftests/{bpf => net/lib/xsk}/xsk_xdp_common.h (100%)
 rename tools/testing/selftests/{bpf/progs/xsk_xdp_progs.c => net/lib/xsk/xsk_xdp_progs.bpf.c} (98%)
 rename tools/testing/selftests/{bpf => net/lib/xsk}/xskxceiver.c (96%)
 rename tools/testing/selftests/{bpf => net/lib/xsk}/xskxceiver.h (100%)
 rename tools/testing/selftests/{bpf => net}/test_xsk.sh (98%)
 rename tools/testing/selftests/{bpf/progs/xdp_hw_metadata.c => net/xdp_hw_metadata.bpf.c} (75%)
 rename tools/testing/selftests/{bpf => net}/xdp_hw_metadata.c (92%)
 create mode 100644 tools/testing/selftests/net/xdp_metadata.h
 rename tools/testing/selftests/{bpf => net}/xsk_prereqs.sh (98%)

base-commit: fa5196392691051963726787944db872420dfa75

Signature · 1 line
2.43.0