From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
To: Jakub Kicinski <kuba@kernel.org>, davem@davemloft.net
Cc: netdev@vger.kernel.org, edumazet@google.com, pabeni@redhat.com,
andrew+netdev@lunn.ch, horms@kernel.org,
Jakub Kicinski <kuba@kernel.org>,
shuah@kernel.org, willemb@google.com, noren@nvidia.com,
gal@nvidia.com, linux-kselftest@vger.kernel.org
Subject: Re: [PATCH net-next] selftests: drv-net: toeplitz: cap the Rx queue count
Date: Tue, 30 Jun 2026 13:11:15 -0400 [thread overview]
Message-ID: <willemdebruijn.kernel.23684913d1fd4@gmail.com> (raw)
In-Reply-To: <20260629234354.2154541-1-kuba@kernel.org>
Jakub Kicinski wrote:
> The RPS test needs a free CPU within the first RPS_MAX_CPUS (16)
> cores. This is easily violated if the NIC or env allocates the
> IRQs to cores linearly.
>
> Cap the Rx queues at 8, we don't need more. This makes the test
> pass on CX7 in NIPA.
>
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Willem de Bruijn <willemb@google.com>
> ---
> CC: shuah@kernel.org
> CC: willemb@google.com
> CC: noren@nvidia.com
> CC: gal@nvidia.com
> CC: linux-kselftest@vger.kernel.org
> ---
> .../selftests/drivers/net/hw/toeplitz.py | 22 +++++++++++++++++++
> 1 file changed, 22 insertions(+)
>
> diff --git a/tools/testing/selftests/drivers/net/hw/toeplitz.py b/tools/testing/selftests/drivers/net/hw/toeplitz.py
> index cd7e080e6f84..571732198b93 100755
> --- a/tools/testing/selftests/drivers/net/hw/toeplitz.py
> +++ b/tools/testing/selftests/drivers/net/hw/toeplitz.py
> @@ -21,6 +21,8 @@ from lib.py import ksft_variants, KsftNamedVariant, KsftSkipEx, KsftFailEx
> ETH_RSS_HASH_TOP = 1
> # Must match RPS_MAX_CPUS in toeplitz.c
> RPS_MAX_CPUS = 16
> +# Cap Rx queues so IRQ pinning leaves free CPUs in the RPS_MAX_CPUS range
> +QUEUE_CAP = 8
>
>
> def _check_rps_and_rfs_not_configured(cfg):
> @@ -48,6 +50,25 @@ RPS_MAX_CPUS = 16
> return int(data)
>
>
> +def _cap_queue_count(cfg):
> + ehdr = {"header": {"dev-index": cfg.ifindex}}
> + chans = cfg.ethnl.channels_get(ehdr)
> +
> + config = {}
> + restore = {}
> + for key in ("combined-count", "rx-count"):
This assumes that combined and rx are not set at the same time.
SGTM, not expected in real devices. But technically they could be.
> + cur = chans.get(key, 0)
> + if cur > QUEUE_CAP:
> + config[key] = QUEUE_CAP
> + restore[key] = cur
> +
> + if not config:
> + return
> +
> + cfg.ethnl.channels_set(ehdr | config)
> + defer(cfg.ethnl.channels_set, ehdr | restore)
> +
> +
> def _get_irq_cpus(cfg):
> """
> Read the list of IRQs for the device Rx queues.
> @@ -177,6 +198,7 @@ RPS_MAX_CPUS = 16
> ]
>
> if grp:
> + _cap_queue_count(cfg)
> _check_rps_and_rfs_not_configured(cfg)
> if grp == "rss":
> irq_cpus = ",".join([str(x) for x in _get_irq_cpus(cfg)])
> --
> 2.54.0
>
next prev parent reply other threads:[~2026-06-30 17:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-29 23:43 [PATCH net-next] selftests: drv-net: toeplitz: cap the Rx queue count Jakub Kicinski
2026-06-30 17:11 ` Willem de Bruijn [this message]
2026-06-30 23:10 ` Jakub Kicinski
2026-07-02 8:30 ` patchwork-bot+netdevbpf
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=willemdebruijn.kernel.23684913d1fd4@gmail.com \
--to=willemdebruijn.kernel@gmail.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gal@nvidia.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=noren@nvidia.com \
--cc=pabeni@redhat.com \
--cc=shuah@kernel.org \
--cc=willemb@google.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