From: David Wei <dw@davidwei.uk>
To: Juanlu Herrero <juanlu@fastmail.com>, netdev@vger.kernel.org
Cc: io-uring@vger.kernel.org, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org, kuba@kernel.org,
asml.silence@gmail.com, pabeni@redhat.com, shuah@kernel.org
Subject: Re: [PATCH net-next v5 6/6] selftests: net: add rss_multiqueue test variant to iou-zcrx
Date: Fri, 14 Aug 2026 09:01:13 -0700 [thread overview]
Message-ID: <a6dd543a-1622-400e-b389-2cb50923e7f1@davidwei.uk> (raw)
In-Reply-To: <20260814012348.46958-7-juanlu@fastmail.com>
On 2026-08-13 18:23, Juanlu Herrero wrote:
> Add a rss_multiqueue Python test variant that exercises multi-queue
> zero-copy receive on a single listening socket.
>
> Assisted-by: Claude:claude-opus-4-8
> Signed-off-by: Juanlu Herrero <juanlu@fastmail.com>
> ---
> .../selftests/drivers/net/hw/iou-zcrx.py | 50 ++++++++++++++++++-
> 1 file changed, 48 insertions(+), 2 deletions(-)
>
> diff --git a/tools/testing/selftests/drivers/net/hw/iou-zcrx.py b/tools/testing/selftests/drivers/net/hw/iou-zcrx.py
> index b7a225fe4beae..c833535d8a03c 100755
> --- a/tools/testing/selftests/drivers/net/hw/iou-zcrx.py
> +++ b/tools/testing/selftests/drivers/net/hw/iou-zcrx.py
> @@ -30,6 +30,13 @@ def create_rss_ctx(cfg):
> return int(values)
>
>
> +def create_rss_ctx_multi(cfg, start, count):
> + """Create an RSS context spanning count queues from start, return its ID."""
> + output = ethtool(f"-X {cfg.ifname} context new start {start} equal {count}").stdout
> + values = re.search(r'New RSS context is (\d+)', output).group(1)
> + return int(values)
> +
> +
> def set_flow_rule(cfg):
> output = ethtool(f"-N {cfg.ifname} flow-type tcp6 dst-port {cfg.port} action {cfg.target}").stdout
> values = re.search(r'ID (\d+)', output).group(1)
> @@ -127,17 +134,56 @@ def _require_ntuple(cfg):
> defer(ethtool, f"-K {cfg.ifname} ntuple-filters off")
>
>
> +def rss_multiqueue(cfg):
> + """Steer the test flow to a multi-queue RSS context for multi-thread zcrx."""
> + channels = cfg.ethnl.channels_get({'header': {'dev-index': cfg.ifindex}})
> + channels = channels['combined-count']
> + if channels < 3:
> + raise KsftSkipEx('Test requires NETIF with at least 3 combined channels')
> +
> + rings = cfg.ethnl.rings_get({'header': {'dev-index': cfg.ifindex}})
> + rx_rings = rings['rx']
> + hds_thresh = rings.get('hds-thresh', 0)
> +
> + cfg.ethnl.rings_set({'header': {'dev-index': cfg.ifindex},
> + 'tcp-data-split': 'enabled',
> + 'hds-thresh': 0,
> + 'rx': 64})
> + defer(cfg.ethnl.rings_set, {'header': {'dev-index': cfg.ifindex},
> + 'tcp-data-split': 'unknown',
> + 'hds-thresh': hds_thresh,
> + 'rx': rx_rings})
> + defer(mp_clear_wait, cfg)
> +
> + cfg.num_threads = 2
> + cfg.target = channels - cfg.num_threads
> + ethtool(f"-X {cfg.ifname} equal {cfg.target}")
> + defer(ethtool, f"-X {cfg.ifname} default")
> +
> + rss_ctx_id = create_rss_ctx_multi(cfg, cfg.target, cfg.num_threads)
> + defer(ethtool, f"-X {cfg.ifname} delete context {rss_ctx_id}")
> +
> + flow_rule_id = set_flow_rule_rss(cfg, rss_ctx_id)
> + defer(ethtool, f"-N {cfg.ifname} delete {flow_rule_id}")
> +
> +
> @ksft_variants([
> KsftNamedVariant("single", single),
> KsftNamedVariant("rss", rss),
> + KsftNamedVariant("rss_multiqueue", rss_multiqueue),
> ])
> def test_zcrx(cfg, setup) -> None:
> cfg.require_ipver('6')
> _require_ntuple(cfg)
>
> + cfg.num_threads = 1
> +
> setup(cfg)
> - rx_cmd = f"{cfg.bin_local} -s -p {cfg.port} -i {cfg.ifname} -q {cfg.target}"
> - tx_cmd = f"{cfg.bin_remote} -c -h {cfg.addr_v['6']} -p {cfg.port} -l 12840"
> +
> + rx_cmd = (f"{cfg.bin_local} -s -p {cfg.port} -i {cfg.ifname} "
> + f"-q {cfg.target} -t {cfg.num_threads}")
> + tx_cmd = (f"{cfg.bin_remote} -c -h {cfg.addr_v['6']} -p {cfg.port} "
> + f"-l 12840 -t {cfg.num_threads}")
> with bkg(rx_cmd, exit_wait=True):
> wait_port_listen(cfg.port, proto="tcp")
> cmd(tx_cmd, host=cfg.remote)
Reviewed-by: David Wei <dw@davidwei.uk>
prev parent reply other threads:[~2026-08-14 16:01 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-14 1:23 [PATCH net-next v5 0/6] selftests: net: multithreaded multiqueue iou-zcrx Juanlu Herrero
2026-08-14 1:23 ` [PATCH net-next v5 1/6] selftests: net: fix get_refill_ring_size() to use its local variable Juanlu Herrero
2026-08-14 1:23 ` [PATCH net-next v5 2/6] selftests: net: remove unused variable in process_recvzc() Juanlu Herrero
2026-08-14 1:23 ` [PATCH net-next v5 3/6] selftests: net: refactor server state into struct thread_ctx Juanlu Herrero
2026-08-14 16:06 ` David Wei
2026-08-14 1:23 ` [PATCH net-next v5 4/6] selftests: net: add multithread client support to iou-zcrx Juanlu Herrero
2026-08-14 16:04 ` David Wei
2026-08-14 1:23 ` [PATCH net-next v5 5/6] selftests: net: add multithread server " Juanlu Herrero
2026-08-14 15:50 ` David Wei
2026-08-17 14:09 ` Juanlu Herrero
2026-08-14 1:23 ` [PATCH net-next v5 6/6] selftests: net: add rss_multiqueue test variant " Juanlu Herrero
2026-08-14 16:01 ` David Wei [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=a6dd543a-1622-400e-b389-2cb50923e7f1@davidwei.uk \
--to=dw@davidwei.uk \
--cc=asml.silence@gmail.com \
--cc=io-uring@vger.kernel.org \
--cc=juanlu@fastmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shuah@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).