From nobody Wed Sep 10 05:41:32 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 D00E723BCE7 for ; Fri, 5 Sep 2025 18:19: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=1757096356; cv=none; b=SK1w6Y2E4TlZuw8pCFAEBv8i+DQzeg4GQPD76R9xn4tT6gB+vHmoBK4uv5VwGvEDimfhCzNSPWROdMoDbmi7HaoRO01w/JKS4ch5FYKCKgPomQyz6x627hy+GGVQ3v0adk1+Nse7aBeiwYZMapmJSJ6dqqAr09HcXpEldjQqvzU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757096356; c=relaxed/simple; bh=YXQ+CwIoJ9h5qstPz2KMyddL8vl2xQ2lQH4Wjo+XiZc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=RagMEwsNT8W/tPLg7BSYacyKV3Pu6lKn224dpBKqpnVYmSkIV/KEk+iFCv74vbKd4Soo6Yv8MCiKoYKgifnXHGMN591sRZgfDNC8YL6C+DXgB9+Hj87XPKureS60p1/Gtsx4UTtYwT1uFxLEl6OLmwH6VLmGQ22qqu73Mbsf1HA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=t4vYuQev; 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="t4vYuQev" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1E44CC4CEF4; Fri, 5 Sep 2025 18:19:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1757096356; bh=YXQ+CwIoJ9h5qstPz2KMyddL8vl2xQ2lQH4Wjo+XiZc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=t4vYuQevKZcrQgofY0cUihG22h8dItpgjLb5i4eLS2CuxpwY1qPmePs7hbiNnuAlG 0vG2hX7+uySkcRopKfUQQ5ZJwg7RpSXc8ujoWwVSJTuuUZMySVH50u2CHBWWgmrNQ1 K7YQxZmNhKEN2L/lZn9+sjUn6OprxRvaTXzZuSCg2RyZJgaSZoPKxOPHlJWGmwtMgA m0LpmdnOJKQAqo6OeNsvjfwJBriZbe3wq9HO53sQhmPeYuqZrGyszhAwjNXVJi4WdF KZ91fC06JegzimjNdk++CfUgIPqCm8e7oKDWrWZC0WbDu+t9ROBzAxfQUm4xGdHbuX LTQhD15rpYiFw== From: "Matthieu Baerts (NGI0)" Date: Fri, 05 Sep 2025 20:18:50 +0200 Subject: [PATCH mptcp-net v2 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: <20250905-sft-mptcp-disc-err-v2-1-dfb3b6b4a877@kernel.org> References: <20250905-sft-mptcp-disc-err-v2-0-dfb3b6b4a877@kernel.org> In-Reply-To: <20250905-sft-mptcp-disc-err-v2-0-dfb3b6b4a877@kernel.org> To: mptcp@lists.linux.dev 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/Th0Gd3rumMp9WSGDJ2a873cd71ylvs8KR9k5YrJm6MeG7nYzDJY1Y4005N7 b23PPYd6ChlYRDjYpAVU2SRbovMn/m8irfEy88CZg4rE8gQBi5OAZhIwgxGhm/Fdql3vJvPe879 8FdRzu7U3C0TN57mvDIrK9FDSuGpZwgjw0bh0uKFf66tum54lOtaWKTLW4Ucs0nnmSYfN+bqzQ4 +wwIA 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) --- 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 Wed Sep 10 05:41:32 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 216F326D4D4 for ; Fri, 5 Sep 2025 18:19: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=1757096358; cv=none; b=i5yJ9ftiFm5lnGHelLz3emuUtB8y8WBUOH+qdCqpcMeePCLAjs8l4QNbPCXF8/RpkLsLTyO12Ttmd+KA9boMOiAsh93Pr7AhLG1LmUX62vT985cPtLL8+lqGPQ2/gSQYxjeOwJ7jVvfa+DwUHjlvdc7d11dMedoH/xZEkg87Zlc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757096358; c=relaxed/simple; bh=TMdldyvLvCde8aHH3evkvxxwz/C/7SndolubxyHXYss=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=nfjfzxwQ5pjzbVnx15/8aLldDzBarm4qvQFfEDJGHnlvB21JWiTGgXdmD7bnQEVEJiEh7n4xc1r3IkDp1AhTY3mTmVnkSCdE1yC1lSZK0bufqa8jBu2+R27zZhGR+KZKYsiMnX8n4hlsEg4yDGWoHjbdFM+ERPksziPdTsY3a7Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=BkrAdrIK; 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="BkrAdrIK" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1C2D0C4CEF1; Fri, 5 Sep 2025 18:19:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1757096357; bh=TMdldyvLvCde8aHH3evkvxxwz/C/7SndolubxyHXYss=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=BkrAdrIK78DjRQ0gQKCaF5r8Q9dLxEYFD/ws+7gGSsWg3XPi4a/qztRnywkHFxoRB 9lXeKl00CYbA7GjyUtOuViSo2focJLR35K8eoc7YSGovDJd11vvVfic7kxs7LxSuKR 8kCJEhheC5iNj5wDT/6fiu+SXyZm9Cj5rrWaxzygT7/dOwGrDeQ/1rbTvuKvznMU7n z/uePiOUesAeKkgJ5nrR11GUpXEivw5jYStFaGboKA0XtSNHcuOiq+SVJZSwFBK+wa UQHuw3FJ25JQZOuT0Kmuj6SaDZwoCWmZzYie87uDgZSKaobRNZwKoC1EvwBfMggvtZ d5hkRbs9UHhkw== From: "Matthieu Baerts (NGI0)" Date: Fri, 05 Sep 2025 20:18:51 +0200 Subject: [PATCH mptcp-net v2 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: <20250905-sft-mptcp-disc-err-v2-2-dfb3b6b4a877@kernel.org> References: <20250905-sft-mptcp-disc-err-v2-0-dfb3b6b4a877@kernel.org> In-Reply-To: <20250905-sft-mptcp-disc-err-v2-0-dfb3b6b4a877@kernel.org> To: mptcp@lists.linux.dev Cc: "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2077; i=matttbe@kernel.org; h=from:subject:message-id; bh=TMdldyvLvCde8aHH3evkvxxwz/C/7SndolubxyHXYss=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDJ2a86/uupYycyjj0+vbTQ1Xy70TJx/b5+ypFXP3PwnL iuiHH+bd5SyMIhxMciKKbJIt0Xmz3xexVvi5WcBM4eVCWQIAxenAExE6RXDf09Ne8sv83V+LuWK MLE5+uzNrLJzn2yKLq6UXbnP6VjpNnZGhobLJzftNHhoyn6pimFjUHDSFf6WlxVrZ4sKLpucmrz mChMA 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) --- tools/testing/selftests/net/mptcp/mptcp_connect.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_connect.c b/tools/test= ing/selftests/net/mptcp/mptcp_connect.c index 4f07ac9fa207cb08a934582b98d688d0b9512f97..c1586a7286123a509495ac319fd= 624b98f0bfd18 100644 --- a/tools/testing/selftests/net/mptcp/mptcp_connect.c +++ b/tools/testing/selftests/net/mptcp/mptcp_connect.c @@ -1112,6 +1112,8 @@ int main_loop_s(int listensock) salen =3D sizeof(ss); remotesock =3D accept(listensock, (struct sockaddr *)&ss, &salen); if (remotesock >=3D 0) { + int err; + maybe_close(listensock); check_sockaddr(pf, &ss, salen); check_getpeername(remotesock, &ss, salen); @@ -1125,7 +1127,9 @@ 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); + if (err) + return err; } else { perror("accept"); return 1; --=20 2.51.0 From nobody Wed Sep 10 05:41:32 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 10D8B26D4D4 for ; Fri, 5 Sep 2025 18:19: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=1757096359; cv=none; b=NiS4TBSX00gxun5xi6eOYk3Mz5wbZ9fSt6Q3kQOPDTxzES56SZaY+S276KcRD7qJkwNj02+MMXUkVegpWDtM7nFe033bshZG3Br7LPEg1druiREllndMSBFD4lWEHttWJ2Tp5kGKnG0E1ptuZzYfY0lN3rx0XM3fRDUxFqHMzTs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757096359; c=relaxed/simple; bh=CpqysZ4TSbonzKkp7K8mn9RwCefzafxGdXLwreHBCA8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Tk9uLFSJAVt00EtZqPTb/ytsaAE5rV4k+4w2cHMx91l57rm6RoIz6pbnbHhGFR/SIyRFGoc4Kqmne+OR+cnM7i8vGPOhSCh0Sd8NUVdM6S98XjP7jyv+NnaOdHns/y3ZKgZgUTmsvrcVDSKy4wir8ioJJuw/dLNdsdjJlp2MB4s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Sw7LNKDl; 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="Sw7LNKDl" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 192D6C4CEF7; Fri, 5 Sep 2025 18:19:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1757096358; bh=CpqysZ4TSbonzKkp7K8mn9RwCefzafxGdXLwreHBCA8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Sw7LNKDlr2zlJqXeL2+pvUOtFFpQwQWeH7kvMRaARcSCIh9NMxNRjZVHE/eNDVOuD eK7GNG/vCPIt/nBppkLK+ga1+Vof+HlqsbWRk/zCCpb2JvqQvnikNTTQn4+dLrA4tv 7g96pQjatRTPRq/VsjNWjy9g40LuP5qL0JZM0RQn9eleiDQwZN4Vz9+b8BGe9g4U8D i4J/JT2M8dkJQb/rkwrm6dRf60rHMPR9SeQ/XwYkDZBacWyScj+ndVE93v1MEKxwiY TJGEABDMCBkYeeu+IfIJcvCEZYWpeytQPF7MIXSP80DqtEPf1YYAK9KI70pkSddvvA AFxh6GPWEOShQ== From: "Matthieu Baerts (NGI0)" Date: Fri, 05 Sep 2025 20:18:52 +0200 Subject: [PATCH mptcp-net v2 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: <20250905-sft-mptcp-disc-err-v2-3-dfb3b6b4a877@kernel.org> References: <20250905-sft-mptcp-disc-err-v2-0-dfb3b6b4a877@kernel.org> In-Reply-To: <20250905-sft-mptcp-disc-err-v2-0-dfb3b6b4a877@kernel.org> To: mptcp@lists.linux.dev 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=CpqysZ4TSbonzKkp7K8mn9RwCefzafxGdXLwreHBCA8=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDJ2ay4Qn3Rl1dsW132Ms4pXzo0+FP9rzZ2JJ7ntv8+V3 bIjuuyAQUcpC4MYF4OsmCKLdFtk/sznVbwlXn4WMHNYmUCGMHBxCsBEuA4y/K+7ssE4YuEyA6a9 ex51xD+o1Q4RPJVyasqFJYFrsuRXXuBh+J8gPXnCg4CW771zeuVsS7RvvmITUGBPyfo0U+nUj/k lyfwA 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) --- - 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 c1586a7286123a509495ac319fd624b98f0bfd18..130f6348ce042514a156bf63c6f= 8cd0fe1d7be4a 100644 --- a/tools/testing/selftests/net/mptcp/mptcp_connect.c +++ b/tools/testing/selftests/net/mptcp/mptcp_connect.c @@ -1251,7 +1251,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)) @@ -1261,7 +1261,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 Wed Sep 10 05:41:32 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 AEA0223BCE7 for ; Fri, 5 Sep 2025 18:19:19 +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=1757096359; cv=none; b=UZrU8Mxq/VeTfAXmdKWvk0FRjbkZMzBbdVC1J1sHTeR4i/THhA3N5lA2NkKtGEmmfFnnnfmZhn6LlRcjAVhEdG4rLlvm2Ax14cms/XMLREIWNran8ke4r6W3ttWl2DItnOPsV1W01/HaQ9gCNd4KWBO2FTe0XMxSdtyNYClGjp4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757096359; c=relaxed/simple; bh=Ol21gGhnsE1xDuPIY+KT8VKIVucgBUsN+lG8v8makhY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=VMld0mk76QEeLmoGwTb6lSqpXVihiWYe9FLJtdQW4vRKSzVU584v/Mdpq1lAsN6R0WoaAb/Q0u3MgImOVLQIb1OSC6q4OeB7wjLVfUNxyMvSrsb/FxYA3R1SNm2D+Nr+tdRBTaycO0tlKxxP1Sbs4BWrkLP+1ZSrTSDf1vhUsBk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=BQG1fcex; 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="BQG1fcex" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0EAA3C4CEF4; Fri, 5 Sep 2025 18:19:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1757096359; bh=Ol21gGhnsE1xDuPIY+KT8VKIVucgBUsN+lG8v8makhY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=BQG1fcexnU0yLaG1TEugQKwnH/0ERzQjOxC5sv34Izuf8K5PPzprp0SqkNTkHfTEW qY/Hng9NVsvzhOv3wGORJHomXd6/2ver8pt0xQCLEQTmn82LTAhKSH9uHugENkYMVC w9eov6/JgUMIry2wEM2cQVZZ2YX0NjorGH3OfXCs64uoa1Ns1qBNhjmhPi1Od9L3lu kd5N/Z76rLrIX4/O8DTID23+R6BdHf3An549m/tlgvJpRWcHtPSKAHgSMrDQSqw9tP Yts6jJXqr6pfOrEvmpoaeJ+dgg+Ka06cSeAO7p9tE60wcEKXnG0ZvXfsm3XbbpHA7R MpOR2YskpAy1Q== From: "Matthieu Baerts (NGI0)" Date: Fri, 05 Sep 2025 20:18:53 +0200 Subject: [PATCH mptcp-net v2 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: <20250905-sft-mptcp-disc-err-v2-4-dfb3b6b4a877@kernel.org> References: <20250905-sft-mptcp-disc-err-v2-0-dfb3b6b4a877@kernel.org> In-Reply-To: <20250905-sft-mptcp-disc-err-v2-0-dfb3b6b4a877@kernel.org> To: mptcp@lists.linux.dev Cc: "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1209; i=matttbe@kernel.org; h=from:subject:message-id; bh=Ol21gGhnsE1xDuPIY+KT8VKIVucgBUsN+lG8v8makhY=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDJ2ay5s/X0s9UFlT9Oplf+/CaTafZx07btqXu+q7KWGQ X+Nv1kIdJSyMIhxMciKKbJIt0Xmz3xexVvi5WcBM4eVCWQIAxenAEwk4w4jQ8O6yrrTtSo55lEr t7OdsdLKeLTX2cz9T3uY5ZRtE5+tiWRkWODMMDXr8C9W58kFE066q/xgdtrRtd7KLzJZNPtfyOF GfgA= X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 This is better than printing random bytes in the terminal. Note Jakub suggested 'hexdump', but Mat found out that 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. Suggested-by: Jakub Kicinski Suggested-by: Mat Martineau Signed-off-by: Matthieu Baerts (NGI0) --- v2: switch to 'od', and no more check for its presence (Mat) --- 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 Wed Sep 10 05:41:32 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 DD43823BCE7 for ; Fri, 5 Sep 2025 18:19:20 +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=1757096360; cv=none; b=WbT8xcH0PzmgtAn8nLLr/MvFauM1B4UE9ynucfT6feU3OXKoom3UyXkwxCHToTMZ/kbEV/uT1cWp9P/sj9eG/cu+EyQ5kzr55GGa+SkipYgIzgvXhC+aMp35XmHpUq+TXXzxSVWJBo+IPNpUmuz56wNeuf0ULXwkOP+UHJ3diaM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757096360; c=relaxed/simple; bh=tZdlyk5IiHHI/PKgw6+TAHLe/QlloNlNqhCRGPJbons=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=NMA/bpx+o4k4i9X28viwro/Ve4X7fQJ72N/uawPDrA0yrQA1u+luZt9ZDNWRMVWZCZmTleFjO6lMVCsSoS3BsuNycKuPCgi09dcHh/tBWQ2ujEwGhKX9ByiskzbfgHdvNrSLmDJwz0FbUKFDH8hXVWf6MmbMSrje+gF3A1q9YQM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=SJOj1tAd; 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="SJOj1tAd" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F38A4C4CEFC; Fri, 5 Sep 2025 18:19:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1757096360; bh=tZdlyk5IiHHI/PKgw6+TAHLe/QlloNlNqhCRGPJbons=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=SJOj1tAdknXmGM1+BmA8XLLJCKV+V20iLo/+j73A5FKS8U7yEeLJPBcAxLR9EZGSc YMykLtbR0RQEuSS96G88RYzI47YGxXh6dFrrMDNguUDm0f9NW+cj63UJUKkYJq2xXP Nih7U1vO9x34JYB79/Txj+Cu2Zfc6STlpHOILn3bYrmQfT1kLKTlWHhTrVvYokx63M WRKSNy1v59LaXxbBione6s0LjxAv4muoxefyYMoe9xBgyakBknvqMiI9SrnKo6yhUJ TFxi6QsqbFYZ/ODL9PbpyEyMIS2/YBP9k8iwtHPjatbxXHTkX5l0SXfCBJWq5gcG8H 60sxO/mdj9j/w== From: "Matthieu Baerts (NGI0)" Date: Fri, 05 Sep 2025 20:18:54 +0200 Subject: [PATCH mptcp-net v2 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: <20250905-sft-mptcp-disc-err-v2-5-dfb3b6b4a877@kernel.org> References: <20250905-sft-mptcp-disc-err-v2-0-dfb3b6b4a877@kernel.org> In-Reply-To: <20250905-sft-mptcp-disc-err-v2-0-dfb3b6b4a877@kernel.org> To: mptcp@lists.linux.dev 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=tZdlyk5IiHHI/PKgw6+TAHLe/QlloNlNqhCRGPJbons=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDJ2ay5KO+Y058VrOY/HKzLmXC6bGVgV/nibXfzHwxr1r 0MDpzEKdJSyMIhxMciKKbJIt0Xmz3xexVvi5WcBM4eVCWQIAxenAEzkhz4jw7GkZJ/Ih8tePH51 VL1K5gjHzyUvJfxF9SQj51s2iEsy9DIyfOvhClWf/sDdsfIU6/Q3J48f+q2qY7+mZBZL40rvBxE KbAA= 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) --- 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 5e3c56253274a1f938d2ed9986c4290fcea8b96b..19e2bd3000ec8be470a34d503ec= 034404e798fec 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