Skip to content

Commit dbe6b31

Browse files
committed
Merge branch 'selftests-couple-of-fixes-in-toeplitz-rps-cases'
Gal Pressman says: ==================== selftests: Couple of fixes in Toeplitz RPS cases Fix a couple of bugs in the RPS cases of the Toeplitz selftest. ==================== Link: https://patch.msgid.link/20260112173715.384843-1-gal@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 parents ddf96c3 + cf055f8 commit dbe6b31

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -485,8 +485,8 @@ static void parse_rps_bitmap(const char *arg)
485485

486486
bitmap = strtoul(arg, NULL, 0);
487487

488-
if (bitmap & ~(RPS_MAX_CPUS - 1))
489-
error(1, 0, "rps bitmap 0x%lx out of bounds 0..%lu",
488+
if (bitmap & ~((1UL << RPS_MAX_CPUS) - 1))
489+
error(1, 0, "rps bitmap 0x%lx out of bounds, max cpu %lu",
490490
bitmap, RPS_MAX_CPUS - 1);
491491

492492
for (i = 0; i < RPS_MAX_CPUS; i++)

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)