Netdev List
 help / color / mirror / Atom feed
From: Stanislav Fomichev <sdf.kernel@gmail.com>
To: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Cc: netdev@vger.kernel.org, bpf@vger.kernel.org,
	magnus.karlsson@intel.com,  stfomichev@gmail.com,
	kuba@kernel.org, pabeni@redhat.com, tushar.vyavahare@intel.com,
	 kerneljasonxing@gmail.com, bjorn@kernel.org
Subject: Re: [PATCH net-next 00/13] selftests: net: migrate AF_XDP test suite over to net
Date: Tue, 6 Oct 2026 15:04:08 -0700	[thread overview]
Message-ID: <asVwEyCK0NR4AwE9@devvm7509.cco0.facebook.com> (raw)
In-Reply-To: <asUzHc2Md9qu8Hx5@boxer>

On 10/06, Maciej Fijalkowski wrote:
> On Mon, Oct 05, 2026 at 11:06:52AM -0700, Stanislav Fomichev wrote:
> > On 10/01, Maciej Fijalkowski wrote:
> > > Hi,
> > > 
> > > This work moves the AF_XDP test suite over to selftests/net and adds
> > > a hardware test on top of the python-based drv-net infrastructure.
> > > Since a non-zero effort went into implementing xskxceiver's (not so
> > > great testing app name) test cases, we did not want to completely
> > > abandon it and start everything from scratch within different infra.
> > > However, hooking it up to the networking CI will allow us to run
> > > cyclic tests on real HW; before that, all of our HW tests were manual
> > > local runs.
> > > 
> > > Tests were based on a process with two threads responsible for the RX
> > > and TX paths, whereas the new infra expects two separate processes for
> > > the DUT and remote side, where each side has either rx or tx role.
> > > 
> > > To satisfy this requirement, this series makes each xskxceiver endpoint
> > > a process of its own, so that the RX and TX sides of a case can run on
> > > different hosts, and adds drivers/net/hw/xsk.py, which runs the existing
> > > test cases with the DUT in zero-copy mode against an SKB-mode xskxceiver
> > > on a remote host. The veth test keeps its cases and moves with the
> > > engine from selftests/bpf to selftests/net.
> > > 
> > > ZC tests used to expect a single NIC in loopback mode, with both
> > > sockets on one of its queues sharing a UMEM. Now we step away from it:
> > > the DUT and the remote are separate hosts, and an ntuple rule steers
> > > the test traffic to the AF_XDP queue.
> > > 
> > > The remote endpoint is xskxceiver in SKB mode rather than a plain
> > > socket, so both ends keep sharing the packet stream generation and
> > > validation of the existing cases. This reduces the need for remote
> > > interface being a NIC from narrow set of NICs that are AF_XDP ZC
> > > capable.
> > > 
> > > This implies that during the test run only one side is actually
> > > exercised, so let's introduce the concept of direction per test case.
> > > For example, this means SEND_RECEIVE in XSK_HW_RX will test
> > > ice_clean_rx_irq_zc() routine and in XSK_HW_TX the ice_xmit_zc().
> > > 
> > > BPF's 'test_progs -t xsk' is removed, as well as single interface mode,
> > > which was used for ZC tests. BPF CI therefore no longer runs the
> > > xskxceiver cases. test_xsk.sh is kept, as it is the only run that needs
> > > no hardware and not all tests are currently covered by the HW test side.
> > > We can decide whether to keep the delta test cases, drop them or somehow
> > > enable within HW tests.
> > > 
> > > Thread-based approach had a pacing mechanism that was a simple in-flight
> > > packet counter updated within critical section by both ends.
> > > Process-based way now is going to do this pacing via xsk_peer.
> > > 
> > > xsk_peer, the control channel, carries three fixed-size messages: READY
> > > is the barrier between steps, PROGRESS tells TX how many packets RX has
> > > consumed so that TX does not overrun the RX UMEM, and ABORT stops the
> > > peer after a failure.
> > > 
> > > test_xsk_case_defs.h lists each case with the DUT directions.
> > > xskxceiver builds its test table from that file, and xsk.py parses it to
> > > make the variants ksft_variants() named rx_<case> and tx_<case>, so -l,
> > > -t and -T work as for any other test.
> > > 
> > > 
> > > Patches 1-3 prepare the split. Patch 1 moves the endpoint work out of
> > > the pthread entry points. Patches 2 and 3 drop the single-interface
> > > loopback mode and the test_progs wrapper, which runs both endpoints as
> > > threads of test_progs; neither can work with one endpoint per process.
> > > Nothing else runs a subset of the cases, so patch 3 also merges the
> > > cases that the wrapper left out into the main list.
> > > 
> > > Patch 4 adds a generic rule for BPF skeletons to net/bpf.mk, as Jakub
> > > suggested in the review of the xdp_features move [0]; xskxceiver is
> > > its first user. If that series lands first with the same rule, this
> > > patch can be dropped.
> > > 
> > > Patch 5 moves the engine, its XDP program and the veth launcher to
> > > selftests/net. xsk.py needs xskxceiver, and a drv-net test can only
> > > rely on net/lib: the selftests build pulls net/lib in for net,
> > > drivers/net and drivers/net/hw, while it skips selftests/bpf by
> > > default. The veth test is software-only, so it goes to selftests/net,
> > > as the drv-net README asks. selftests/bpf keeps building xsk.c from
> > > its new place for xdp_hw_metadata and the xdp_metadata test.
> > > 
> > > Patches 6-9 split the engine. The interface capabilities move into one
> > > struct, so that a process can mirror them for the endpoint it does not
> > > own (6). main() is split into setup, run and cleanup (7). xskxceiver
> > > runs one case per invocation, and test_xsk.sh owns the mode x case
> > > matrix (8). Finally, the RX and TX endpoints become separate processes
> > > that meet over a small TCP control channel (9).
> > > 
> > > Patch 10 adds the xskxceiver options that a two-host run needs.
> > > Patch 11 moves the case list into test_xsk_case_defs.h, so that
> > > xsk.py can read it as well, and patch 12 adds xsk.py on top of them.
> > > Patch 13 documents both setups.
> > > 
> > > 
> > > Tested with back-to-back ice NICs connected between separate hosts, with
> > > following net.config:
> > > 
> > > NETIF=ens785f1np1
> > > LOCAL_V4=192.168.100.1
> > > REMOTE_V4=192.168.100.2
> > > REMOTE_TYPE=ssh
> > > REMOTE_ARGS=mfijalko@hostname
> > > XSK_REMOTE_BIN=/home/mfijalko/bpf-next/tools/testing/selftests/drivers/net/hw/xskxceiver
> > > XSK_REMOTE_SUDO=1
> > > 
> > > 
> > > Known issues:
> > > - Every case pays for process start-up, XDP attach and detach and, on
> > >   hardware, its remote commands. We used to configure resources once
> > >   and then execute the whole test suite; it doesn't seem to be
> > >   CI-friendly and it is preferred to have each case's resource
> > >   management separated; that on the other hand increases the
> > >   execution time of the whole test suite.
> > 
> > [..]
> > 
> > > - The XDP programs redirect every packet, so the link under test must
> > >   carry no other traffic. SSH and the control channel go to the
> > >   REMOTE_ARGS host, which has to be reached over another link.
> > 
> > Will this work on NIPA?
> 
> Yeah good that you're bringing this up, I see NIPA has a e810 setup within
> same machine which is not what i tested on my side. This means the
> assumption/requirement of having isolated link under test has to be lifted
> as e810 cards on NIPA will carry management traffic via same link. I'll
> add XDP prog logic as you point out, thanks.
> 
> I also hit the ice bug after connecting interfaces within single machine
> which was hiding from me throughout whole local testing, during RSS update
> where we only want to touch indirection table, symmetric-xor hashing was
> being turned on which caused later rss operations to fail; I'll post a fix
> to iwl-net and include some heads-up to v2.
> 
> > 
> > I took a quick pass, nothing pops us for me. The only thing I'm not sure
> > is the bpftool dependency (whether we need to build it or there is
> > something on the system).
> 
> We need it due to skeleton usage and other change was also utilizing it so
> I thought it would be acceptable.

No, no, I'm not questioning the need, just not sure whether we need to build
it in the selftest makefiles (like bpf selftests do) or it's ok to use
the system one (if there is one).

  reply	other threads:[~2026-10-06 22:07 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-01 20:21 [PATCH net-next 00/13] selftests: net: migrate AF_XDP test suite over to net Maciej Fijalkowski
2026-10-01 20:21 ` [PATCH net-next 01/13] selftests: xsk: factor endpoint work out of pthread wrappers Maciej Fijalkowski
2026-10-01 20:21 ` [PATCH net-next 02/13] selftests: xsk: drop the single-interface loopback mode Maciej Fijalkowski
2026-10-01 20:21 ` [PATCH net-next 03/13] selftests/bpf: drop the test_progs AF_XDP wrapper Maciej Fijalkowski
2026-10-01 20:21 ` [PATCH net-next 04/13] selftests: net: add a generic rule for BPF skeletons Maciej Fijalkowski
2026-10-01 20:21 ` [PATCH net-next 05/13] selftests: xsk: move the AF_XDP test suite to selftests/net Maciej Fijalkowski
2026-10-01 20:21 ` [PATCH net-next 06/13] selftests: xsk: collect interface capabilities in struct xsk_caps Maciej Fijalkowski
2026-10-01 20:21 ` [PATCH net-next 07/13] selftests: xsk: split xskxceiver main() into setup, run and cleanup Maciej Fijalkowski
2026-10-01 20:21 ` [PATCH net-next 08/13] selftests: xsk: run one test case per xskxceiver invocation Maciej Fijalkowski
2026-10-01 20:21 ` [PATCH net-next 09/13] selftests: xsk: run the RX and TX endpoints in separate processes Maciej Fijalkowski
2026-10-02 18:07   ` Vyavahare, Tushar
2026-10-01 20:21 ` [PATCH net-next 10/13] selftests: xsk: add a hardware mode to xskxceiver Maciej Fijalkowski
2026-10-01 20:21 ` [PATCH net-next 11/13] selftests: xsk: share test case definitions with hardware runner Maciej Fijalkowski
2026-10-01 20:21 ` [PATCH net-next 12/13] selftests: drv-net: test AF_XDP zero-copy with an SKB peer Maciej Fijalkowski
2026-10-01 20:21 ` [PATCH net-next 13/13] selftests: xsk: document generic and hardware endpoint runs Maciej Fijalkowski
2026-10-05 18:06 ` [PATCH net-next 00/13] selftests: net: migrate AF_XDP test suite over to net Stanislav Fomichev
2026-10-06 17:42   ` Maciej Fijalkowski
2026-10-06 22:04     ` Stanislav Fomichev [this message]
2026-10-07 12:22       ` Maciej Fijalkowski
2026-10-07 17:26         ` Stanislav Fomichev

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=asVwEyCK0NR4AwE9@devvm7509.cco0.facebook.com \
    --to=sdf.kernel@gmail.com \
    --cc=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