MPTCP Linux Development
 help / color / mirror / Atom feed
From: Geliang Tang <geliang@kernel.org>
To: "Matthieu Baerts (NGI0)" <matttbe@kernel.org>, mptcp@lists.linux.dev
Subject: Re: [PATCH mptcp-next v3 1/8] selftests: mptcp: join: no extra msg if no counter
Date: Thu, 08 Aug 2024 10:38:19 +0800	[thread overview]
Message-ID: <2c144f50dc8e6f92e1bd1569802ec75f362a9ec9.camel@kernel.org> (raw)
In-Reply-To: <20240806-mptcp-join-tx-mib-v3-1-c3b54d2099e9@kernel.org>

Hi Matt,

Thanks for these patches.

On Tue, 2024-08-06 at 13:18 +0200, Matthieu Baerts (NGI0) wrote:
> The checksum and fail counters might not be available. Then no need
> to
> display an extra message with missing info.
> 
> While at it, fix the indentation around, which is wrong since the
> same
> commit.
> 
> Fixes: 47867f0a7e83 ("selftests: mptcp: join: skip check if MIB
> counter not supported")
> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
> ---
>  tools/testing/selftests/net/mptcp/mptcp_join.sh | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh
> b/tools/testing/selftests/net/mptcp/mptcp_join.sh
> index 01c1e0871aca..a1f80dac59a7 100755
> --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
> +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
> @@ -1112,7 +1112,7 @@ chk_csum_nr()
>  
>  	print_check "sum"
>  	count=$(mptcp_lib_get_counter ${ns1} "MPTcpExtDataCsumErr")
> -	if [ "$count" != "$csum_ns1" ]; then
> +	if [ -n "$count" ] && [ "$count" != "$csum_ns1" ]; then

We have checked [ -z "$count" ] in mptcp_lib_get_counter() already, so
I think no need to double check it here. Can we just let
mptcp_lib_get_counter() return "0" in this [ -z "$count" ] case, then
we can drop all these [ -n "$count" ] or [ -z "$count" ] (like in
chk_cestab_nr()) checks after mptcp_lib_get_counter()? WDYT?

Regards,
-Geliang

>  		extra_msg+=" ns1=$count"
>  	fi
>  	if [ -z "$count" ]; then
> @@ -1125,7 +1125,7 @@ chk_csum_nr()
>  	fi
>  	print_check "csum"
>  	count=$(mptcp_lib_get_counter ${ns2} "MPTcpExtDataCsumErr")
> -	if [ "$count" != "$csum_ns2" ]; then
> +	if [ -n "$count" ] && [ "$count" != "$csum_ns2" ]; then
>  		extra_msg+=" ns2=$count"
>  	fi
>  	if [ -z "$count" ]; then
> @@ -1169,13 +1169,13 @@ chk_fail_nr()
>  
>  	print_check "ftx"
>  	count=$(mptcp_lib_get_counter ${ns_tx} "MPTcpExtMPFailTx")
> -	if [ "$count" != "$fail_tx" ]; then
> +	if [ -n "$count" ] && [ "$count" != "$fail_tx" ]; then
>  		extra_msg+=",tx=$count"
>  	fi
>  	if [ -z "$count" ]; then
>  		print_skip
>  	elif { [ "$count" != "$fail_tx" ] && [ $allow_tx_lost -eq 0
> ]; } ||
> -	   { [ "$count" -gt "$fail_tx" ] && [ $allow_tx_lost -eq 1
> ]; }; then
> +	     { [ "$count" -gt "$fail_tx" ] && [ $allow_tx_lost -eq 1
> ]; }; then
>  		fail_test "got $count MP_FAIL[s] TX expected
> $fail_tx"
>  	else
>  		print_ok
> @@ -1183,13 +1183,13 @@ chk_fail_nr()
>  
>  	print_check "failrx"
>  	count=$(mptcp_lib_get_counter ${ns_rx} "MPTcpExtMPFailRx")
> -	if [ "$count" != "$fail_rx" ]; then
> +	if [ -n "$count" ] && [ "$count" != "$fail_rx" ]; then
>  		extra_msg+=",rx=$count"
>  	fi
>  	if [ -z "$count" ]; then
>  		print_skip
>  	elif { [ "$count" != "$fail_rx" ] && [ $allow_rx_lost -eq 0
> ]; } ||
> -	   { [ "$count" -gt "$fail_rx" ] && [ $allow_rx_lost -eq 1
> ]; }; then
> +	     { [ "$count" -gt "$fail_rx" ] && [ $allow_rx_lost -eq 1
> ]; }; then
>  		fail_test "got $count MP_FAIL[s] RX expected
> $fail_rx"
>  	else
>  		print_ok
> 


  reply	other threads:[~2024-08-08  2:38 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-06 11:18 [PATCH mptcp-next v3 0/8] mptcp: MIB counters for sent MP_JOIN Matthieu Baerts (NGI0)
2024-08-06 11:18 ` [PATCH mptcp-next v3 1/8] selftests: mptcp: join: no extra msg if no counter Matthieu Baerts (NGI0)
2024-08-08  2:38   ` Geliang Tang [this message]
2024-08-08 10:17     ` Matthieu Baerts
2024-08-09  2:30       ` Geliang Tang
2024-08-09 11:32         ` Matthieu Baerts
2024-08-09 11:52           ` Geliang Tang
2024-08-06 11:18 ` [PATCH mptcp-next v3 2/8] mptcp: MIB counters for sent MP_JOIN Matthieu Baerts (NGI0)
2024-08-08  2:46   ` Geliang Tang
2024-08-08 10:18     ` Matthieu Baerts
2024-08-06 11:18 ` [PATCH mptcp-next v3 3/8] selftests: mptcp: join: reduce join_nr params Matthieu Baerts (NGI0)
2024-08-08  3:28   ` Geliang Tang
2024-08-08 10:22     ` Matthieu Baerts
2024-08-09  2:32       ` Geliang Tang
2024-08-06 11:18 ` [PATCH mptcp-next v3 4/8] selftests: mptcp: join: one line for join check Matthieu Baerts (NGI0)
2024-08-09  2:10   ` Geliang Tang
2024-08-09 11:39     ` Matthieu Baerts
2024-08-06 11:18 ` [PATCH mptcp-next v3 5/8] selftests: mptcp: join: validate MPJ SYN TX MIB counters Matthieu Baerts (NGI0)
2024-08-09  2:21   ` Geliang Tang
2024-08-09 11:42     ` Matthieu Baerts
2024-08-06 11:18 ` [PATCH mptcp-next v3 6/8] selftests: mptcp: join: more explicit check name Matthieu Baerts (NGI0)
2024-08-09  2:00   ` Geliang Tang
2024-08-06 11:18 ` [PATCH mptcp-next v3 7/8] selftests: mptcp: join: specify host being checked Matthieu Baerts (NGI0)
2024-08-06 11:18 ` [PATCH mptcp-next v3 8/8] selftests: mptcp: join: mute errors when ran in the background Matthieu Baerts (NGI0)
2024-08-06 12:08 ` [PATCH mptcp-next v3 0/8] mptcp: MIB counters for sent MP_JOIN MPTCP CI

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=2c144f50dc8e6f92e1bd1569802ec75f362a9ec9.camel@kernel.org \
    --to=geliang@kernel.org \
    --cc=matttbe@kernel.org \
    --cc=mptcp@lists.linux.dev \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox