Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next v3 0/4] selftests/xsk: improve shared-UMEM coverage
@ 2026-08-19  2:44 Tushar Vyavahare
  2026-08-19  2:44 ` [PATCH net-next v3 1/4] selftests/xsk: add UMEM users refcount and centralize socket teardown Tushar Vyavahare
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Tushar Vyavahare @ 2026-08-19  2:44 UTC (permalink / raw)
  To: netdev, magnus.karlsson, maciej.fijalkowski, stfomichev,
	kernelxing, davem, kuba, pabeni, ast, daniel, tirthendu.sarkar,
	tushar.vyavahare, andrii
  Cc: bpf

AF_XDP shared-UMEM support in the existing XSK selftests is limited to
a small set of scenarios, while the supporting setup and cleanup paths
become fragile as coverage expands.

This series improves shared-UMEM testing and infrastructure in four
steps.

Patch 1 makes UMEM ownership explicit with refcounting and centralizes
socket and UMEM teardown, keeping cleanup behavior consistent across
normal completion and error paths. A UMEM that survives teardown now
fails the test instead of leaking silently.

Patch 2 prevents TX setup when RX socket configuration has already
failed. This avoids shared-UMEM TX setup relying on incomplete RX-side
socket and UMEM state.

Patch 3 expands XSKMAP and test capacity to four sockets and adds a
length-based XDP steering program. The classifier uses total
XDP-visible packet length (data_end - data) and SHARED_UMEM_LEN_SPLIT.

Patch 4 adds the shared-UMEM callback runner and initial 4-socket,
length-based steering, uneven-distribution, and unaligned-chunk test
cases. The three packet-stream sequences share one transactional helper
that stages replacement streams and publishes them into the socket
arrays only after every allocation has succeeded.

Together, these patches strengthen shared-UMEM setup and cleanup and
extend selftest coverage to multi-socket and packet-distribution
scenarios.

v1 -> v2:
- [1/4] Track per-slot UMEM ownership and centralize refcount-based
  teardown. [sashiko]
- [2/4] Publish RX failure before the setup barrier and skip TX setup
  after a failed RX configuration. [BPF AI]
- [3/4] Trim the length-classifier comment to match nearby BPF style.
  [BPF AI]
- [4/4] Clarify the partial stream replacement leak in the commit
  message. [BPF AI]

v2 -> v3:
- [1/4] Keep one xsk_umem_info for shared-UMEM TX setup instead of
  copying it; initialize only the non-owning TX buffer view. [sashiko]
- [1/4] Propagate xsk_umem__delete() errors so the stack-allocated
  zero-copy probe cannot lose deferred cleanup. [sashiko]
- [1/4] Record UMEM deletion failures in test->fail; in-test teardown
  cannot retry them. [sashiko]
- [1/4] Collapse the redundant teardown helpers into a single loop.
  [sashiko]
- [4/4] Fold the previous 5/5 rollback-safe stream replacement into
  this patch. [BPF AI]
- [4/4] Factor the three stream sequences into pkt_stream_replace_seq(),
  driven by a pkt_stream_dims_fn callback. [BPF AI]
- [4/4] Drop the stream-readiness check and the uneven-distribution
  hook; neither could fail. [sashiko]
- [4/4] Drop the unreachable NULL-safe UMEM guards from the unaligned
  test. [co-pilot]

Co-developed-by: Magnus Karlsson <magnus.karlsson@intel.com>
Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com>
Signed-off-by: Tushar Vyavahare <tushar.vyavahare@intel.com>

Tushar Vyavahare (4):
  selftests/xsk: add UMEM users refcount and centralize socket teardown
  selftests/xsk: skip TX setup after RX configuration failure
  selftests/xsk: expand XSKMAP capacity and add length-based XDP program
  selftests/xsk: add shared-UMEM callback framework and initial test
    cases

 .../selftests/bpf/prog_tests/test_xsk.c       | 340 +++++++++++++++---
 .../selftests/bpf/prog_tests/test_xsk.h       |  27 +-
 .../selftests/bpf/progs/xsk_xdp_progs.c       |  15 +-
 tools/testing/selftests/bpf/xsk_xdp_common.h  |   3 +-
 tools/testing/selftests/bpf/xskxceiver.c      |  40 +--
 5 files changed, 344 insertions(+), 81 deletions(-)

-- 
2.43.0


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

end of thread, other threads:[~2026-08-19  2:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-19  2:44 [PATCH net-next v3 0/4] selftests/xsk: improve shared-UMEM coverage Tushar Vyavahare
2026-08-19  2:44 ` [PATCH net-next v3 1/4] selftests/xsk: add UMEM users refcount and centralize socket teardown Tushar Vyavahare
2026-08-19  2:44 ` [PATCH net-next v3 2/4] selftests/xsk: skip TX setup after RX configuration failure Tushar Vyavahare
2026-08-19  2:44 ` [PATCH net-next v3 3/4] selftests/xsk: expand XSKMAP capacity and add length-based XDP program Tushar Vyavahare
2026-08-19  2:44 ` [PATCH net-next v3 4/4] selftests/xsk: add shared-UMEM callback framework and initial test cases Tushar Vyavahare

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox