From nobody Mon Sep 16 19:19:45 2024 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 B5A6B383BF for ; Fri, 26 Jul 2024 17:48:28 +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=1722016108; cv=none; b=p8ixzO9O7faBLiG1oPoYBbzNg/e97nwjuiVKMyIFOQCSxnPJRUsioAFZw0cWWawm1aygWyxxMrrBHu+RgDmImmCOIW5JMnNUjrRd2O17swtqJdftj2vXBVBRXx9KaK11vG9VFGo+8ztWRxYpAv8WwqbaJfuNiBH25S9erQg6ll4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722016108; c=relaxed/simple; bh=kVZzOf/BpqQynulgjG+PVFlgYIyugnFUYwJU1jYr+zE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=pijge7jtYoyfCiNZsXC1mbwzReqE68frah/vXlR5VgvtwKjSuCg1H/eDxO88VxA4wKrzGd+/q8eo6ngK1zqKobG507SHdIJ0WcLbUn7Xro1qVTaJnqE85WL9zR4Mxj1hkMEMiNwJhRWnX8B87aI3JDzKlON0APWYEtxRRA0S4RM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=gjo5iEsG; 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="gjo5iEsG" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B81C1C4AF07; Fri, 26 Jul 2024 17:48:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1722016108; bh=kVZzOf/BpqQynulgjG+PVFlgYIyugnFUYwJU1jYr+zE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=gjo5iEsGGXWuNNyBVw6ksLMt8Fse4c4v0G1atPPezx7bABoesBrTuZrwwTB4jnAKV 2c8upDaq6/iezdzFop/9mNt1hz+9lHiEujc+pXkFHxuPdvAFLaE62RHPUZeeAbS2UH xrpGbb0N9RpUHh4ksYsHkH9CLHvP9CB3SpD+j++NGlqK/qAMhCIkirMgz8t6jlTZO8 3CmsGaCfvkWCm+roKnn5DUmgMoLZCq9JZCipbsT/bvsZWPe8RCbmGNH9BHLVuUXQLf gKiuMaONQ4Gwkivs/dVHXWpHHXWZNlfD9FbWkDIuwoYwsUN5IJNjtkJqBu0VHJZCY9 VxwuGDAmX6pIA== From: "Matthieu Baerts (NGI0)" Date: Fri, 26 Jul 2024 19:48:21 +0200 Subject: [PATCH mptcp-next 1/2] mptcp: MIB counters for sent MP_JOIN Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240726-mptcp-join-tx-mib-v1-1-7f2149ba0dcf@kernel.org> References: <20240726-mptcp-join-tx-mib-v1-0-7f2149ba0dcf@kernel.org> In-Reply-To: <20240726-mptcp-join-tx-mib-v1-0-7f2149ba0dcf@kernel.org> To: mptcp@lists.linux.dev Cc: "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=4733; i=matttbe@kernel.org; h=from:subject:message-id; bh=kVZzOf/BpqQynulgjG+PVFlgYIyugnFUYwJU1jYr+zE=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBmo+Fq9c79xYtJsNiiWZ8FAXLJoHbxZvxQSJmLc VAhprACJvqJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZqPhagAKCRD2t4JPQmmg cx1KD/983PA/p49X3qVVlih1/JQILqkzN9Zm+eAQJUWFj2+Yl+wjTMd2R4c07IlIpLOFNoaArSm gAHMzq/Y13ogaezbNWZYynKtkmEFV5iXCtK8Ob3Rp4ZQ+JJu6oyL9T9Y22dQd2dS71mzqLhlAL6 AfqcFjQJHCLvCRGtjFS6zcxW4lxYcvdGzjJfIFQU27EEyzwOrchHnsFf1Sp3M9bF16A4aaQLBSe Yj02WZidJUOwyipEZ5tKP6NkC9P8hfFjMzQY4Wn74TKibaCpa/i0bmENYURgFrIr8eaiNfzmKRp YN3rSj7UJTU6zM4eBVLVeWGfnLA8J1CNNbLtIQ8I+VI/BNRJC5mF+R7CPC4DOV6lNng6+YjLPjS AZs6XGEr1mUqDzQifrSpx2ALFZdIYTsrK1CATh1/HTZCQbhzFDJqXg77fo8TdgtrFqvcQsmyw9+ gJsYisbRQOlZBYviwAt6Gp0ryZE64IxLtn2IHpy1DPUEjrd+j2qZc3cAsCXek6C41DLtWoVw4iv D4WAg93aG0X8bQJnzcONC7x8Uo9x+aA1SNRQ7b7EjpR5OYx/5OOYz/7PO1/0LBaRu3jSTdzA8Xg JWTt/tsX4zx+EQAc4WhNFPFf6lLTyy9uqN22XInr7lkdR4lB63P7rcFrsI3l+f0eUr/84AJIqy9 eR5jDq2wmLWKiHQ== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 Recently, a few issues have been discovered around the creation of additional subflows. Without these counters, it was difficult to point out the reason why some subflows were not created as expected. These counters should have been added earlier, because there is no other simple ways to extract such information from the kernel, and understand why subflows have not been created. While at it, some pr_debug() have been added, just in case the errno needs to be printed. Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/509 Signed-off-by: Matthieu Baerts (NGI0) --- net/mptcp/mib.c | 5 +++++ net/mptcp/mib.h | 5 +++++ net/mptcp/subflow.c | 24 ++++++++++++++++++++---- 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/net/mptcp/mib.c b/net/mptcp/mib.c index 7884217f33eb..a0b1152c32f1 100644 --- a/net/mptcp/mib.c +++ b/net/mptcp/mib.c @@ -25,6 +25,11 @@ static const struct snmp_mib mptcp_snmp_list[] =3D { SNMP_MIB_ITEM("MPJoinSynAckHMacFailure", MPTCP_MIB_JOINSYNACKMAC), SNMP_MIB_ITEM("MPJoinAckRx", MPTCP_MIB_JOINACKRX), SNMP_MIB_ITEM("MPJoinAckHMacFailure", MPTCP_MIB_JOINACKMAC), + SNMP_MIB_ITEM("MPJoinSynTx", MPTCP_MIB_JOINSYNTX), + SNMP_MIB_ITEM("MPJoinSynTxFEstabErr", MPTCP_MIB_JOINSYNTXFULLYESTAB), + SNMP_MIB_ITEM("MPJoinSynTxCreatSkErr", MPTCP_MIB_JOINSYNTXCREATESOCK), + SNMP_MIB_ITEM("MPJoinSynTxBindErr", MPTCP_MIB_JOINSYNTXBIND), + SNMP_MIB_ITEM("MPJoinSynTxConnectErr", MPTCP_MIB_JOINSYNTXCONNECT), SNMP_MIB_ITEM("DSSNotMatching", MPTCP_MIB_DSSNOMATCH), SNMP_MIB_ITEM("InfiniteMapTx", MPTCP_MIB_INFINITEMAPTX), SNMP_MIB_ITEM("InfiniteMapRx", MPTCP_MIB_INFINITEMAPRX), diff --git a/net/mptcp/mib.h b/net/mptcp/mib.h index 66aa67f49d03..ccb3a30e835a 100644 --- a/net/mptcp/mib.h +++ b/net/mptcp/mib.h @@ -20,6 +20,11 @@ enum linux_mptcp_mib_field { MPTCP_MIB_JOINSYNACKMAC, /* HMAC was wrong on SYN/ACK + MP_JOIN */ MPTCP_MIB_JOINACKRX, /* Received an ACK + MP_JOIN */ MPTCP_MIB_JOINACKMAC, /* HMAC was wrong on ACK + MP_JOIN */ + MPTCP_MIB_JOINSYNTX, /* Sending a SYN + MP_JOIN */ + MPTCP_MIB_JOINSYNTXFULLYESTAB, /* Not in fully established when sending a= SYN + MP_JOIN */ + MPTCP_MIB_JOINSYNTXCREATESOCK, /* Not able to create a socket when sendin= g a SYN + MP_JOIN */ + MPTCP_MIB_JOINSYNTXBIND, /* Not able to bind() the address when sending a= SYN + MP_JOIN */ + MPTCP_MIB_JOINSYNTXCONNECT, /* Not able to connect() when sending a SYN += MP_JOIN */ MPTCP_MIB_DSSNOMATCH, /* Received a new mapping that did not match the p= revious one */ MPTCP_MIB_INFINITEMAPTX, /* Sent an infinite mapping */ MPTCP_MIB_INFINITEMAPRX, /* Received an infinite mapping */ diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c index a21c712350c3..d305c0f53a09 100644 --- a/net/mptcp/subflow.c +++ b/net/mptcp/subflow.c @@ -1577,12 +1577,18 @@ int __mptcp_subflow_connect(struct sock *sk, const = struct mptcp_addr_info *loc, int ifindex; u8 flags; =20 - if (!mptcp_is_fully_established(sk)) + if (!mptcp_is_fully_established(sk)) { + MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_JOINSYNTXFULLYESTAB); goto err_out; + } =20 err =3D mptcp_subflow_create_socket(sk, loc->family, &sf); - if (err) + if (err) { + MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_JOINSYNTXCREATESOCK); + pr_debug("msk=3D%p local=3D%d remote:%d create sock error: %d\n", + msk, local_id, remote_id, err); goto err_out; + } =20 ssk =3D sf->sk; subflow =3D mptcp_subflow_ctx(ssk); @@ -1608,8 +1614,12 @@ int __mptcp_subflow_connect(struct sock *sk, const s= truct mptcp_addr_info *loc, #endif ssk->sk_bound_dev_if =3D ifindex; err =3D kernel_bind(sf, (struct sockaddr *)&addr, addrlen); - if (err) + if (err) { + MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_JOINSYNTXBIND); + pr_debug("msk=3D%p local=3D%d remote:%d bind error: %d\n", + msk, local_id, remote_id, err); goto failed; + } =20 mptcp_crypto_key_sha(subflow->remote_key, &remote_token, NULL); pr_debug("msk=3D%p remote_token=3D%u local_id=3D%d remote_id=3D%d", msk, @@ -1624,8 +1634,14 @@ int __mptcp_subflow_connect(struct sock *sk, const s= truct mptcp_addr_info *loc, sock_hold(ssk); list_add_tail(&subflow->node, &msk->conn_list); err =3D kernel_connect(sf, (struct sockaddr *)&addr, addrlen, O_NONBLOCK); - if (err && err !=3D -EINPROGRESS) + if (err && err !=3D -EINPROGRESS) { + MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_JOINSYNTXCONNECT); + pr_debug("msk=3D%p local=3D%d remote:%d connect error: %d\n", + msk, local_id, remote_id, err); goto failed_unlink; + } + + MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_JOINSYNTX); =20 /* discard the subflow socket */ mptcp_sock_graft(ssk, sk->sk_socket); --=20 2.45.2 From nobody Mon Sep 16 19:19:45 2024 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 664E5383BF for ; Fri, 26 Jul 2024 17:48:29 +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=1722016109; cv=none; b=OeE/GKpsVh4docFVF8UqW6ZxZ9PIUDEopFZVDnv4HXCip88fX+gaQsnyOShQOV5lyfS8iBV0fwPsE2SpgN6imp4SJbipj9cGS69DIsWEVOyHAu5DgKtgm0DFj0gmmvTl1HJ8LUYtr0f2ogCAGYuyJge1j1/T9rBPdKpXKe5jmx4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722016109; c=relaxed/simple; bh=txWGadEsrmhQCY+1OCs5bFpGkDlrfCce55DOhsaXkMI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=DwzHZs4GpIRnwOZ2Y1+yQfY96qezi8qCzXVG7rvycwjTaW01eru21WIl49lTvfMxyoMGh9TiP0GfqKYi2SstXTrCAliGsAVeDCQBpUG6slznCbQYreBlnkiov2b6WUFAkWfIcVVir0mS8z6kRZKmp2qk7jES49eKZtCYr8CYN88= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fwQwGqX9; 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="fwQwGqX9" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B7411C32782; Fri, 26 Jul 2024 17:48:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1722016109; bh=txWGadEsrmhQCY+1OCs5bFpGkDlrfCce55DOhsaXkMI=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=fwQwGqX9sgISldxYu1DCeDetF+iNS87ytbFmglPdQx/oGEJwix/czOdD1qU4ABGL2 gvSqfs9ohvKJp0N5sxF1CkT5HZMtnNyjjAHxFXKwVfz7iJHd3VNWlkqaEAu4459Iqb VB6i9Pukc2WG6cswBI3gzo3XkozN8/D3XWyJ0dV2Bm/BL0CQHxfFTUmVdLxTNR9POJ ROJyBE9DnMGy21phJRHBUud8ZLJxUozNrCMDxS1QVxRP/mhpaJ/7akg7eSTlhgG0IW rCJlVxmmT8/Me2DKctdzj3m0LCq49sTKHE6/oZynDC3gdC9C1OavxHXJbbGKbCNt6O EbRO0ohDjGhLw== From: "Matthieu Baerts (NGI0)" Date: Fri, 26 Jul 2024 19:48:22 +0200 Subject: [PATCH mptcp-next 2/2] selftests: mptcp: join: validate MPJ SYN TX MIB counters Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240726-mptcp-join-tx-mib-v1-2-7f2149ba0dcf@kernel.org> References: <20240726-mptcp-join-tx-mib-v1-0-7f2149ba0dcf@kernel.org> In-Reply-To: <20240726-mptcp-join-tx-mib-v1-0-7f2149ba0dcf@kernel.org> To: mptcp@lists.linux.dev Cc: "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=3198; i=matttbe@kernel.org; h=from:subject:message-id; bh=txWGadEsrmhQCY+1OCs5bFpGkDlrfCce55DOhsaXkMI=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBmo+Fqcpj6aJrEEMkU5kpvNmuFtK2LnG0jNkZef oNmy4uT1zWJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZqPhagAKCRD2t4JPQmmg c075EADsS1+zbKHCJ4VzPvr0f4V0dcL87g/6s50SabS2Tx/bBua+zU5mhZJoWLcE2tjx2xjUOGw B+hrx0MEqx0atVoBhlm5n79ny2NCpsmCod44V3oGtlFJPdbfhM/ugHTbagwHi0a2DXuNjXpv4qv Ji/mfLY7Z5N/TYxWMuV5jLI7AGQ4EPf+3cvJuijg34vxYLkmMhYHVBv7C+5bIUD2Z1BKeoEjygM +/W8fybqEvM5yMMOHa0BOEQzBTbFMfQ4QEvl91EOhos6dRnQo3Ny7wBcAAr/fSENHXnYXlN4H4E t4vrOYpjpJgxWCkLVzRP0XCA8EUYNNh9Myqv4Ge5qrGMxqTn15os07JfYeCNxOc2gr43FYzxJ7V uzFCvFraUO4oj1DyVD6CKyrvWAUrgoOg9qtP3Nx/VGqDpiuO+0EBEtWqKqRhJJDLA00Xp2u7cAr vp3t4J74xMNX2P2Y4zjzOQlUeIpthItQn2G+7TcURNpB0tacp9tKUe3voCEh75+oDuxg7IMp38e fXVVVGBDJJUK58EbhRQyY/Z1dhSA4+V2Dzx0tb3lhh+iUEawyj2JHFAFiZihs6VBMc4+XAO8c63 wVnSOn3CSB922x+xKXJeNxmVyvXzg1r6f64l02hYwWBUNwiyZnPpa1HaQMp+Q48ujgic2R+s0Wq dCncCj3BmsNJBIQ== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 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/testin= g/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 } =20 +chk_join_tx_nr() +{ + local syn_nr=3D$1 + local festab=3D$2 + local create=3D$3 + local bind=3D$4 + local connect=3D$5 + local count + + print_check "syn TX" + count=3D$(mptcp_lib_get_counter ${ns2} "MPTcpExtMPJoinSynTx") + if [ -z "$count" ]; then + print_skip + elif [ "$count" !=3D "$syn_nr" ]; then + fail_test "got $count JOIN[s] syn TX expected $syn_nr" + else + print_ok + fi + + print_check "syn TX Fully Estab Error" + count=3D$(mptcp_lib_get_counter ${ns2} "MPTcpExtMPJoinSynTxFEstabErr") + if [ -z "$count" ]; then + print_skip + elif [ "$count" !=3D "$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=3D$(mptcp_lib_get_counter ${ns2} "MPTcpExtMPJoinSynTxCreatSkErr") + if [ -z "$count" ]; then + print_skip + elif [ "$count" !=3D "$create" ]; then + fail_test "got $count JOIN[s] syn TX Create Socket Error expected $creat= e" + else + print_ok + fi + + print_check "syn TX Bind Error" + count=3D$(mptcp_lib_get_counter ${ns2} "MPTcpExtMPJoinSynTxBindErr") + if [ -z "$count" ]; then + print_skip + elif [ "$count" !=3D "$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=3D$(mptcp_lib_get_counter ${ns2} "MPTcpExtMPJoinSynTxConnectErr") + if [ -z "$count" ]; then + print_skip + elif [ "$count" !=3D "$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() speed=3Dslow \ run_tests $ns1 $ns2 10.0.1.1 chk_join_nr 0 0 0 + chk_join_tx_nr 0 0 0 0 0 fi =20 # multiple subflows, with subflow creation error @@ -1919,6 +1980,7 @@ subflows_error_tests() speed=3Dslow \ run_tests $ns1 $ns2 10.0.1.1 chk_join_nr 1 1 1 + chk_join_tx_nr 2 0 0 0 0 fi =20 # multiple subflows, with subflow timeout on MPJ @@ -2306,6 +2368,7 @@ remove_tests() addr_nr_ns1=3D-3 speed=3D10 \ run_tests $ns1 $ns2 10.0.1.1 chk_join_nr 1 1 1 + chk_join_tx_nr 2 0 0 0 1 chk_add_nr 3 3 chk_rm_nr 3 1 invert chk_rst_nr 0 0 --=20 2.45.2