Re: [PATCH net] selftests: net: fix rps_default_mask with >32 CPUs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jan 19, 2024 at 07:12:48AM -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.
> 
> Fixes: c12e0d5f267d ("self-tests: introduce self-tests for RPS default mask")
> Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
> ---
> CC: shuah@xxxxxxxxxx
> CC: horms@xxxxxxxxxx
> CC: linux-kselftest@xxxxxxxxxxxxxxx
> ---
>  tools/testing/selftests/net/rps_default_mask.sh | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/tools/testing/selftests/net/rps_default_mask.sh b/tools/testing/selftests/net/rps_default_mask.sh
> index a26c5624429f..f8e786e220b6 100755
> --- a/tools/testing/selftests/net/rps_default_mask.sh
> +++ b/tools/testing/selftests/net/rps_default_mask.sh
> @@ -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/,}

Hi Jakub,

AFAIK this will only remove the first incidence of a comma.
So I'm assuming this breaks with >64 CPUs.

>  	if [ $rps_mask -eq $expected_rps_mask ]; then
>  		echo "[ ok ]"
>  	else




[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux