Skip to content

Commit 0719b53

Browse files
committed
selftests: net: fix rps_default_mask with >32 CPUs
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: c12e0d5 ("self-tests: introduce self-tests for RPS default mask") Reviewed-by: Simon Horman <horms@kernel.org> Link: https://lore.kernel.org/r/20240122195815.638997-1-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 9f538b4 commit 0719b53

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

tools/testing/selftests/net/rps_default_mask.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
#!/bin/bash
22
# SPDX-License-Identifier: GPL-2.0
33

44
readonly ksft_skip=4
@@ -33,6 +33,10 @@ chk_rps() {
3333

3434
rps_mask=$($cmd /sys/class/net/$dev_name/queues/rx-0/rps_cpus)
3535
printf "%-60s" "$msg"
36+
37+
# In case there is more than 32 CPUs we need to remove commas from masks
38+
rps_mask=${rps_mask//,}
39+
expected_rps_mask=${expected_rps_mask//,}
3640
if [ $rps_mask -eq $expected_rps_mask ]; then
3741
echo "[ ok ]"
3842
else

0 commit comments

Comments
 (0)