From: netdev-bot+sashiko@kernel.org
To: 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 v4 net-next 02/15] selftests: xsk: size the TX UMEM in HW_SW_MAX_RING_SIZE
Date: Tue, 20 Oct 2026 19:30:20 +0000 [thread overview]
Message-ID: <179252462046.3135.1027737053245035744@kernel.org> (raw)
In-Reply-To: <20261016174338.787135-3-maciej.fijalkowski@intel.com>
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] This patch fixes a hang that exists in the tree today, but it has
no Fixes: tag.
--
selftests: xsk: size the TX UMEM in HW_SW_MAX_RING_SIZE
This commit gives the TX UMEM in testapp_hw_sw_max_ring_size() the same
size as the RX UMEM (8k frames and 8k rings). That way the test still
works with two interfaces once the single-interface mode is removed. It
also caps the second batch below the 8k XSK TX ring, so that
__send_pkts() cannot spin forever on NICs with large HW TX rings.
> diff --git a/tools/testing/selftests/bpf/prog_tests/test_xsk.c b/tools/testing/selftests/bpf/prog_tests/test_xsk.c
> index 2a13628740924..05457f77ca52c 100644
> --- a/tools/testing/selftests/bpf/prog_tests/test_xsk.c
> +++ b/tools/testing/selftests/bpf/prog_tests/test_xsk.c
[ ... ]
> @@ -2521,10 +2525,12 @@ int testapp_hw_sw_max_ring_size(struct test_spec *test)
> return ret;
>
> /* Set batch_size to 8152 for testing, as the ice HW ignores the 3 lowest bits when
> - * updating the Rx HW tail register.
> + * updating the Rx HW tail register. __send_pkts() waits until a whole batch fits
> + * in the XSK TX ring, so keep it below that ring's size on NICs with larger rings.
> */
> - test->ifobj_tx->xsk->batch_size = test->ifobj_tx->ring.tx_max_pending - 8;
> - test->ifobj_rx->xsk->batch_size = test->ifobj_tx->ring.tx_max_pending - 8;
> + batch_size = min(test->ifobj_tx->ring.tx_max_pending, max_descs) - 8;
> + test->ifobj_tx->xsk->batch_size = batch_size;
> + test->ifobj_rx->xsk->batch_size = batch_size;
[Severity: Low]
Should this patch carry a Fixes: tag?
The commit message describes the change as preparation for removing the
single-interface mode. The min() cap, though, fixes a hang that can
already happen in the current tree.
In the single-interface (shared UMEM) mode, thread_common_ops_tx()
copies the RX UMEM. xsk_configure_socket() then creates the XSK TX ring
with tx_size = umem->comp_size = 8192.
Before this patch the second batch was tx_max_pending - 8. On a NIC that
reports tx_max_pending above 8200, the reserve in __send_pkts() can
never succeed:
tools/testing/selftests/bpf/prog_tests/test_xsk.c:__send_pkts() {
...
while (xsk_ring_prod__reserve(&xsk->tx, xsk->batch_size, &idx) < xsk->batch_size) {
...
}
When use_poll is false this loop has no timeout, so the test spins
forever.
This looks reachable on real hardware. nfp supports AF_XDP zero-copy and
reports tx_max_pending as max_qc_size / tx_min_desc_per_pkt, with
max_qc_size being SZ_64K or SZ_256K.
The two-interface case is also broken before this patch. With a
1024-frame TX UMEM and a 2048 batch, the in-flight limit in
__send_pkts() goes negative and TX never sends.
Would a Fixes: tag pointing at the commit that added HW_SW_MAX_RING_SIZE
help stable maintainers and backporters pick this up?
> if (pkt_stream_replace(test, max_descs, MIN_PKT_SIZE)) {
> clean_sockets(test, test->ifobj_tx);
> clean_sockets(test, test->ifobj_rx);
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261016174338.787135-1-maciej.fijalkowski%40intel.com
next prev parent reply other threads:[~2026-10-20 19:30 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-16 17:43 [PATCH v4 net-next 00/15] selftests: net: migrate AF_XDP test suite over to net Maciej Fijalkowski
2026-10-16 17:43 ` [PATCH v4 net-next 01/15] selftests: xsk: factor endpoint work out of pthread wrappers Maciej Fijalkowski
2026-10-16 17:43 ` [PATCH v4 net-next 02/15] selftests: xsk: size the TX UMEM in HW_SW_MAX_RING_SIZE Maciej Fijalkowski
2026-10-20 19:30 ` netdev-bot+sashiko [this message]
2026-10-16 17:43 ` [PATCH v4 net-next 03/15] selftests: xsk: drop the single-interface loopback mode Maciej Fijalkowski
2026-10-20 19:30 ` netdev-bot+sashiko
2026-10-16 17:43 ` [PATCH v4 net-next 04/15] selftests/bpf: drop the test_progs AF_XDP wrapper Maciej Fijalkowski
2026-10-16 17:43 ` [PATCH v4 net-next 05/15] selftests: net: add a generic rule for BPF skeletons Maciej Fijalkowski
2026-10-16 17:43 ` [PATCH v4 net-next 06/15] selftests: xsk: move the AF_XDP test suite to selftests/net Maciej Fijalkowski
2026-10-20 19:30 ` netdev-bot+sashiko
2026-10-16 17:43 ` [PATCH v4 net-next 07/15] selftests: xsk: collect interface capabilities in struct xsk_caps Maciej Fijalkowski
2026-10-16 17:43 ` [PATCH v4 net-next 08/15] selftests: xsk: split xskxceiver main() into setup, run and cleanup Maciej Fijalkowski
2026-10-20 19:30 ` netdev-bot+sashiko
2026-10-16 17:43 ` [PATCH v4 net-next 09/15] selftests: xsk: run one test case per xskxceiver invocation Maciej Fijalkowski
2026-10-20 19:30 ` netdev-bot+sashiko
2026-10-16 17:43 ` [PATCH v4 net-next 10/15] selftests: xsk: run the RX and TX endpoints in separate processes Maciej Fijalkowski
2026-10-20 19:30 ` netdev-bot+sashiko
2026-10-16 17:43 ` [PATCH v4 net-next 11/15] selftests: xsk: send UDP over IPv4 or IPv6 between the interface MACs Maciej Fijalkowski
2026-10-20 19:30 ` netdev-bot+sashiko
2026-10-16 17:43 ` [PATCH v4 net-next 12/15] selftests: xsk: prepare xskxceiver for endpoints on two hosts Maciej Fijalkowski
2026-10-20 19:30 ` netdev-bot+sashiko
2026-10-16 17:43 ` [PATCH v4 net-next 13/15] selftests: xsk: list the hardware test cases Maciej Fijalkowski
2026-10-20 19:30 ` netdev-bot+sashiko
2026-10-16 17:43 ` [PATCH v4 net-next 14/15] selftests: drv-net: test AF_XDP zero-copy with an SKB peer Maciej Fijalkowski
2026-10-20 19:30 ` netdev-bot+sashiko
2026-10-16 17:43 ` [PATCH v4 net-next 15/15] selftests: xsk: document generic and hardware endpoint runs Maciej Fijalkowski
2026-10-18 19:20 ` [PATCH v4 net-next 00/15] selftests: net: migrate AF_XDP test suite over to net Björn Töpel
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=179252462046.3135.1027737053245035744@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--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