Netdev List
 help / color / mirror / Atom feed
From: "Björn Töpel" <bjorn@kernel.org>
To: Maciej Fijalkowski <maciej.fijalkowski@intel.com>,
	netdev@vger.kernel.org
Cc: bpf@vger.kernel.org, magnus.karlsson@intel.com,
	stfomichev@gmail.com, kuba@kernel.org, pabeni@redhat.com,
	tushar.vyavahare@intel.com, kerneljasonxing@gmail.com,
	Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Subject: Re: [PATCH v3 net-next 09/15] selftests: xsk: run one test case per xskxceiver invocation
Date: Thu, 15 Oct 2026 10:34:34 +0200	[thread overview]
Message-ID: <875wz3746d.fsf@all.your.base.are.belong.to.us> (raw)
In-Reply-To: <20261014184539.774708-10-maciej.fijalkowski@intel.com>

Maciej Fijalkowski <maciej.fijalkowski@intel.com> writes:

> Replace test_xsk.sh and xsk_prereqs.sh with test_xsk.py, which runs
> xskxceiver once per mode and case, so that every case starts from a
> fresh process and a crash fails only its own case. A single case is
> also the unit that the next patch splits into RX and TX processes.
>
> xskxceiver now requires -m and -t, runs exactly that case, reports one
> KTAP result and exits with its verdict. An unsupported mode skips the
> case instead of exiting with XFAIL.
>
> test_xsk.py uses the networking selftests Python library, as does the
> hardware test added later, so every case is a KTAP case of its own:
> test_xsk runs each case that xskxceiver -l lists in skb and drv mode,
> e.g. test_xsk.drv_SEND_RECEIVE, and test_xsk_busy_poll runs them again
> with busy polling. The usual -t and -T options select cases in place of
> the script's -l, -m and -t, and -v and -d go away, as the output of a
> run that does not pass is logged. Each case runs on a veth pair of its
> own, so an MTU or an XDP program that a crashed case leaves behind
> cannot reach the next one. The pair stays in the current network
> namespace, as only the initial one has the net.core.max_skb_frags
> sysctl that xskxceiver reads. A case is killed and fails after two
> minutes, and the test skips when xskxceiver was not built.

This timeout might need to be easily changable from the cli...
follow-up!

> test_xsk.py reserves 32 huge pages for the UNALIGNED cases, restores
> the count when it ends and leaves those cases out when it cannot
> reserve them. ksft_run() exits on -l and -h before the count is
> restored, so test_xsk.py rejects both. The huge page, busy-poll and
> endpoint wait helpers, which the hardware test shares, go to
> net/lib/py/xsk.py, which joins the AF_XDP entry in MAINTAINERS.
>
> test_xsk.py leaves out two cases that test_progs skipped as flaky:
>
> - XDP_ADJUST_TAIL_SHRINK_MULTI_BUFF: bpf_xdp_adjust_tail() frees the
>   trimmed fragment as the memory type of the XDP RX queue, which veth
>   and generic XDP leave at MEM_TYPE_PAGE_SHARED for frames that they
>   copy into page_pool pages, so the page leaks from its pool and the
>   pool's shutdown stalls
> - XDP_ADJUST_TAIL_GROW: it skips in skb mode, and in drv mode veth
>   copies each frame into a page_pool fragment that leaves no room to
>   grow the 128-byte frames of the case unless it is the last one of its
>   page, so the XDP program drops most frames
>
> Drop the xskxceiver.c note on enabling packet dumps with -D in
> test_xsk.sh; xskxceiver has no such option and dumps packets on
> validation errors.
>
> Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>

[...]

>  tools/testing/selftests/net/test_xsk.py       | 140 +++++++++++
>  tools/testing/selftests/net/test_xsk.sh       | 230 ------------------

Yum! Nice!

Reviewed-by: Björn Töpel <bjorn@kernel.org>

  reply	other threads:[~2026-10-15  8:34 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-14 18:45 [PATCH v3 net-next 00/15] selftests: net: migrate AF_XDP test suite over to net Maciej Fijalkowski
2026-10-14 18:45 ` [PATCH v3 net-next 01/15] selftests: xsk: factor endpoint work out of pthread wrappers Maciej Fijalkowski
2026-10-15  8:14   ` Björn Töpel
2026-10-14 18:45 ` [PATCH v3 net-next 02/15] selftests: xsk: size the TX UMEM in HW_SW_MAX_RING_SIZE Maciej Fijalkowski
2026-10-15  8:15   ` Björn Töpel
2026-10-14 18:45 ` [PATCH v3 net-next 03/15] selftests: xsk: drop the single-interface loopback mode Maciej Fijalkowski
2026-10-15  8:17   ` Björn Töpel
2026-10-14 18:45 ` [PATCH v3 net-next 04/15] selftests/bpf: drop the test_progs AF_XDP wrapper Maciej Fijalkowski
2026-10-15  8:18   ` Björn Töpel
2026-10-14 18:45 ` [PATCH v3 net-next 05/15] selftests: net: add a generic rule for BPF skeletons Maciej Fijalkowski
2026-10-15  8:20   ` Björn Töpel
2026-10-14 18:45 ` [PATCH v3 net-next 06/15] selftests: xsk: move the AF_XDP test suite to selftests/net Maciej Fijalkowski
2026-10-15  8:22   ` Björn Töpel
2026-10-14 18:45 ` [PATCH v3 net-next 07/15] selftests: xsk: collect interface capabilities in struct xsk_caps Maciej Fijalkowski
2026-10-15  8:27   ` Björn Töpel
2026-10-14 18:45 ` [PATCH v3 net-next 08/15] selftests: xsk: split xskxceiver main() into setup, run and cleanup Maciej Fijalkowski
2026-10-15  8:29   ` Björn Töpel
2026-10-14 18:45 ` [PATCH v3 net-next 09/15] selftests: xsk: run one test case per xskxceiver invocation Maciej Fijalkowski
2026-10-15  8:34   ` Björn Töpel [this message]
2026-10-14 18:45 ` [PATCH v3 net-next 10/15] selftests: xsk: run the RX and TX endpoints in separate processes Maciej Fijalkowski
2026-10-15  9:04   ` Björn Töpel
2026-10-14 18:45 ` [PATCH v3 net-next 11/15] selftests: xsk: add a hardware mode to xskxceiver Maciej Fijalkowski
2026-10-15  9:42   ` Björn Töpel
2026-10-14 18:45 ` [PATCH v3 net-next 12/15] selftests: xsk: pass non-test traffic to the stack in hardware mode Maciej Fijalkowski
2026-10-15 10:05   ` Björn Töpel
2026-10-14 18:45 ` [PATCH v3 net-next 13/15] selftests: xsk: list the hardware test cases Maciej Fijalkowski
2026-10-14 18:45 ` [PATCH v3 net-next 14/15] selftests: drv-net: test AF_XDP zero-copy with an SKB peer Maciej Fijalkowski
2026-10-15 10:29   ` Björn Töpel
2026-10-14 18:45 ` [PATCH v3 net-next 15/15] selftests: xsk: document generic and hardware endpoint runs Maciej Fijalkowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=875wz3746d.fsf@all.your.base.are.belong.to.us \
    --to=bjorn@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=kerneljasonxing@gmail.com \
    --cc=kuba@kernel.org \
    --cc=maciej.fijalkowski@intel.com \
    --cc=magnus.karlsson@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=stfomichev@gmail.com \
    --cc=tushar.vyavahare@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox