All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthieu Baerts <matttbe@kernel.org>
To: Geliang Tang <geliang@kernel.org>, mptcp@lists.linux.dev
Cc: Geliang Tang <tanggeliang@kylinos.cn>
Subject: Re: [PATCH mptcp-next v11 2/8] selftests: mptcp: connect: add dedicated port counter
Date: Mon, 4 Mar 2024 13:31:58 +0100	[thread overview]
Message-ID: <0fecf41a-a227-4de3-9243-7e9db9efb434@kernel.org> (raw)
In-Reply-To: <b810e5d5afb5821caab1c309898b93da909f11cf.1709466624.git.tanggeliang@kylinos.cn>

Hi Geliang,

On 03/03/2024 12:52, Geliang Tang wrote:
> From: Geliang Tang <tanggeliang@kylinos.cn>
> 
> This patch adds a new dedicated counter 'PORT' instead of TEST_COUNT to
> increase port numbers in mptcp_connect.sh.

OK to have 2 counters, but...

> This can avoid outputting discontinuous test counters.
> 
> Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
> ---
>  tools/testing/selftests/net/mptcp/mptcp_connect.sh | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/testing/selftests/net/mptcp/mptcp_connect.sh b/tools/testing/selftests/net/mptcp/mptcp_connect.sh
> index 679e366c8f6b..30f44900ad38 100755
> --- a/tools/testing/selftests/net/mptcp/mptcp_connect.sh
> +++ b/tools/testing/selftests/net/mptcp/mptcp_connect.sh
> @@ -33,6 +33,7 @@ do_tcp=0
>  checksum=false
>  filesize=0
>  connect_per_transfer=1
> +PORT=0

Then best not to use capital letters, like for most variables here
above. And while at it, I think it would be better to start the counter
from 10000, not 0. So here, have:

  port=10000

>  if [ $tc_loss -eq 100 ];then
>  	tc_loss=1%
> @@ -314,7 +315,7 @@ do_transfer()
>  	local extra_args="$7"
>  
>  	local port
> -	port=$((10000+TEST_COUNT))
> +	port=$((10000+PORT++))

  port=$((port + 1))

>  	TEST_COUNT=$((TEST_COUNT+1))
>  
>  	if [ "$rcvbuf" -gt 0 ]; then
> @@ -710,7 +711,7 @@ EOF
>  
>  	echo "INFO: test $msg"
>  
> -	TEST_COUNT=10000
> +	PORT=10000

  port=20000

So at least this "port" counter represents the "port" being used, not an
offset of it.

>  	local extra_args="-o TRANSPARENT"
>  	do_transfer ${listener_ns} ${connector_ns} MPTCP MPTCP \
>  		    ${connect_addr} ${local_addr} "${extra_args}"

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.

  reply	other threads:[~2024-03-04 12:31 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-03 11:52 [PATCH mptcp-next v11 0/8] add helpers and vars in mptcp_lib.sh, part 3 Geliang Tang
2024-03-03 11:52 ` [PATCH mptcp-next v11 1/8] selftests: mptcp: print all error messages to stdout Geliang Tang
2024-03-04 12:31   ` Matthieu Baerts
2024-03-03 11:52 ` [PATCH mptcp-next v11 2/8] selftests: mptcp: connect: add dedicated port counter Geliang Tang
2024-03-04 12:31   ` Matthieu Baerts [this message]
2024-03-03 11:52 ` [PATCH mptcp-next v11 3/8] selftests: mptcp: connect: fix misaligned output Geliang Tang
2024-03-03 11:52 ` [PATCH mptcp-next v11 4/8] selftests: mptcp: sockopt: print every test result Geliang Tang
2024-03-04 12:32   ` Matthieu Baerts
2024-03-03 11:52 ` [PATCH mptcp-next v11 5/8] selftests: mptcp: export TEST_COUNTER variable Geliang Tang
2024-03-03 11:52 ` [PATCH mptcp-next v11 6/8] selftests: mptcp: add print_title in mptcp_lib Geliang Tang
2024-03-03 11:52 ` [PATCH mptcp-next v11 7/8] selftests: mptcp: print test results with counters Geliang Tang
2024-03-03 11:52 ` [PATCH mptcp-next v11 8/8] selftests: mptcp: print test results with colors Geliang Tang
2024-03-03 12:40   ` selftests: mptcp: print test results with colors: Tests Results MPTCP CI
2024-03-03 13:00   ` MPTCP CI
2024-03-04 12:32   ` [PATCH mptcp-next v11 8/8] selftests: mptcp: print test results with colors Matthieu Baerts
2024-03-04 12:31 ` [PATCH mptcp-next v11 0/8] add helpers and vars in mptcp_lib.sh, part 3 Matthieu Baerts

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=0fecf41a-a227-4de3-9243-7e9db9efb434@kernel.org \
    --to=matttbe@kernel.org \
    --cc=geliang@kernel.org \
    --cc=mptcp@lists.linux.dev \
    --cc=tanggeliang@kylinos.cn \
    /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.