BPF List
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Björn Töpel" <bjorn@kernel.org>, bpf@vger.kernel.org
Subject: Re: [PATCH net-next 7/7] selftests: net: Test XDP on io_uring RX
Date: Wed, 18 Nov 2026 16:48:29 +0000	[thread overview]
Message-ID: <sashiko-outbox-221557@kernel.org> (raw)
In-Reply-To: <20261117164700.2157816-8-bjorn@kernel.org>

Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Medium] selftests: drv-net: broken HDS check and restore in
  xdp_setup()
- [Medium] selftests: drv-net: xdp_setup() leaves RSS table
  user-configured
--

commit b83bbac3d08069e4bdafe35dfbe5badfc8c67e47
Author: Björn Töpel <bjorn@kernel.org>

selftests: net: Test XDP on io_uring RX

This commit adds a selftest that compares page-backed and io_uring-backed RX
queues under a multi-buffer native XDP program, verifying packet memory access
restrictions and payload reception via recv() and RECV_ZC.

> diff --git a/tools/testing/selftests/drivers/net/hw/iou-zcrx.py b/tools/testing/selftests/drivers/net/hw/iou-zcrx.py
> index 5047fdb560057..e6b765c523ed3 100755
> --- a/tools/testing/selftests/drivers/net/hw/iou-zcrx.py
> +++ b/tools/testing/selftests/drivers/net/hw/iou-zcrx.py

[ ... ]

> @@ -243,6 +253,91 @@ def test_zcrx_large_chunks(cfg) -> None:
>          cmd(tx_cmd, host=cfg.remote)
>  
>  
> +def xdp_setup(cfg):
> +    """Reserve one RX queue without changing unrelated RSS contexts."""
> +    cfg.require_ipver('6')
> +    dev = cfg.netnl.dev_get({'ifindex': cfg.ifindex})
> +    if not {'basic', 'rx-sg'} <= set(dev.get('xdp-features', [])):
> +        raise KsftSkipEx('Device lacks native multi-buffer XDP')
> +    if 'xdp' in ip(f"-d link show dev {cfg.ifname}", json=True)[0]:
> +        raise KsftSkipEx('An XDP program is already attached')
> +
> +    queues = cfg.netnl.queue_get({'ifindex': cfg.ifindex}, dump=True)
> +    if any(key in q for q in queues
> +           for key in ('io-uring', 'dmabuf', 'xsk', 'lease')):
> +        raise KsftSkipEx('Device has an active queue provider or lease')
> +
> +    header = {'dev-index': cfg.ifindex}
> +    try:
> +        channels = cfg.ethnl.channels_get({'header': header})
> +        rings = cfg.ethnl.rings_get({'header': header})
> +        indir = cfg.ethnl.rss_get({'header': header})['indir']
> +    except NlError as error:
> +        if error.error != errno.EOPNOTSUPP:
> +            raise
> +        raise KsftSkipEx('Device lacks channels, rings or RSS support') from error
> +    count = channels.get('combined-count', 0)
> +    if count < 2:
> +        raise KsftSkipEx('Test requires at least two combined channels')
> +    if rings.get('tcp-data-split', 'unknown') == 'unknown':
> +        raise KsftSkipEx('Device lacks TCP header/data split')
> +
> +    _require_ntuple(cfg)
> +    cfg.target = count - 1
> +    old_rings = {'header': header,
> +                 'tcp-data-split': rings['tcp-data-split']}
> +    new_rings = {'header': header, 'tcp-data-split': 'enabled'}
> +    if 'hds-thresh' in rings:
> +        old_rings['hds-thresh'] = rings['hds-thresh']
> +        new_rings['hds-thresh'] = 0
> +    cfg.ethnl.rings_set(new_rings)
> +    defer(cfg.ethnl.rings_set, old_rings)

[Severity: Medium]
Does saving and restoring rings['tcp-data-split'] here leave header/data
split misconfigured or fail during cleanup?

On drivers such as fbnic and netdevsim, get_ringparam() reports
tcp-data-split as 'enabled' even when dev->cfg->hds_config is
ETHTOOL_TCP_DATA_SPLIT_UNKNOWN.  Restoring rings['tcp-data-split'] instead
of resetting 'tcp-data-split' to 'unknown' (as single() and rss() do
earlier in this file) leaves dev->cfg->hds_config set to
ETHTOOL_TCP_DATA_SPLIT_ENABLED after the test, causing dev_xdp_install() to
reject subsequent single-buffer XDP programs with -EBUSY.

In addition, bnxt_get_ringparam() can report 'disabled' while
bnxt_set_ringparam() rejects ETHTOOL_TCP_DATA_SPLIT_DISABLED with -EINVAL
on cleanup, and mlx5e_ethtool_get_ringparam() leaves tcp_data_split at
'unknown' until explicitly enabled, causing the pre-check above to skip on
mlx5.

> +
> +    cfg.ethnl.rss_set({'header': header,
> +                      'indir': [q if q != cfg.target else 0 for q in indir]})
> +    defer(cfg.ethnl.rss_set, {'header': header, 'indir': indir})

[Severity: Medium]
Does restoring the saved indir list leave the RSS indirection table marked
as user-configured?

In ethnl_rss_set(), passing a non-empty indir array sets
dev->ethtool->rss_indir_user_size to a non-zero value rather than resetting
it to 0.  After test_zcrx_xdp() finishes (or skips in probe_xdp()),
netif_is_rxfh_configured() stays true with queue count - 1 referenced in
the table, so later tests or ethtool calls that reduce the channel count
fail in ethtool_check_max_channel() with -EINVAL.  Passing 'indir': None
resets the indirection table to its default state.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261117164700.2157816-1-bjorn@kernel.org?part=7

      reply	other threads:[~2026-11-18 16:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-17 16:46 [PATCH net-next 0/7] XDP with io_uring zero-copy RX and devmem Björn Töpel
2026-11-17 16:46 ` [PATCH net-next 1/7] bpf: Keep XDP helpers within readable data Björn Töpel
2026-11-17 16:46 ` [PATCH net-next 2/7] xdp: Reject frames with unreadable fragments Björn Töpel
2026-11-17 16:46 ` [PATCH net-next 3/7] net: Admit native XDP on provider queues Björn Töpel
2026-11-18 16:48   ` sashiko-bot
2026-11-17 16:46 ` [PATCH net-next 4/7] eth: fbnic: Run " Björn Töpel
2026-11-17 16:46 ` [PATCH net-next 5/7] netdevsim: Run native XDP next to devmem Björn Töpel
2026-11-17 16:46 ` [PATCH net-next 6/7] selftests: net: Test XDP with devmem bindings Björn Töpel
2026-11-18 16:48   ` sashiko-bot
2026-11-17 16:46 ` [PATCH net-next 7/7] selftests: net: Test XDP on io_uring RX Björn Töpel
2026-11-18 16:48   ` sashiko-bot [this message]

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=sashiko-outbox-221557@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=bjorn@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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