From: Gal Pressman <gal@nvidia.com>
To: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Andrew Lunn <andrew+netdev@lunn.ch>, <netdev@vger.kernel.org>
Cc: Shuah Khan <shuah@kernel.org>,
Willem de Bruijn <willemb@google.com>,
"Petr Machata" <petrm@nvidia.com>, Coco Li <lixiaoyan@google.com>,
<linux-kselftest@vger.kernel.org>, Gal Pressman <gal@nvidia.com>,
Nimrod Oren <noren@nvidia.com>
Subject: [PATCH net-next 1/2] selftests: drv-net: fix RPS mask handling in toeplitz test
Date: Sun, 11 Jan 2026 19:16:57 +0200 [thread overview]
Message-ID: <20260111171658.179286-2-gal@nvidia.com> (raw)
In-Reply-To: <20260111171658.179286-1-gal@nvidia.com>
The toeplitz.py test passed the hex mask without "0x" prefix (e.g.,
"300" for CPUs 8,9). The toeplitz.c strtoul() call wrongly parsed this
as decimal 300 (0x12c) instead of hex 0x300.
Use separate format strings for sysfs (plain hex via format()) and
command line (prefixed hex via hex()).
Fixes: 9cf9aa77a1f6 ("selftests: drv-net: hw: convert the Toeplitz test to Python")
Reviewed-by: Nimrod Oren <noren@nvidia.com>
Signed-off-by: Gal Pressman <gal@nvidia.com>
---
tools/testing/selftests/drivers/net/hw/toeplitz.py | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/tools/testing/selftests/drivers/net/hw/toeplitz.py b/tools/testing/selftests/drivers/net/hw/toeplitz.py
index d2db5ee9e358..7a9af4af1838 100755
--- a/tools/testing/selftests/drivers/net/hw/toeplitz.py
+++ b/tools/testing/selftests/drivers/net/hw/toeplitz.py
@@ -94,14 +94,17 @@ def _configure_rps(cfg, rps_cpus):
mask = 0
for cpu in rps_cpus:
mask |= (1 << cpu)
- mask = hex(mask)[2:]
+
+ # sysfs expect hex without '0x' prefix, toeplitz.c needs the prefix
+ mask_sysfs = format(mask, 'x')
+ mask_cmdline = hex(mask)
# Set RPS bitmap for all rx queues
for rps_file in glob.glob(f"/sys/class/net/{cfg.ifname}/queues/rx-*/rps_cpus"):
with open(rps_file, "w", encoding="utf-8") as fp:
- fp.write(mask)
+ fp.write(mask_sysfs)
- return mask
+ return mask_cmdline
def _send_traffic(cfg, proto_flag, ipver, port):
--
2.40.1
next prev parent reply other threads:[~2026-01-11 17:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-11 17:16 [PATCH net-next 0/2] selftests: Couple of fixes in Toeplitz RPS cases Gal Pressman
2026-01-11 17:16 ` Gal Pressman [this message]
2026-01-12 3:43 ` [PATCH net-next 1/2] selftests: drv-net: fix RPS mask handling in toeplitz test Willem de Bruijn
2026-01-12 7:58 ` Gal Pressman
2026-01-11 17:16 ` [PATCH net-next 2/2] selftests: drv-net: fix RPS mask handling for high CPU numbers Gal Pressman
2026-01-12 3:29 ` Willem de Bruijn
2026-01-12 6:51 ` Gal Pressman
2026-01-12 16:06 ` Willem de Bruijn
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=20260111171658.179286-2-gal@nvidia.com \
--to=gal@nvidia.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=lixiaoyan@google.com \
--cc=netdev@vger.kernel.org \
--cc=noren@nvidia.com \
--cc=pabeni@redhat.com \
--cc=petrm@nvidia.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