* [PATCH net v3] selftests: net: fix rps_default_mask with >32 CPUs
@ 2024-01-22 19:58 Jakub Kicinski
2024-01-24 21:21 ` Simon Horman
2024-01-24 22:00 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Jakub Kicinski @ 2024-01-22 19:58 UTC (permalink / raw)
To: davem
Cc: netdev, edumazet, pabeni, Jakub Kicinski, shuah, horms,
linux-kselftest
If there is more than 32 cpus the bitmask will start to contain
commas, leading to:
./rps_default_mask.sh: line 36: [: 00000000,00000000: integer expression expected
Remove the commas, bash doesn't interpret leading zeroes as oct
so that should be good enough. Switch to bash, Simon reports that
not all shells support this type of substitution.
Fixes: c12e0d5f267d ("self-tests: introduce self-tests for RPS default mask")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
v3:
- switch to bash
v2: https://lore.kernel.org/all/20240120210256.3864747-1-kuba@kernel.org/
- remove all commas
v1: https://lore.kernel.org/all/20240119151248.3476897-1-kuba@kernel.org/
CC: shuah@kernel.org
CC: horms@kernel.org
CC: linux-kselftest@vger.kernel.org
---
tools/testing/selftests/net/rps_default_mask.sh | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/net/rps_default_mask.sh b/tools/testing/selftests/net/rps_default_mask.sh
index a26c5624429f..4287a8529890 100755
--- a/tools/testing/selftests/net/rps_default_mask.sh
+++ b/tools/testing/selftests/net/rps_default_mask.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# SPDX-License-Identifier: GPL-2.0
readonly ksft_skip=4
@@ -33,6 +33,10 @@ chk_rps() {
rps_mask=$($cmd /sys/class/net/$dev_name/queues/rx-0/rps_cpus)
printf "%-60s" "$msg"
+
+ # In case there is more than 32 CPUs we need to remove commas from masks
+ rps_mask=${rps_mask//,}
+ expected_rps_mask=${expected_rps_mask//,}
if [ $rps_mask -eq $expected_rps_mask ]; then
echo "[ ok ]"
else
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net v3] selftests: net: fix rps_default_mask with >32 CPUs
2024-01-22 19:58 [PATCH net v3] selftests: net: fix rps_default_mask with >32 CPUs Jakub Kicinski
@ 2024-01-24 21:21 ` Simon Horman
2024-01-24 22:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2024-01-24 21:21 UTC (permalink / raw)
To: Jakub Kicinski; +Cc: davem, netdev, edumazet, pabeni, shuah, linux-kselftest
On Mon, Jan 22, 2024 at 11:58:15AM -0800, Jakub Kicinski wrote:
> If there is more than 32 cpus the bitmask will start to contain
> commas, leading to:
>
> ./rps_default_mask.sh: line 36: [: 00000000,00000000: integer expression expected
>
> Remove the commas, bash doesn't interpret leading zeroes as oct
> so that should be good enough. Switch to bash, Simon reports that
> not all shells support this type of substitution.
>
> Fixes: c12e0d5f267d ("self-tests: introduce self-tests for RPS default mask")
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net v3] selftests: net: fix rps_default_mask with >32 CPUs
2024-01-22 19:58 [PATCH net v3] selftests: net: fix rps_default_mask with >32 CPUs Jakub Kicinski
2024-01-24 21:21 ` Simon Horman
@ 2024-01-24 22:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-01-24 22:00 UTC (permalink / raw)
To: Jakub Kicinski
Cc: davem, netdev, edumazet, pabeni, shuah, horms, linux-kselftest
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Mon, 22 Jan 2024 11:58:15 -0800 you wrote:
> If there is more than 32 cpus the bitmask will start to contain
> commas, leading to:
>
> ./rps_default_mask.sh: line 36: [: 00000000,00000000: integer expression expected
>
> Remove the commas, bash doesn't interpret leading zeroes as oct
> so that should be good enough. Switch to bash, Simon reports that
> not all shells support this type of substitution.
>
> [...]
Here is the summary with links:
- [net,v3] selftests: net: fix rps_default_mask with >32 CPUs
https://git.kernel.org/netdev/net/c/0719b5338a0c
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-01-24 22:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-22 19:58 [PATCH net v3] selftests: net: fix rps_default_mask with >32 CPUs Jakub Kicinski
2024-01-24 21:21 ` Simon Horman
2024-01-24 22:00 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).