All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Jakub Kicinski <kuba@kernel.org>
Cc: davem@davemloft.net, netdev@vger.kernel.org, edumazet@google.com,
	pabeni@redhat.com, shuah@kernel.org,
	linux-kselftest@vger.kernel.org
Subject: Re: [PATCH net] selftests: net: fix rps_default_mask with >32 CPUs
Date: Fri, 19 Jan 2024 21:07:19 +0000	[thread overview]
Message-ID: <20240119210719.GA110182@kernel.org> (raw)
In-Reply-To: <20240119151248.3476897-1-kuba@kernel.org>

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@kernel.org>
> ---
> CC: shuah@kernel.org
> CC: horms@kernel.org
> CC: linux-kselftest@vger.kernel.org
> ---
>  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

  reply	other threads:[~2024-01-19 21:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-19 15:12 [PATCH net] selftests: net: fix rps_default_mask with >32 CPUs Jakub Kicinski
2024-01-19 21:07 ` Simon Horman [this message]
2024-01-19 22:49   ` Jakub Kicinski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240119210719.GA110182@kernel.org \
    --to=horms@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.