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 A8F5B1A3BC4 for ; Thu, 1 Aug 2024 01:36:22 +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=1722476182; cv=none; b=ZmRjBEc95XYgldZvRwWxg0OOMbXNeolUey3Kyn22Ll6QuBJ2USRtBRAMhljt+hFZKfhf9Z1iILZ2Jc5EwwsdDWIf8tgUdHaYYkqIs2qcoiNnBiR41HilayWRZ7EQ0Q92Af4x9LCqQLdbBg2g/zazI/KX9KK3JmwJMTIfIwlHxWM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722476182; c=relaxed/simple; bh=DiShS/tue8JytDDXhpozuGkvzimHyHWOHEJ/DMM+j5M=; h=Message-ID:Subject:From:To:Date:In-Reply-To:References: Content-Type:MIME-Version; b=bDF8gmHhJ3+O0VwPdOw4f26xj+uxIJ6BECwlM0x9E2O5zJnutWbk7MMX0zYp2XhoYyb+eWHY5dstZDcRc/toCVVg2zegFRPEOMmZOP+IFfmSsYliLipJz1A1QzEa6BkjM0gbtmp8MACpv65a0F+sCu5GkMDetMs0vyugdgomcwk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=W3ieBl75; 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="W3ieBl75" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4B924C116B1; Thu, 1 Aug 2024 01:36:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1722476182; bh=DiShS/tue8JytDDXhpozuGkvzimHyHWOHEJ/DMM+j5M=; h=Subject:From:To:Date:In-Reply-To:References:From; b=W3ieBl75nQCdit4goZptp6kxbYYAl0GD26feSZwnpded8fNi+2mQieqtjmq3PejZJ SD2ABnNb/TAVJOITCUc+rAjWr6YRPe0BpEp4TCGZjoLWJvzeV4LHVKUxZ0CuMAU4HN gQwLbUx4fffGHQpBNS8ViKxbIRbPfjwYe/vrIEfrYAtGidU9v1PST3qq/7bcOUH8ZA Y9dWNrDkayOjz4J351diQSxZGtUGpCPpPkEMqENw8ABV38CR2eyn64hVz6jGmH6ALM 96mJ/hrwG55VE3qwBCCUq6sMCeJ72AUWD4pRVlSxaPXZxs85DT/tjalNw08UmdT+7i aizCrSSAsrONw== Message-ID: <8494622fb0378abf6f83964f72bb752f57dc0292.camel@kernel.org> Subject: Re: [PATCH mptcp-next v2 2/2] selftests: mptcp: join: validate MPJ SYN TX MIB counters From: Geliang Tang To: Matthieu Baerts , mptcp@lists.linux.dev Date: Thu, 01 Aug 2024 09:36:16 +0800 In-Reply-To: <9a05b63f-5f09-4a46-9c41-5d9c0a0d5318@kernel.org> References: <20240729-mptcp-join-tx-mib-v2-0-8ace70fd407a@kernel.org> <20240729-mptcp-join-tx-mib-v2-2-8ace70fd407a@kernel.org> <54fe0a426f00ad7c6d4b2c639da7bb5925b408f7.camel@kernel.org> <9a05b63f-5f09-4a46-9c41-5d9c0a0d5318@kernel.org> Autocrypt: addr=geliang@kernel.org; prefer-encrypt=mutual; keydata=mQINBGWKTg4BEAC/Subk93zbjSYPahLCGMgjylhY/s/R2ebALGJFp13MPZ9qWlbVC8O+X lU/4reZtYKQ715MWe5CwJGPyTACILENuXY0FyVyjp/jl2u6XYnpuhw1ugHMLNJ5vbuwkc1I29nNe8 wwjyafN5RQV0AXhKdvofSIryqm0GIHIH/+4bTSh5aB6mvsrjUusB5MnNYU4oDv2L8MBJStqPAQRLl P9BWcKKA7T9Srlg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c7LXXedb/qQ3M Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.52.0-1build2 Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Hi Matt, On Wed, 2024-07-31 at 17:02 +0200, Matthieu Baerts wrote: > Hi Geliang, > > Thank you for the review! > > On 31/07/2024 04:59, Geliang Tang wrote: > > Hi Matt, > > > > Thanks for these patches. > > > > On Mon, 2024-07-29 at 12:18 +0200, Matthieu Baerts (NGI0) wrote: > > > A few new MIB counters have been added. They are being validated > > > here. > > > > > > Most of the time, there are no errors, but sometimes, more MPJ > > > SYN > > > are > > > queued compared to the numbers that are received. > > > > > > Only one test has an error, the one to connect to a broadcast IP > > > address. > > > > > > Signed-off-by: Matthieu Baerts (NGI0) > > > --- > > >  tools/testing/selftests/net/mptcp/mptcp_join.sh | 63 > > > +++++++++++++++++++++++++ > > >  1 file changed, 63 insertions(+) > > > > > > diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh > > > b/tools/testing/selftests/net/mptcp/mptcp_join.sh > > > index fbb0174145ad..c1f1ebd2340c 100755 > > > --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh > > > +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh > > > @@ -1372,6 +1372,66 @@ chk_join_nr() > > >   fi > > >  } > > >   > > > +chk_join_tx_nr() > > > +{ > > > + local syn_nr=$1 > > > + local festab=$2 > > > + local create=$3 > > > + local bind=$4 > > > + local connect=$5 > > > + local count > > > + > > > + print_check "syn TX" > > > + count=$(mptcp_lib_get_counter ${ns2} > > > "MPTcpExtMPJoinSynTx") > > > + if [ -z "$count" ]; then > > > + print_skip > > > + elif [ "$count" != "$syn_nr" ]; then > > > + fail_test "got $count JOIN[s] syn TX expected > > > $syn_nr" > > > + else > > > + print_ok > > > + fi > > > > Do you think it is necessary to check MPTcpExtMPJoinSynTx in > > chk_join_nr()? > > I thought about that, then I realised some tests were sending more > MP_JOIN than the received ones (e.g. when using "invalid addresses"). > We > would then need to change the default counters, but chk_join_nr() can > already optionally check the checksum, making it difficult to read > when > we have to pass 14 parameters: > >   chk_join_nr 1 1 1 0 0 0 0 0 0 2 0 0 0 1 > > It looks simpler with a dedicated helper, and checking this only in > some > places. WDYT? We can handle this like "addr_nr_ns1". In chk_join_nr(), the default value of this "syn_tx_nr" is the same as "syn_nr". If we need a specific value, we can pass it to run_tests() through a "syn_tx_nr" variable: syn_tx_nr=1 \ run_tests $ns1 $ns2 10.0.1.1 > > > > + > > > + print_check "syn TX Fully Estab Error" > > > + count=$(mptcp_lib_get_counter ${ns2} > > > "MPTcpExtMPJoinSynTxFEstabErr") > > > + if [ -z "$count" ]; then > > > + print_skip > > > + elif [ "$count" != "$festab" ]; then > > > + fail_test "got $count JOIN[s] syn TX Fully Estab > > > Error expected $festab" > > > + else > > > + print_ok > > > + fi > > > + > > > + print_check "syn TX Create Socket Error" > > > + count=$(mptcp_lib_get_counter ${ns2} > > > "MPTcpExtMPJoinSynTxCreatSkErr") > > > + if [ -z "$count" ]; then > > > + print_skip > > > + elif [ "$count" != "$create" ]; then > > > + fail_test "got $count JOIN[s] syn TX Create > > > Socket > > > Error expected $create" > > > + else > > > + print_ok > > > + fi > > > > There is no test that can trigger MPTcpExtMPJoinSynTxFEstabErr and > > MPTcpExtMPJoinSynTxCreatSkErr. Does this mean that there is no need > > to > > add these two MIBs? Maybe adding pr_debug logs is enough? WDYT? > > MPTcpExtMPJoinSynTxFEstabErr can be easily triggered by the userspace > PM. Maybe we don't need the counter for this case then? We could also > do > the check in the userspace PM side, and return a netlink message > instead, but I don't think it is needed. Not sure what's best here. I > can remove it or leave it. If so I think it's better to remove it, since too many MIBs are added in this function. > > For MPTcpExtMPJoinSynTxCreatSkErr, it can be triggered if it cannot > allocate memory, if the socket limit has been reached out, if a > security > module blocked it, etc. I think we should keep it, and we don't need > to > validate it in the tests. These errors are not related to MPTCP protocol. I think we can remove this MIB but keep its pr_debug log. WDYT? Regards, -Geliang > > > > + > > > + print_check "syn TX Bind Error" > > > + count=$(mptcp_lib_get_counter ${ns2} > > > "MPTcpExtMPJoinSynTxBindErr") > > > + if [ -z "$count" ]; then > > > + print_skip > > > + elif [ "$count" != "$bind" ]; then > > > + fail_test "got $count JOIN[s] syn TX Bind Error > > > expected $bind" > > > + else > > > + print_ok > > > + fi > > > + > > > + print_check "syn TX Connect Error" > > > + count=$(mptcp_lib_get_counter ${ns2} > > > "MPTcpExtMPJoinSynTxConnectErr") > > > + if [ -z "$count" ]; then > > > + print_skip > > > + elif [ "$count" != "$connect" ]; then > > > + fail_test "got $count JOIN[s] syn TX Connect > > > Error > > > expected $connect" > > > + else > > > + print_ok > > > + fi > > > +} > > > + > > >  # a negative value for 'stale_max' means no upper bound: > > >  # for bidirectional transfer, if one peer sleep for a while > > >  # - as these tests do - we can have a quite high number of > > > @@ -1907,6 +1967,7 @@ subflows_error_tests() > > > > Add an invalid address here in this test: > > > > pm_nl_add_endpoint $ns2 10.0.5.2 flags subflow > > > > >   speed=slow \ > > >   run_tests $ns1 $ns2 10.0.1.1 > > >   chk_join_nr 0 0 0 > > > + chk_join_tx_nr 0 0 0 0 0 > > > > It will trigger a "syn TX Bind Error": > > > > chk_join_tx_nr 0 0 0 1 0 > > Good idea! I will do that in the v3. > > Cheers, > Matt