From nobody Wed Sep 17 16:12:13 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 6AF53309DCB; Fri, 12 Sep 2025 12:26:12 +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=1757679972; cv=none; b=qaqldYwLHHbeEBPWzykm1UITHtqAzU1vx+CosPyXDu+AgUkqnCz5SZDfea8C/We+BygmK6erS31q5OKdKaAq+GqrSdXZwOp9rAd54soJHP8MBD9NSiVQ36D33UnyYlRPgn0gNM7GVgbyZjxoY8Rb87drDY7XWQtZnnZY6VJMoxc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757679972; c=relaxed/simple; bh=121npnLQqMrG8NMgJdgNv2/ZCGNMwuF+edD/La2crTA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=V0YPlNX3ix2NGNn2EOv1JBoJBgG+s5VNeCXQ134xW/YSbafKYicvyl4EOIl3xYRfOPHRqQr8UHVi35MTLf7VMY5x2AL6xAtXvtZaL2b4cdvgVw947riNIAAydNIPG/YLI4ZmtzzV4nEX2jFNzoDiYaE+1axRUFSZM9co4CZCV1M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=qzsX1qZM; 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="qzsX1qZM" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 86E6AC4CEF4; Fri, 12 Sep 2025 12:26:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1757679972; bh=121npnLQqMrG8NMgJdgNv2/ZCGNMwuF+edD/La2crTA=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=qzsX1qZM6Sd3eaSamdfxr/h2H/MVHrIodZfcV1iR54wgQoeFtshVhQhhB22bWK0wR WO/h9HzEhOtIwMEgf1pVNbgrDYMsEqAwadZoykbHK9b0ym+Ni6MualSJNJer90Fwsk vSJIbtjD/B1eu+Rkvq9814rhr+3QgyUnKAPuRsoHvNuc7pb92jrMoDu+rS+j+7uL1k 7aQwtFcRz27vmXSeLdPMDfqOqd7fE1pmpw7geBXME+RzCKFe/GhjnhGSDi4R+ar3RB 7cWuMjApp6lJHVbkrfoE7dZ8qwJv5iW1tH72AlH2Dz0GRAJwYN7Fjsv5cigYYBlYtv Y5+R/ZkrQQa9g== From: "Matthieu Baerts (NGI0)" Date: Fri, 12 Sep 2025 14:25:50 +0200 Subject: [PATCH net 1/5] mptcp: propagate shutdown to subflows when possible Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250912-net-mptcp-fix-sft-connect-v1-1-d40e77cbbf02@kernel.org> References: <20250912-net-mptcp-fix-sft-connect-v1-0-d40e77cbbf02@kernel.org> In-Reply-To: <20250912-net-mptcp-fix-sft-connect-v1-0-d40e77cbbf02@kernel.org> To: Mat Martineau , Geliang Tang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Shuah Khan Cc: netdev@vger.kernel.org, mptcp@lists.linux.dev, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, "Matthieu Baerts (NGI0)" , stable@vger.kernel.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2597; i=matttbe@kernel.org; h=from:subject:message-id; bh=121npnLQqMrG8NMgJdgNv2/ZCGNMwuF+edD/La2crTA=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDKOCEbI+l9hyDCwcC5QNJIWPsKnKHXx3twPnslKTS9f5 +7cfPxlRykLgxgXg6yYIot0W2T+zOdVvCVefhYwc1iZQIYwcHEKwEQm32X4nxBue1P6jN82lgVM nc80nyw55yUTmBhd//zv5DzDzUfYVjIyzHqy79TFf1t8zzi/MVjqd+rTb4UZ/z70L1jneKQ2uSZ +CQ8A 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. Note that tcp_shutdown() will check the subflow state, so no need to do that again before calling it. Fixes: 3721b9b64676 ("mptcp: Track received DATA_FIN sequence number and ad= d related helpers") Cc: stable@vger.kernel.org Fixes: 16a9a9da1723 ("mptcp: Add helper to process acks of DATA_FIN") Reviewed-by: Mat Martineau Reviewed-by: Geliang Tang 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 e6fd97b21e9eeae816dc355834ba54c21bd2cc94..5e497a83e9675b5217052299463= c1dfc58de947c 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -371,6 +371,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) { @@ -395,6 +409,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; } @@ -563,6 +578,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 17 16:12:13 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 3F3C830ACEC; Fri, 12 Sep 2025 12:26: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=1757679976; cv=none; b=nswzLEs4Ohar7uVUmObOSioOvLbVkqLCQ8K/XozMcnCgPvIOSk5DWlSOD/5GuW/+SSM6YOCtWcZcmD8gPkJ7l//wj4LVTC05ca+dtyyoNH6p/PU3bUjlaFhnAz7kY19aDSVI+TUJ6r/G+2au0yhBHXXXuD56VXXaZI6weuhXznE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757679976; c=relaxed/simple; bh=Fy6guyyjWyQEIlYBDQ+OzM2U/OcwiT5QN5SsCJ/oC60=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=LO4dR0U4FQ2z5s1a4GlfL61FZDXY+9a/SNOuTVICc3f3lnuNmmPLyxwwyQ9I0sQjjJT7TO8bBozorL8Gp1M+2X+YsLx3nWFJ0EHc/y0j2ggOlEiupgm55orHPfgrhS/X6eA7ZbyQNLMLn+ixqhNG1ime+zQMMyvnYS3ZDFS6Nm4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=q12h2N4Y; 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="q12h2N4Y" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 61F11C4CEF9; Fri, 12 Sep 2025 12:26:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1757679974; bh=Fy6guyyjWyQEIlYBDQ+OzM2U/OcwiT5QN5SsCJ/oC60=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=q12h2N4Yg926Y2t0POfhqThzYO1rCpnsMvtuU/154iW9W6xh6CPfTtsS8fM89i7EN QYzvJY7QjXFn2oBFGtyvpYuoiw4pxurKK/KjIMxeaSEyF3VxDjmIZezwiZxC4Tylph UaxT4UCpRuXErSOQdBuwWfveHVqJlrNZLvxpn+gHK+oEuB/4Sh/qfalH5VtRm5/UnF ge6IQ6sWhboKnwqesXSm7HFYL9/vkwZi/SZnoklh23h+nFqsMDGf8JjosjZet02qS+ KFsXWPKHdc0FuYNTr0BhaNKkn5LjuYvkagM40gfz+oQqcc0gw1rcZzuWze8hOqae21 pRj5ogblNsBWg== From: "Matthieu Baerts (NGI0)" Date: Fri, 12 Sep 2025 14:25:51 +0200 Subject: [PATCH net 2/5] selftests: mptcp: connect: catch IO errors on listen side Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250912-net-mptcp-fix-sft-connect-v1-2-d40e77cbbf02@kernel.org> References: <20250912-net-mptcp-fix-sft-connect-v1-0-d40e77cbbf02@kernel.org> In-Reply-To: <20250912-net-mptcp-fix-sft-connect-v1-0-d40e77cbbf02@kernel.org> To: Mat Martineau , Geliang Tang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Shuah Khan Cc: netdev@vger.kernel.org, mptcp@lists.linux.dev, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, "Matthieu Baerts (NGI0)" , stable@vger.kernel.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2271; i=matttbe@kernel.org; h=from:subject:message-id; bh=Fy6guyyjWyQEIlYBDQ+OzM2U/OcwiT5QN5SsCJ/oC60=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDKOCEYdUwjSYf74cbnn89kyb94UffW/JVf3sC2tnXudr fPSm3MudZSyMIhxMciKKbJIt0Xmz3xexVvi5WcBM4eVCWQIAxenAExE/Twjw3LOLt+/J++cnszn ypdoUio7b9Gljfo/fnLHesf3iLeusmdkeLtSauW2Q4/WFLCFHpy/aa/KlB4Vg1MyjK9NvhQkC1p N5wMA 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") Cc: stable@vger.kernel.org Reviewed-by: Mat Martineau Reviewed-by: Geliang Tang Signed-off-by: Matthieu Baerts (NGI0) --- 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 Wed Sep 17 16:12:13 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 7D6FC3176E4; Fri, 12 Sep 2025 12:26: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=1757679978; cv=none; b=cguEHDOl3o+D8NpX6MF/p4LfL53wPKkmxbzH+xasMMmsK98UgIlDbUhT9ZbL3cKVjfOCHk9oyaSdNewJ4d1i9L5XpSB9QODr0CUV0KLmsqd8c5gWsyOBRaCmHoPu+MZK88uDzI9/GtwTyKd5aXCzDWgOYZ9c6Skx8MpKM47deCw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757679978; c=relaxed/simple; bh=8DS2hF+BEjU7aaHlrAzv+IT/n2Wvo9mCPVI4cgDetqQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=PRhltRg+pxHjvsFejRRQwhTL06Itbgt6O28vkTO2IS/4Mh/lBkSN9aG5GOBMN/snh5bK48CdFByaeOKupgGquK7OaHUCbyNdSRbmYb1gh68uckOOFaPLx864BDi7o8qnoK8hTOS5X+GcsA3UJT9s/AA+Lym72ORpPwYxM/mjp3E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=TmZFIZyn; 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="TmZFIZyn" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3CCAEC4CEF1; Fri, 12 Sep 2025 12:26:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1757679977; bh=8DS2hF+BEjU7aaHlrAzv+IT/n2Wvo9mCPVI4cgDetqQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=TmZFIZyn9I1NCK9zVlRIRW8S5p97IojSuNvg7DJrGDlm5K6EHuopLtFMVvwTSMTgZ 6CL5Wwa4LgMhB9QQPKDibZKuS9My0vjPQ6Y+O8DLit+P8bog0BJKOsMwR9n6C90Ti/ 9Yw2fCBWyHfaWUxVo+uYJIocbKlllCg7pWYX/cCV0x56VTG8oIvfyyPGMMGgdQOstg 62+kwIPWB63KzR6cL2IJeo7oUd+juezWAgdA1hvHboqJLjcD/LCmOk+1fsYV7me9NP kHyIGv55R4NQRrZ2uGqLUCExCY21fNcxk52DKJ0SFgKFfZYjHdKUin6hPNZ8jeylOk z+BvZZklMHBRQ== From: "Matthieu Baerts (NGI0)" Date: Fri, 12 Sep 2025 14:25:52 +0200 Subject: [PATCH net 3/5] selftests: mptcp: avoid spurious errors on TCP disconnect Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250912-net-mptcp-fix-sft-connect-v1-3-d40e77cbbf02@kernel.org> References: <20250912-net-mptcp-fix-sft-connect-v1-0-d40e77cbbf02@kernel.org> In-Reply-To: <20250912-net-mptcp-fix-sft-connect-v1-0-d40e77cbbf02@kernel.org> To: Mat Martineau , Geliang Tang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Shuah Khan Cc: netdev@vger.kernel.org, mptcp@lists.linux.dev, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, "Matthieu Baerts (NGI0)" , stable@vger.kernel.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=3976; i=matttbe@kernel.org; h=from:subject:message-id; bh=8DS2hF+BEjU7aaHlrAzv+IT/n2Wvo9mCPVI4cgDetqQ=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDKOCEbXGnzwfCi31G9/6Ae7VTc3eV4taH7jZss7Q29f4 GyFd+/kO0pZGMS4GGTFFFmk2yLzZz6v4i3x8rOAmcPKBDKEgYtTACbyJoKRYdaTlYlCr8pmz1V1 OT2Z53PlBu45TYwigklxCtE8TNozAhj+qcrZsafynOm6OOufyruIa3dYgv6XX578snadP9fETMV AbgA= 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= ") Cc: stable@vger.kernel.org Suggested-by: Paolo Abeni Reviewed-by: Mat Martineau Reviewed-by: Geliang Tang Signed-off-by: Matthieu Baerts (NGI0) --- 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 Wed Sep 17 16:12:13 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 E3BB631A05B; Fri, 12 Sep 2025 12:26: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=1757679981; cv=none; b=JFASC87k19CrmvcqAK4cnzo01NqlBUqXokGLBkKY6H/WvbVfMxJNFZ25n7i1E0vC3dq/J9U/+u+apy/jBA0bOXIykkJ6AELLQH4/hXVzlzwmIusSV0LMXX7v0ZRw1hjx/L4bDPhxCpSIt+WpnHjWe93IwfXsKEzUogSYkYeNuvY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757679981; c=relaxed/simple; bh=kVAG+e2fU44cNuZ5nqAIAIWQnToJPmMLd9Q1XAIm90s=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=OsdEayN4t9AeLMxWD8R2TyKQIHWUrwkgBvGcFLDEg5C3Y+/U/n6VlgTYKh80qpPoeRZ/o4F+ccChcE7JPYge3beHsQMWyqQ/k3RnnO0z/8+gUsJT97infTWZUwAX5MX9n+gikzPiinUmPuA1vweRDCL+rW5iTDjiS6EFQYTMHuE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=roZ6qjf8; 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="roZ6qjf8" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1721AC4CEF4; Fri, 12 Sep 2025 12:26:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1757679980; bh=kVAG+e2fU44cNuZ5nqAIAIWQnToJPmMLd9Q1XAIm90s=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=roZ6qjf8of+rJ8Fnd/zTGYYuoGUhSvTAnJv3Q79P/MZp0FwGH2N26s0TNjJp3sXSt RRbLVk5BOdQG/00Q2znXmr53qcuMUTgqyTl5DD+9YvAfmqahX1e1M2pPLs+Ddk2tRH bQNcZY6nXC1ZBkv60e0+duEWSFi74NlHYXWOtmUsrva/bUQRw3kKEiFSNbwCInbQjR b3jKzHr7EJNOlQNCxRDE1I1vId/CxvrFiH9lx/oAXvo2INY9Lusg2PdFJpOqHVwVEC 88MslP7Z2QK8t1QoPXLM3Xyus/P/FInBUFU5AyFujCa/WToNUo7sEb0YalbZbE6ho7 d/BomdU/b+1Gg== From: "Matthieu Baerts (NGI0)" Date: Fri, 12 Sep 2025 14:25:53 +0200 Subject: [PATCH net 4/5] selftests: mptcp: print trailing bytes with od Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250912-net-mptcp-fix-sft-connect-v1-4-d40e77cbbf02@kernel.org> References: <20250912-net-mptcp-fix-sft-connect-v1-0-d40e77cbbf02@kernel.org> In-Reply-To: <20250912-net-mptcp-fix-sft-connect-v1-0-d40e77cbbf02@kernel.org> To: Mat Martineau , Geliang Tang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Shuah Khan Cc: netdev@vger.kernel.org, mptcp@lists.linux.dev, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1400; i=matttbe@kernel.org; h=from:subject:message-id; bh=kVAG+e2fU44cNuZ5nqAIAIWQnToJPmMLd9Q1XAIm90s=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDKOCMYEJ77dyX7XeE7Y/tKD2+V87wnP/KzNn2714OCLB eZHFNmedJSyMIhxMciKKbJIt0Xmz3xexVvi5WcBM4eVCWQIAxenAEzE+x3D/4z1U1eclL7y0K3m 1rtdJw/MlEm/cmFH/fmfbuvv/gx50mLE8E/556VukZ1uTi7Oj/nc1y58t3KXprM/W/Lz7GWf/34 vtGUBAA== 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 Reviewed-by: Mat Martineau Reviewed-by: Geliang Tang Signed-off-by: Matthieu Baerts (NGI0) --- 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 17 16:12:13 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 7C52B31A072; Fri, 12 Sep 2025 12:26:23 +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=1757679983; cv=none; b=qJIMMPKvfwoDJ9Tat2xxdjblqWnUgNwg9TLrbj7NTZhN7rG5eQ7W/aDsHJzd5lXRb5pAn4rIujgQBTAD5Qy2YD+au/KshIcBawgxg0wGkWnlKtnSOeQ7bgYgfe0HuocK27iIfcMVuRrGISBtiXbkgO6uHEX2rV76wdw8fOhWTK0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757679983; c=relaxed/simple; bh=wIbaxBLYNY/0v1j60qZW6c3rwG3+xjsXEeNnYU0wxMM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=E0nivPNQQ2wgI9s5YNDHzCWV6mpEZz/rjJhFZ25m83pcZ/P6f17yy0ScWysX2mJzQWxE5u/BjVvNolwGGxFA1NWNcH+yd865nq+jynsvVAOqbSJk82jKU7ivFl+NDwME+5CCjYpha8NigQT6MhqU1r8VGdMdZS90mrC7TdmmsBY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=NxiTkL5M; 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="NxiTkL5M" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BDDA2C4CEF1; Fri, 12 Sep 2025 12:26:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1757679983; bh=wIbaxBLYNY/0v1j60qZW6c3rwG3+xjsXEeNnYU0wxMM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=NxiTkL5MBj/Yk0X8fgirt3CI4DpP8W3KjGtMRxtSbRDDvS9UxmCF0Z3Zi2ydIJk1c qFOyxhGgMBqJJzISJSeEutYk6zAKOiSqgjDVTwF9/myvcv1bOKrPSycHusc5R2qkNR TC1UP1H2mAtUVk0jy56ifrKg4VQrkJJt/05RAMmFMKXm8ZQeewwvEnkNw9C4TWW0+V tLtJa7RiuDTodfz9dgxlidNVrfXJ3SrXDLbNvMamV1zzjC82Z8IsVa5pIACkrFMzV2 z7dCxldSS5M3Rc8HqJZNxjv5fPSvcvsDkUHsvTWw4+ZjVEnxehMXu+wfVi5tGLX1IB 51AoM3V1I7q+A== From: "Matthieu Baerts (NGI0)" Date: Fri, 12 Sep 2025 14:25:54 +0200 Subject: [PATCH net 5/5] selftests: mptcp: connect: print pcap prefix 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: <20250912-net-mptcp-fix-sft-connect-v1-5-d40e77cbbf02@kernel.org> References: <20250912-net-mptcp-fix-sft-connect-v1-0-d40e77cbbf02@kernel.org> In-Reply-To: <20250912-net-mptcp-fix-sft-connect-v1-0-d40e77cbbf02@kernel.org> To: Mat Martineau , Geliang Tang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Shuah Khan Cc: netdev@vger.kernel.org, mptcp@lists.linux.dev, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1316; i=matttbe@kernel.org; h=from:subject:message-id; bh=wIbaxBLYNY/0v1j60qZW6c3rwG3+xjsXEeNnYU0wxMM=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDKOCMZe6Fl68ROLZcre8+pPv7TEm7vUpmw0uG/32q5za 0/t2vqUjhIWBjEuBlkxRRbptsj8mc+reEu8/Cxg5rAygQxh4OIUgIloSjP8s9+ur3qGscD6bXva ja95Z5ViJl4Penzo4c49RmmnFSJiyhm+V55g9Lf9kW9ycdrHxNyVjfcj7d4Vfvnhn13YWcaRacE IAA== 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 prefix 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. Reviewed-by: Mat Martineau Reviewed-by: Geliang Tang 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 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