Skip to content

Commit 9d48c62

Browse files
gal-pressmankuba-moo
authored andcommitted
selftests: drv-net: fix RPS mask handling in toeplitz test
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. Pass the prefixed mask to toeplitz.c, and the unprefixed one to sysfs. Fixes: 9cf9aa7 ("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> Reviewed-by: Willem de Bruijn <willemb@google.com> Link: https://patch.msgid.link/20260112173715.384843-2-gal@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent ddf96c3 commit 9d48c62

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

tools/testing/selftests/drivers/net/hw/toeplitz.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,14 @@ def _configure_rps(cfg, rps_cpus):
9494
mask = 0
9595
for cpu in rps_cpus:
9696
mask |= (1 << cpu)
97-
mask = hex(mask)[2:]
97+
98+
mask = hex(mask)
9899

99100
# Set RPS bitmap for all rx queues
100101
for rps_file in glob.glob(f"/sys/class/net/{cfg.ifname}/queues/rx-*/rps_cpus"):
101102
with open(rps_file, "w", encoding="utf-8") as fp:
102-
fp.write(mask)
103+
# sysfs expects hex without '0x' prefix, toeplitz.c needs the prefix
104+
fp.write(mask[2:])
103105

104106
return mask
105107

0 commit comments

Comments
 (0)