selftests: Couple of fixes in Toeplitz RPS cases
Subsystems (3)
v2 cover selftests: Couple of fixes in Toeplitz RPS cases
Fix a couple of bugs in the RPS cases of the Toeplitz selftest.
Changelog -v1->v2: https://lore.kernel.org/all/[email protected]/
* Use a single mask variable in the second patch (Willem).
Gal Pressman (2):
selftests: drv-net: fix RPS mask handling in toeplitz test
selftests: drv-net: fix RPS mask handling for high CPU numbers
tools/testing/selftests/drivers/net/hw/toeplitz.c | 4 ++-- tools/testing/selftests/drivers/net/hw/toeplitz.py | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-)
Signature · 1 line
2.40.1
PATCH v2 1/2 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.
--- tools/testing/selftests/drivers/net/hw/toeplitz.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
tools/testing/selftests/drivers/net/hw/toeplitz.py +4 -2
@@ -94,12 +94,14 @@ def _configure_rps(cfg, rps_cpus): mask = 0 for cpu in rps_cpus: mask |= (1 << cpu) - mask = hex(mask)[2:] + + mask = 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) + # sysfs expects hex without '0x' prefix, toeplitz.c needs the prefix + fp.write(mask[2:]) return mask
Signature · 1 line
2.40.1
PATCH v2 2/2 selftests: drv-net: fix RPS mask handling for high CPU numbers
In reply to Gal PressmanThe RPS bitmask bounds check uses ~(RPS_MAX_CPUS - 1) which equals ~15 = 0xfff0, only allowing CPUs 0-3.
Change the mask to ~((1UL << RPS_MAX_CPUS) - 1) = ~0xffff to allow CPUs 0-15.
--- tools/testing/selftests/drivers/net/hw/toeplitz.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tools/testing/selftests/drivers/net/hw/toeplitz.c +2 -2
@@ -485,8 +485,8 @@ static void parse_rps_bitmap(const char *arg) bitmap =strtoul (arg,NULL ,0 ); -if (bitmap & ~(RPS_MAX_CPUS -1 )) -error (1 ,0 ,"rps bitmap 0x%lx out of bounds 0..%lu" , +if (bitmap & ~((1UL <<RPS_MAX_CPUS ) -1 )) +error (1 ,0 ,"rps bitmap 0x%lx out of bounds, max cpu %lu" , bitmap,RPS_MAX_CPUS -1 );for (i =0 ; i <RPS_MAX_CPUS ; i++)
Signature · 1 line
2.40.1
This series was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This series was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 11 lines · On Mon, 12 Jan 2026 19:37:13 +0200 you wrote:
Fix a couple of bugs in the RPS cases of the Toeplitz selftest.
Changelog -
v1->v2: https://lore.kernel.org/all/[email protected]/
* Use a single mask variable in the second patch (Willem).Gal Pressman (2):
selftests: drv-net: fix RPS mask handling in toeplitz test
selftests: drv-net: fix RPS mask handling for high CPU numbers[...]
Here is the summary with links:
- [net,v2,1/2] selftests: drv-net: fix RPS mask handling in toeplitz test
https://git.kernel.org/netdev/net/c/9d48c62f6b4e - [net,v2,2/2] selftests: drv-net: fix RPS mask handling for high CPU numbers https://git.kernel.org/netdev/net/c/cf055f8c0004
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html