From nobody Sun Dec 7 19:27:00 2025 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 A799B31D39A for ; Wed, 10 Sep 2025 08:57:14 +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=1757494634; cv=none; b=p8usoANMlro7RrZPZpiByykI0/JMOO5AvPp4Q9Zs+nuEz4UHQkXXvuz+eVVHFn/muVm+KuJ3zJI0btyu68qBwXDiMmY1RvQ7Ksg/D80Gw7oRg3nvfzpxiSUsdSKmeMg0krJYFpC3ASVHcNpgDUQFdsQfSgxI88VRVajmx1u4SuU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757494634; c=relaxed/simple; bh=YXQ+CwIoJ9h5qstPz2KMyddL8vl2xQ2lQH4Wjo+XiZc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=CBL0ZqmTE9bkMKYaFyUlDCySg3B8YQvPXevYUKGxLoqtp1HNbkpB2uc9ZOnMqnAQZS89dGE4I6yKX1zpJDHFi8ugjBwy482XRiTTT911Akdy5LATdAGlAxsR3/RotJxm5GR3NPgbZ/zyZfPDBnqNN1Nbwb8+sl/y9L+bqJeJn1A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=MrXOwNwz; 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="MrXOwNwz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C19E6C4CEF5; Wed, 10 Sep 2025 08:57:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1757494634; bh=YXQ+CwIoJ9h5qstPz2KMyddL8vl2xQ2lQH4Wjo+XiZc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=MrXOwNwziGJ1IUIXezcwVW38gVdPbNtRTqWbOsvC7SsNzjfXWNkLc2jbOL8eBaHy6 ZCBO5moV9ItQmLt8KHdy6QnyhXZu+WPiDaE6URE5hFPacjYDNsUCUwLGNs4B5sGLK1 q4RWyc2Tz4BoPce0UlRrXiKEMjTDk8BTpJFBT+bZiwi0R2HAbi6c6tVjefSSdmtLS4 icqna7Bj7sHUStyGsiuHfzAorwxEWSyfrMF8dSQkk4DmSoPniHJj/IoPBOAFCbxuDn qfQMSseVTvTxZRDQoN3sxqr/tG36iEI4SgG39u1PcAGPWUITDP0FbOmno/KPd24KRO VRhT6w8c/XriQ== From: "Matthieu Baerts (NGI0)" Date: Wed, 10 Sep 2025 10:55:47 +0200 Subject: [PATCH mptcp-net v3 1/5] mptcp: propagate shutdown to subflows when possible 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: <20250910-sft-mptcp-disc-err-v3-1-6799fa467d77@kernel.org> References: <20250910-sft-mptcp-disc-err-v3-0-6799fa467d77@kernel.org> In-Reply-To: <20250910-sft-mptcp-disc-err-v3-0-6799fa467d77@kernel.org> To: MPTCP Upstream Cc: "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2364; i=matttbe@kernel.org; h=from:subject:message-id; bh=YXQ+CwIoJ9h5qstPz2KMyddL8vl2xQ2lQH4Wjo+XiZc=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDIO2qZoBRjqvdN65nXroMhZhmX6P04UHzBoWBvtEK6z4 DXXD69rHaUsDGJcDLJiiizSbZH5M59X8ZZ4+VnAzGFlAhnCwMUpABNZncjwPzbHMW5JhtWx1FLv S0r1IbPNLOIj/29+8Ga5pv/U/n+LTjIynN0WIHUs8FQ9X5353vofJrqV7gWd+VkWBkaTjgRPe1b ADAA= X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 When the MPTCP DATA FIN have been ACKed, there is no more MPTCP related metadata to exchange, and all subflows can be safely shutdown. Before this patch, the subflows were actually terminated at 'close()' time. That's certainly fine most of the time, but not when the userspace 'shutdown()' a connection, without close()ing it. When doing so, the subflows were staying in LAST_ACK state on one side -- and consequently in FIN_WAIT2 on the other side -- until the 'close()' of the MPTCP socket. Now, when the DATA FIN have been ACKed, all subflows are shutdown. A consequence of this is that the TCP 'FIN' flag can be set earlier now, but the end result is the same. This affects the packetdrill tests looking at the end of the MPTCP connections, but for a good reason. Fixes: 3721b9b64676 ("mptcp: Track received DATA_FIN sequence number and ad= d related helpers") Fixes: 16a9a9da1723 ("mptcp: Add helper to process acks of DATA_FIN") Signed-off-by: Matthieu Baerts (NGI0) Reviewed-by: Geliang Tang Reviewed-by: Mat Martineau --- net/mptcp/protocol.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index 1c26acf6c4145896ecbb5c7f7004121c66a20649..9feb9f437c2bdfff392249e7ad0= 0edd09ba67ac3 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -372,6 +372,20 @@ static void mptcp_close_wake_up(struct sock *sk) sk_wake_async(sk, SOCK_WAKE_WAITD, POLL_IN); } =20 +static void mptcp_shutdown_subflows(struct mptcp_sock *msk) +{ + struct mptcp_subflow_context *subflow; + + mptcp_for_each_subflow(msk, subflow) { + struct sock *ssk =3D mptcp_subflow_tcp_sock(subflow); + bool slow; + + slow =3D lock_sock_fast(ssk); + tcp_shutdown(ssk, SEND_SHUTDOWN); + unlock_sock_fast(ssk, slow); + } +} + /* called under the msk socket lock */ static bool mptcp_pending_data_fin_ack(struct sock *sk) { @@ -396,6 +410,7 @@ static void mptcp_check_data_fin_ack(struct sock *sk) break; case TCP_CLOSING: case TCP_LAST_ACK: + mptcp_shutdown_subflows(msk); mptcp_set_state(sk, TCP_CLOSE); break; } @@ -564,6 +579,7 @@ static bool mptcp_check_data_fin(struct sock *sk) mptcp_set_state(sk, TCP_CLOSING); break; case TCP_FIN_WAIT2: + mptcp_shutdown_subflows(msk); mptcp_set_state(sk, TCP_CLOSE); break; default: --=20 2.51.0 From nobody Sun Dec 7 19:27:00 2025 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 8F9F0311595 for ; Wed, 10 Sep 2025 08:57:15 +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=1757494636; cv=none; b=eVgSAzJxsHxZbK9FeLFyueMU9qim6V8ZU0/+O8rWD5LuKVD41oE1tNcchOf9S8369zy02A/MTdjVVyuhwJOY1hQ8PChXxh3idUxSTGnBmfmUDlS4zT68lw4dckOcNSSj98Wj07ZD6KWXVDyNyMOlDt+B5VvZCbYqmpGYB0J2G9g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757494636; c=relaxed/simple; bh=wcEaEqIrH/Czf4DgAmYoxr3Tgw/CT+DhVSlXgbAAGT8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=gsIIy9y7Tre7RsxsYXhyCRH0JwFdk/bV1YuXJoPGbWhWiU4s6WnFaVKuHEM1ApIXz6SspQIJEzIB1vMzTXTdiYNm2B2Du9YihyvSl981KommXk3ip2hTygApz3GXF4Q38YkCWhpXFh1TotcYswbO/fXjz33eQKGfSeBGYifOEoY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=GvhWswIa; 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="GvhWswIa" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AB4EFC4CEFA; Wed, 10 Sep 2025 08:57:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1757494635; bh=wcEaEqIrH/Czf4DgAmYoxr3Tgw/CT+DhVSlXgbAAGT8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=GvhWswIaVlhDJCozW5rbg2fT8QcZPCeinlnN97Qn9wXocZ3Fl9/6lrBpglyHSJXWd dQFIv52iDIjAlYPYbTk5TvOf+4dCatFFSvtVr0ElGUgepBxUgZmB8/oVISNOHf4R35 FPZWyMsy6icaIDUDfqBbzwbiHZtUAGIVjLZ9Iw8F1T4kNmCelJV2TGifT14crfLeP0 /qg8kh/8sgRRcEsb6MiptOpzmqW+6fOeY2bW4BFDBMUEq7id4aM0bf6giwGWTQ1uIv hF1tcuEg0sqAYrWb3Axx+s2bU7fdUF8REJtn6ztjfemRnXG/ASMsg4i5xdgBxPQBt7 E6NqJJZeX6zQw== From: "Matthieu Baerts (NGI0)" Date: Wed, 10 Sep 2025 10:55:48 +0200 Subject: [PATCH mptcp-net v3 2/5] selftests: mptcp: connect: catch IO errors on listen side 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: <20250910-sft-mptcp-disc-err-v3-2-6799fa467d77@kernel.org> References: <20250910-sft-mptcp-disc-err-v3-0-6799fa467d77@kernel.org> In-Reply-To: <20250910-sft-mptcp-disc-err-v3-0-6799fa467d77@kernel.org> To: MPTCP Upstream Cc: "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2198; i=matttbe@kernel.org; h=from:subject:message-id; bh=wcEaEqIrH/Czf4DgAmYoxr3Tgw/CT+DhVSlXgbAAGT8=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDIO2qZ+ffk83KVoHt9Ms5mr3PyNd5a/ns37zPBBS9RCx WLhyCqRjlIWBjEuBlkxRRbptsj8mc+reEu8/Cxg5rAygQxh4OIUgImIyjMyXDqw+FXtidCQla3h y/4q3V8YEsT+pdjsPF/Mx3D9vtuNaxgZNkyTOGvz9phfgYP0Oqej515pxmzXuLj+wnHxurbnXSt z+QA= X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 IO errors were correctly printed to stderr, and propagated up to the main loop for the server side, but the returned value was ignored. As a consequence, the program for the listener side was no longer exiting with an error code in case of IO issues. Because of that, some issues might not have been seen. But very likely, most issues either had an effect on the client side, or the file transfer was not the expected one, e.g. the connection got reset before the end. Still, it is better to fix this. The main consequence of this issue is the error that was reported by the selftests: the received and sent files were different, and the MIB counters were not printed. Also, when such errors happened during the 'disconnect' tests, the program tried to continue until the timeout. Now when an IO error is detected, the program exits directly with an error. Fixes: 05be5e273c84 ("selftests: mptcp: add disconnect tests") Signed-off-by: Matthieu Baerts (NGI0) Reviewed-by: Geliang Tang Reviewed-by: Mat Martineau --- v3: close some FDs in case of errors (Geliang). --- tools/testing/selftests/net/mptcp/mptcp_connect.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_connect.c b/tools/test= ing/selftests/net/mptcp/mptcp_connect.c index 4f07ac9fa207cb08a934582b98d688d0b9512f97..1408698df0999730d9a9a4ad6a6= 362a4ab122d54 100644 --- a/tools/testing/selftests/net/mptcp/mptcp_connect.c +++ b/tools/testing/selftests/net/mptcp/mptcp_connect.c @@ -1093,6 +1093,7 @@ int main_loop_s(int listensock) struct pollfd polls; socklen_t salen; int remotesock; + int err =3D 0; int fd =3D 0; =20 again: @@ -1125,7 +1126,7 @@ int main_loop_s(int listensock) SOCK_TEST_TCPULP(remotesock, 0); =20 memset(&winfo, 0, sizeof(winfo)); - copyfd_io(fd, remotesock, 1, true, &winfo); + err =3D copyfd_io(fd, remotesock, 1, true, &winfo); } else { perror("accept"); return 1; @@ -1134,10 +1135,10 @@ int main_loop_s(int listensock) if (cfg_input) close(fd); =20 - if (--cfg_repeat > 0) + if (!err && --cfg_repeat > 0) goto again; =20 - return 0; + return err; } =20 static void init_rng(void) --=20 2.51.0 From nobody Sun Dec 7 19:27:00 2025 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 8F9732BE02B for ; Wed, 10 Sep 2025 08:57:16 +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=1757494636; cv=none; b=bedPWcP9QNAqUMpGgKOM+rspoLT3lqNTpT1uiwGRqAXZYYcY8sK2ooSd48n0rS5LpfnxnQL1O12iubhZ4HG0a4J1KmAZCUKdzGBXNbiOON5G4WBhFAIkGm29YyZ5U6UCU7Mc4y6EUVPMxEozc4633+AzeInGLOXaYVeoVRm6bPk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757494636; c=relaxed/simple; bh=2TuCSot+tgof1qm88VFRk5On/QBtwO1fQNg3xtP6bSc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=TipAdKQ++9If6wHZEClaHGGXXfQt21Pb0lcG0J6kh/eAR7nm7IruKg6tDc8D8EFDRmWYZW7rdlgqgNvRRDikqhrrOqHKoFx6kd2JMjGwbXW2jo++opln5Zqv8luArmc8N/SRrcQw1Jo03RtFlpiVaV2CwycS/njh4C6xoGcqe58= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=quAuISlb; 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="quAuISlb" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 949A9C4CEF0; Wed, 10 Sep 2025 08:57:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1757494636; bh=2TuCSot+tgof1qm88VFRk5On/QBtwO1fQNg3xtP6bSc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=quAuISlbKXE6z/lN39276sOX71+I+2Z6Nb3ceMem4s2+1IORaZzjj3wG/7hkhQNeF A5FwEpm6QqOnw2ycKrp4FfjWOSQ3EqfdwmUzQb+6WDWCc6LZE+EMa57k+uJNNoqMFX 3fskXTo3GH69IVcOXU4Ff2MZo6NdWXVq4jrZj3jlEU7AxFQq54bcxdU7oyr5qisuze /19rAVtNAgTEQQaWVivtEWyTnwHGMQ5r34P8GwwtGvZV7FG7/UbHpwK4pbLbQFSn5K 04t3uZdwSDgCKjbZ2WqmWvWIxugTGysLH2KKV85X8tybTjmt5CliyzjRNpsQQp3Di4 K42djxjloXE7g== From: "Matthieu Baerts (NGI0)" Date: Wed, 10 Sep 2025 10:55:49 +0200 Subject: [PATCH mptcp-net v3 3/5] selftests: mptcp: avoid spurious errors on TCP disconnect 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: <20250910-sft-mptcp-disc-err-v3-3-6799fa467d77@kernel.org> References: <20250910-sft-mptcp-disc-err-v3-0-6799fa467d77@kernel.org> In-Reply-To: <20250910-sft-mptcp-disc-err-v3-0-6799fa467d77@kernel.org> To: MPTCP Upstream Cc: "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=3925; i=matttbe@kernel.org; h=from:subject:message-id; bh=2TuCSot+tgof1qm88VFRk5On/QBtwO1fQNg3xtP6bSc=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDIO2qZtniV3ZVJHia3Sx4KNLZHK7Xlup0O1pZfveqLIu /NWuX94RykLgxgXg6yYIot0W2T+zOdVvCVefhYwc1iZQIYwcHEKwERiRRkZepPVEthOnsp2WKT2 S+/UqyXeE9rVNKaHhjfnOCa+9F+wiJFh5neej9MvHjHSrAyvfmQZaLEoUzKw7dGUxxN4g3p9+M6 wAwA= X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 The disconnect test-case, with 'plain' TCP sockets generates spurious errors, e.g. 07 ns1 TCP -> ns1 (dead:beef:1::1:10006) MPTCP read: Connection reset by peer read: Connection reset by peer (duration 155ms) [FAIL] client exit code 3, server 3 netns ns1-FloSdv (listener) socket stat for 10006: TcpActiveOpens 2 0.0 TcpPassiveOpens 2 0.0 TcpEstabResets 2 0.0 TcpInSegs 274 0.0 TcpOutSegs 276 0.0 TcpOutRsts 3 0.0 TcpExtPruneCalled 2 0.0 TcpExtRcvPruned 1 0.0 TcpExtTCPPureAcks 104 0.0 TcpExtTCPRcvCollapsed 2 0.0 TcpExtTCPBacklogCoalesce 42 0.0 TcpExtTCPRcvCoalesce 43 0.0 TcpExtTCPChallengeACK 1 0.0 TcpExtTCPFromZeroWindowAdv 42 0.0 TcpExtTCPToZeroWindowAdv 41 0.0 TcpExtTCPWantZeroWindowAdv 13 0.0 TcpExtTCPOrigDataSent 164 0.0 TcpExtTCPDelivered 165 0.0 TcpExtTCPRcvQDrop 1 0.0 In the failing scenarios (TCP -> MPTCP), the involved sockets are actually plain TCP ones, as fallbacks for passive sockets at 2WHS time cause the MPTCP listeners to actually create 'plain' TCP sockets. Similar to commit 218cc166321f ("selftests: mptcp: avoid spurious errors on disconnect"), the root cause is in the user-space bits: the test program tries to disconnect as soon as all the pending data has been spooled, generating an RST. If such option reaches the peer before the connection has reached the closed status, the TCP socket will report an error to the user-space, as per protocol specification, causing the above failure. Note that it looks like this issue got more visible since the "tcp: receiver changes" series from commit 06baf9bfa6ca ("Merge branch 'tcp-receiver-changes'"). Address the issue by explicitly waiting for the TCP sockets (-t) to reach a closed status before performing the disconnect. More precisely, the test program now waits for plain TCP sockets or TCP subflows in addition to the MPTCP sockets that were already monitored. While at it, use 'ss' with '-n' to avoid resolving service names, which is not needed here. Fixes: 218cc166321f ("selftests: mptcp: avoid spurious errors on disconnect= ") Suggested-by: Paolo Abeni Signed-off-by: Matthieu Baerts (NGI0) Reviewed-by: Geliang Tang Reviewed-by: Mat Martineau --- - v2: no more state filtering needed, thanks to the fix in the kernel --- tools/testing/selftests/net/mptcp/mptcp_connect.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_connect.c b/tools/test= ing/selftests/net/mptcp/mptcp_connect.c index 1408698df0999730d9a9a4ad6a6362a4ab122d54..b148cadb96d0b735901c92a1e44= 17f29c263dd90 100644 --- a/tools/testing/selftests/net/mptcp/mptcp_connect.c +++ b/tools/testing/selftests/net/mptcp/mptcp_connect.c @@ -1248,7 +1248,7 @@ void xdisconnect(int fd) else xerror("bad family"); =20 - strcpy(cmd, "ss -M | grep -q "); + strcpy(cmd, "ss -Mnt | grep -q "); cmdlen =3D strlen(cmd); if (!inet_ntop(addr.ss_family, raw_addr, &cmd[cmdlen], sizeof(cmd) - cmdlen)) @@ -1258,7 +1258,7 @@ void xdisconnect(int fd) =20 /* * wait until the pending data is completely flushed and all - * the MPTCP sockets reached the closed status. + * the sockets reached the closed status. * disconnect will bypass/ignore/drop any pending data. */ for (i =3D 0; ; i +=3D msec_sleep) { --=20 2.51.0 From nobody Sun Dec 7 19:27:00 2025 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 7425B2AE99 for ; Wed, 10 Sep 2025 08:57:17 +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=1757494638; cv=none; b=SddgT5yTC2xbzxww7TBhhvRTyaNVAr2eeW2yv4IlVfhtjUSDi3sxl7h6n9fWm72TCV+vLaK4yNA/igZ4YjtwBrKZ4l43eJWVzbD4+EGzHqReGv2RFyNE9Pu+G+Oxn+y/I9DJfcZHGtlRKtmtcicGUP+W9d+KHq+/uLS09RrumWg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757494638; c=relaxed/simple; bh=i7361sApF7zHr7JlkvivSn9yNsYsSA3QDBkFh+4Jc8g=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=K28x2bhOhtN1wdeYfxVtAAP38HUR7TV8wMaxPjVZGW7nbeXSOEwWg/OMV5Jocd6qI+fRUGchxzM4rsIKcOylVzvaeQ4BbCBgDV3JjUiXmJQNeE0LQML8RFqc1Kwo0kNMKVJNzJgnHkVan18txiYOhRXWYqk+G/xwH+dkA4CoZYA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ue0SC3Q7; 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="ue0SC3Q7" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7E6D6C4CEFB; Wed, 10 Sep 2025 08:57:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1757494637; bh=i7361sApF7zHr7JlkvivSn9yNsYsSA3QDBkFh+4Jc8g=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=ue0SC3Q7d41fTM7709vNKOrd7HeeyeKQqzc18ZiqLHMBKvtcOXiF6rN+2bNrtusOk zetPUi2AENN5xfUmle38RXh7lvKR3elCTn3kn6hQEuEjiC6l1mVzusECJT5VjMgxeS 931DgHiEJ0aDRHRdkFrmPSCBzPH4URvpqROdVMpX4BdGmnShu1C5KrjMLa5M6o+LnS 8eOY6pJbvxbpnWQVsqcmSA+3Z3f4pb/53bl9f8Q1Nvovme/xkVCL0y6jr1eS2HZf8z PwZWBBYLUwy41airo8sT+1An/9tq6vfAOAUIAazAW+CU+t5+kdr83ykbwYvauEv+yD vY6bwo+d6QM4A== From: "Matthieu Baerts (NGI0)" Date: Wed, 10 Sep 2025 10:55:50 +0200 Subject: [PATCH mptcp-net v3 4/5] selftests: mptcp: print trailing bytes with od 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: <20250910-sft-mptcp-disc-err-v3-4-6799fa467d77@kernel.org> References: <20250910-sft-mptcp-disc-err-v3-0-6799fa467d77@kernel.org> In-Reply-To: <20250910-sft-mptcp-disc-err-v3-0-6799fa467d77@kernel.org> To: MPTCP Upstream Cc: "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1412; i=matttbe@kernel.org; h=from:subject:message-id; bh=i7361sApF7zHr7JlkvivSn9yNsYsSA3QDBkFh+4Jc8g=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDIO2qbXFUpLLzxmMfnGj+WzGxgd+5uS37fs+Cyb8teU2 SJ065blHaUsDGJcDLJiiizSbZH5M59X8ZZ4+VnAzGFlAhnCwMUpABNpymZk+GTOsMr2PHvJV5cS 5Y+eJV/UtVYuvsWX/n7Nog/CK48ozmRk6PdoWFdoXLu4RUFO/PHZE6ozCuT3cvkpaNwpkTthua+ CFQA= X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 This is better than printing random bytes in the terminal. Note that Jakub suggested 'hexdump', but Mat found out this tool is not often installed by default. 'od' can do a similar job, and it is in the POSIX specs and available in coreutils, so it should be on more systems. While at it, display a few more bytes, just to fill in the two lines. And no need to display the 3rd only line showing the next number of bytes: 0000040. Suggested-by: Jakub Kicinski Suggested-by: Mat Martineau Signed-off-by: Matthieu Baerts (NGI0) Reviewed-by: Geliang Tang Reviewed-by: Mat Martineau --- v2: switch to 'od', and no more check for its presence (Mat) v3: mention there are more bytes (Geliang) --- tools/testing/selftests/net/mptcp/mptcp_lib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_lib.sh b/tools/testing= /selftests/net/mptcp/mptcp_lib.sh index 09cd24b2ae466205dacbdf8289eb86c08534c475..d62e653d48b0f2ef7a01e289fa0= be8907825667d 100644 --- a/tools/testing/selftests/net/mptcp/mptcp_lib.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_lib.sh @@ -384,7 +384,7 @@ mptcp_lib_make_file() { mptcp_lib_print_file_err() { ls -l "${1}" 1>&2 echo "Trailing bytes are: " - tail -c 27 "${1}" + tail -c 32 "${1}" | od -x | head -n2 } =20 # $1: input file ; $2: output file ; $3: what kind of file --=20 2.51.0 From nobody Sun Dec 7 19:27:00 2025 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 0889A2AE99 for ; Wed, 10 Sep 2025 08:57:18 +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=1757494638; cv=none; b=to6lqflwsBB1+/YAJc8yMSVsn930zctN/RqqICwrxWWo2dIfot2zomtejOWi06asp3g/zUaXJjgRudGYa2c18CK72vKR1ZcIdF0P4yutC8snXbwidup3tfAvN7uDyx61gQuxJ9uessAzxuT6ptO6JINfXf8Toi3lr5/ca/YLTok= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757494638; c=relaxed/simple; bh=Ee84vhhloGWzA2XT0E22CrpaB5Mp4lCARLlvOOwRIu4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=X++o42aTjHCm5CkXqCHynp5B/JkDelBGC+tnMJMYdKvkTuo6ViIJF/eQEHUcUSGio2PEpTxVlPqyYDF5dOboc7SloW5R0+9dIyKj92k0/ikJCxyg3FyRThf8g5PluSGnJbIWOXkJIxON+Y3zw2jFhx93ennFN1dVlOZ5GO6wlQI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=IbGHVRUy; 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="IbGHVRUy" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 68013C4CEF0; Wed, 10 Sep 2025 08:57:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1757494637; bh=Ee84vhhloGWzA2XT0E22CrpaB5Mp4lCARLlvOOwRIu4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=IbGHVRUyEVL+JeVuuL4gOghUCza2WWvBADCCLaRsSejnkARyilfru28H2d3DkHwGu k7hSBLXcFfrXoFMRDdqOc4Ppg6EDhO0xIYYDAlsPgPsXpc2sIRs2gKhUVWNtDRgrq0 a1xAIopcpkaysSBglOVYxYzH/Gbg1OMP99fxIUxh4h71hJHrRLqZwtBowcjmpZ+gM7 8pes7z/MJzDI38Vxbw7i4rr5JFIARPHPMUUFKPBhI0+4zlqE0kUYmiwlVQ//LPq9bP mwL4/8RB1MC4UKxxYb6v6Lsn+PQ00qWdIbKlXQ7jH2THhUYBLFwNos2pJpeYtRSCDW dmgtQsUVlX/7Q== From: "Matthieu Baerts (NGI0)" Date: Wed, 10 Sep 2025 10:55:51 +0200 Subject: [PATCH mptcp-net v3 5/5] selftests: mptcp: connect: print pcap suffix 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: <20250910-sft-mptcp-disc-err-v3-5-6799fa467d77@kernel.org> References: <20250910-sft-mptcp-disc-err-v3-0-6799fa467d77@kernel.org> In-Reply-To: <20250910-sft-mptcp-disc-err-v3-0-6799fa467d77@kernel.org> To: MPTCP Upstream Cc: "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1217; i=matttbe@kernel.org; h=from:subject:message-id; bh=Ee84vhhloGWzA2XT0E22CrpaB5Mp4lCARLlvOOwRIu4=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDIO2mYUP+b8qlv3ZM39g17e5y/GhOfWZp8qXMnDWmPjm 5MW9b24o5SFQYyLQVZMkUW6LTJ/5vMq3hIvPwuYOaxMIEMYuDgFYCKLHzP8U3tVL+Z5bO1e3oLk 3R6TZyUY2870WKZT1nF+2qzT74JkSxn+qfo/WaqzW9rHKeXjtl0xevtaw//byVhniN84YvT40Z8 SFgA= X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 To be able to find which capture files have been produced after several runs. This suffix was not printed anywhere before. While at it, always use the same prefix by taking info from ns1, instead of "$connector_ns", which is sometimes ns1, sometimes ns2 in the subtests. Signed-off-by: Matthieu Baerts (NGI0) Reviewed-by: Geliang Tang Reviewed-by: Mat Martineau --- tools/testing/selftests/net/mptcp/mptcp_connect.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_connect.sh b/tools/tes= ting/selftests/net/mptcp/mptcp_connect.sh index c2ab9f7f0d2133559bb18ce884b613d21d1ec5f0..47ecb5b3836eb5c64787bda0f6f= 1cc7c3af338aa 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_connect.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_connect.sh @@ -211,6 +211,11 @@ if $checksum; then done fi =20 +if $capture; then + rndh=3D"${ns1:4}" + mptcp_lib_pr_info "Packet capture files will have this prefix: ${rndh}-" +fi + set_ethtool_flags() { local ns=3D"$1" local dev=3D"$2" @@ -361,7 +366,6 @@ do_transfer() =20 if $capture; then local capuser - local rndh=3D"${connector_ns:4}" if [ -z $SUDO_USER ] ; then capuser=3D"" else --=20 2.51.0