[PATCH net-next 0/5] selftests/xsk: improve shared-UMEM coverage and infrastructure
Tushar Vyavahare <[email protected]>
| Newsgroups | org.kernel.vger.netdev,org.kernel.vger.bpf |
|---|---|
| Message-ID | <[email protected]> |
AF_XDP shared-UMEM support in existing XSK selftests is limited to a small set of scenarios and cleanup paths that become fragile as coverage expands. This series improves shared-UMEM testing and infrastructure in five steps. Patch 1 introduces explicit UMEM lifetime management with refcounting and consolidates socket/UMEM teardown into common helpers, keeping cleanup behavior consistent across normal completion and error paths. Patch 2 adds rollback for partial socket setup in xsk_configure() when xsk_socket__create() retries are exhausted or busy-poll setup fails. Patch 3 adds a length-based XDP steering helper and updates XSKMAP/test capacity constants for 4-socket scenarios. Steering is explicitly based on total XDP-visible packet length (data_end - data) using SHARED_UMEM_LEN_SPLIT. Patch 4 adds the shared-UMEM callback runner together with the first four test cases (4-socket, length-based steering, uneven distribution, and unaligned chunk mode) in one commit so every SHA in the series builds and bisects cleanly. The unaligned path snapshots/restores prior alignment flags with NULL-safe UMEM guards. Patch 5 makes pkt_stream_even_odd_sequence() rollback-safe by staging replacement streams in temporary arrays and committing only after all allocations succeed. Together, these patches make shared-UMEM setup/cleanup more robust and extend selftest coverage to common multi-socket and distribution scenarios. Signed-off-by: Magnus Karlsson <[email protected]> Signed-off-by: Tushar Vyavahare <[email protected]> Tushar Vyavahare (5): selftests/xsk: add UMEM users refcount and centralize socket teardown selftests/xsk: roll back partial socket setup on configure failures selftests/xsk: expand XSKMAP capacity and add length-based XDP program selftests/xsk: add shared-UMEM callback framework and initial test cases selftests/xsk: make pkt_stream_even_odd_sequence rollback-safe .../selftests/bpf/prog_tests/test_xsk.c | 428 ++++++++++++++++-- .../selftests/bpf/prog_tests/test_xsk.h | 24 + .../selftests/bpf/progs/xsk_xdp_progs.c | 19 +- tools/testing/selftests/bpf/xsk_xdp_common.h | 3 +- tools/testing/selftests/bpf/xskxceiver.c | 35 +- 5 files changed, 436 insertions(+), 73 deletions(-) -- 2.43.0