From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BDC79639 for ; Thu, 18 Jul 2024 11:09:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721300977; cv=none; b=t1KOhL0g3h8tId8QT7moMOSEoVc6yBHDEWTKE88/UDThKadB2iQ9GCF9vTV/dc1Tv1FgLIR2SLxX1utDMF4pn9pOtJkxlC11lQl6vXOck/pZjJ55omLxTXKZk0q3UyGv0+WUZFPyb0jLZWitISHRcwb4eYe/niU4rj1LY/TUFHQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721300977; c=relaxed/simple; bh=DIYuSyPfmPJ1GdUuOnjOIJpU5cpuZO5WU/+FPbZqxN0=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type; b=gj6luHCgsgpVpb2LQSPf0tNFUd0nTFo4aDG6pO8m3GvTmU4gEp6mN7ym02UCaVCWp6m7Fjun7MyXhSvBOe2afiw6XZ4YxaFfAFV3hK45rTn8a/ykYxLR4Tb1LwjX3oH67/sUHJ+3GDbTbI5AxMA8kD9C41k6wLHL7txaTOtTMwo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=j8TMuMSS; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="j8TMuMSS" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9309FC4AF09; Thu, 18 Jul 2024 11:09:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721300977; bh=DIYuSyPfmPJ1GdUuOnjOIJpU5cpuZO5WU/+FPbZqxN0=; h=Date:Subject:To:References:From:In-Reply-To:From; b=j8TMuMSSXBt+oPkk/pE+hdIwSiRZz9rff5gQtbmw0cg49OafDLOUgd0G9dutKqVxh CJZO7spqKPmBOQWJU+9xTcNvbjiduXyGZzNRLL2zd80sdhyw8BQ0S3jcVcy+Hfi2j0 DDkE6nvbjhULMiFNZrHnzDtzpCgRMMpfe32QKSYmn1iymwzlFCJ9+mJ5MTjv+U34Yv Rst+7o28brfzG0myXktdAGwEYFA6zAYY3RJCjSj3brh/APCC52CSuyXwyKN2PyTvRX Xwq7k8WiWBMEhFCYjd6bzCDbKMPbPz1XfbNK3hdzyC1mm9+AUtGhN9TI7GSx5IPYP9 X/bCdqd4cS3tQ== Message-ID: <2a8792e5-6035-4202-8496-3f1f5c60d844@kernel.org> Date: Thu, 18 Jul 2024 13:09:34 +0200 Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta Subject: Re: [PATCH mptcp-net v2 5/9] selftests: mptcp: join: validate backup in MPJ Content-Language: en-GB To: Geliang Tang , mptcp@lists.linux.dev References: <20240716-mptcp-backup-mpj-v2-0-4d50247405fb@kernel.org> <20240716-mptcp-backup-mpj-v2-5-4d50247405fb@kernel.org> <108fbeaf69fdbc390287704b7a4f4af94890d244.camel@kernel.org> From: Matthieu Baerts Autocrypt: addr=matttbe@kernel.org; keydata= xsFNBFXj+ekBEADxVr99p2guPcqHFeI/JcFxls6KibzyZD5TQTyfuYlzEp7C7A9swoK5iCvf YBNdx5Xl74NLSgx6y/1NiMQGuKeu+2BmtnkiGxBNanfXcnl4L4Lzz+iXBvvbtCbynnnqDDqU c7SPFMpMesgpcu1xFt0F6bcxE+0ojRtSCZ5HDElKlHJNYtD1uwY4UYVG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A8D+vnIW5mbAAiojt3Mb 6p0WJS3QzbObzHNgAp3zy/L4lXwc6WW5vnpWAzqXFHP8D9PTpqvBALbXqL06smP47JqbyQxj Xf7D2rrPeIqbYmVY9da1KzMOVf3gReazYa89zZSdVkMojfWsbq05zwYU+SCWS3NiyF6QghbW voxbFwX1i/0xRwJiX9NNbRj1huVKQuS4W7rbWA87TrVQPXUAdkyd7FRYICNW+0gddysIwPoa KrLfx3Ba6Rpx0JznbrVOtXlihjl4KV8mtOPjYDY9u+8x412xXnlGl6AC4HLu2F3ECkamY4G6 UxejX+E6vW6Xe4n7H+rEX5UFgPRdYkS1TA/X3nMen9bouxNsvIJv7C6adZmMHqu/2azX7S7I vrxxySzOw9GxjoVTuzWMKWpDGP8n71IFeOot8JuPZtJ8omz+DZel+WCNZMVdVNLPOd5frqOv mpz0VhFAlNTjU1Vy0CnuxX3AM51J8dpdNyG0S8rADh6C8AKCDOfUstpq28/6oTaQv7QZdge0 JY6dglzGKnCi/zsmp2+1w559frz4+IC7j/igvJGX4KDDKUs0mlld8J2u2sBXv7CGxdzQoHaz lzVbFe7fduHbABmYz9cefQpO7wDE/Q== Organization: NGI0 Core In-Reply-To: <108fbeaf69fdbc390287704b7a4f4af94890d244.camel@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hi Geliang, On 17/07/2024 03:25, Geliang Tang wrote: > Hi Matt, > > Thanks for these patches. > > On Tue, 2024-07-16 at 22:53 +0200, Matthieu Baerts (NGI0) wrote: >> A peer can notify the other one that a subflow has to be treated as >> "backup" by two different ways: either by sending a dedicated MP_PRIO >> notification, or by setting the backup flag in the MP_JOIN handshake. >> >> The selftests were previously monitoring the former, but not the >> latter. >> This is what is now done here by looking at these new MIB counters >> when >> validating the 'backup' cases: >> >>   MPTcpExtMPJoinSynBackupRx >>   MPTcpExtMPJoinSynAckBackupRx >> >> The 'Fixes' tag here below is the same as the one from the previous >> commit: this patch here is not fixing anything wrong in the >> selftests, >> but it will help to validate a new fix for an issue introduced by >> this >> commit ID. >> >> Fixes: 4596a2c1b7f5 ("mptcp: allow creating non-backup subflows") >> Signed-off-by: Matthieu Baerts (NGI0) >> --- >>  tools/testing/selftests/net/mptcp/mptcp_join.sh | 42 >> +++++++++++++++++++------ >>  1 file changed, 32 insertions(+), 10 deletions(-) >> >> diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh >> b/tools/testing/selftests/net/mptcp/mptcp_join.sh >> index 55d84a1bde15..175127a9c00c 100755 >> --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh >> +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh >> @@ -1634,6 +1634,8 @@ chk_prio_nr() >>  { >>   local mp_prio_nr_tx=$1 >>   local mp_prio_nr_rx=$2 >> + local mpj_syn=$3 >> + local mpj_syn_ack=$4 > > How about setting default values for them: > > local mpj_syn=${3:-0} > local mpj_syn_ack=${4:-0} I prefer not to: in our existing test suite, these counters can be set, it is then important to review all of these test cases. I also think it is important to check them in all our backup cases. That's why I don't want to not check them if they are not set. > >>   local count >>   >>   print_check "ptx" >> @@ -1655,6 +1657,26 @@ chk_prio_nr() >>   else >>   print_ok >>   fi >> + >> + print_check "syn backup" >> + count=$(mptcp_lib_get_counter ${ns1} >> "MPTcpExtMPJoinSynBackupRx") >> + if [ -z "$count" ]; then >> + print_skip >> + elif [ "$count" != "$mpj_syn" ]; then >> + fail_test "got $count MPJ SYN[s] with Backup >> expected $mpj_syn" > > And make this log more like the one in chk_join_nr: > > fail_test "got $count JOIN[s] syn with Backup expected > $mpj_syn" Good point! >> + else >> + print_ok >> + fi >> + >> + print_check "synack backup" >> + count=$(mptcp_lib_get_counter ${ns2} >> "MPTcpExtMPJoinSynAckBackupRx") >> + if [ -z "$count" ]; then >> + print_skip >> + elif [ "$count" != "$mpj_syn_ack" ]; then >> + fail_test "got $count MPJ SYNACK[s] with Backup >> expected $mpj_syn_ack" > > The same here. Will do! >> + else >> + print_ok >> + fi >>  } >>   >>  chk_subflow_nr() >> @@ -2612,7 +2634,7 @@ backup_tests() >>   sflags=nobackup speed=slow \ >>   run_tests $ns1 $ns2 10.0.1.1 >>   chk_join_nr 1 1 1 >> - chk_prio_nr 0 1 >> + chk_prio_nr 0 1 1 0 > > The last value is the default one, only "chk_prio_nr 0 1 1" is enough. I think it is also better to avoid that in the 'chk_*' helpers, otherwise it is hard to follow what is going to be done. > >>   fi >>   >>   # single address, backup >> @@ -2625,7 +2647,7 @@ backup_tests() >>   run_tests $ns1 $ns2 10.0.1.1 >>   chk_join_nr 1 1 1 >>   chk_add_nr 1 1 >> - chk_prio_nr 1 1 >> + chk_prio_nr 1 1 0 0 > > With default values, no need to change this then. Please note that I also find this change safer for the backports: if the commit cannot be backported without conflicts, we can check why: maybe the test behaviour was different before, and the number of MPJ with backup flags was different. (But this is only because here it is a series for -net. If we extend a check to verify more things in very specific cases, something that doesn't make sense to check in other cases, then it can be fine to have optional parameters I think.) Cheers, Matt -- Sponsored by the NGI0 Core fund.