From nobody Thu Nov 27 14:00:53 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 982022BE7C0 for ; Sat, 1 Nov 2025 09:15:01 +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=1761988501; cv=none; b=neJQqWhNN9oql7G8SG5Vt3rp9LkLBk2k8+i8//bpSv/M3zAri0ii2Pc5dVvhzInunikTdgG2lrmHUqq1qeHLza0sZJtlD3whM9EfCNhSSfWzwVRAuya3nThlZ1ZORrjgwDsnsME75vabGOOmVmav2IEdLVHJw6g8AK0scUGTJT4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761988501; c=relaxed/simple; bh=Z/5W2x7rJRFgws1zoyWeVLKH2bwRKGy6TKM2NYw94wY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=kmAejzU77lfg8AvATXMKRX6jzIMFJc8EUPMe4i5eNurX8qiW6KvFAAmyfSqmna00kvYD8JlgN+r+efyEw088fUD1fzb8IMbDgqF/gPQW0eWLFnjsoG1ciYc2bFU6UyMKiU2+ud+2TxmWSRP5sOseoRC3yVo1sWi4+e6SxbE7/EE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fH1Mfn26; 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="fH1Mfn26" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9590DC4CEF8; Sat, 1 Nov 2025 09:15:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1761988501; bh=Z/5W2x7rJRFgws1zoyWeVLKH2bwRKGy6TKM2NYw94wY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=fH1Mfn26TYisST4SqTEEUxTTtbGUD65tZol4tDcGpFsT6kTd3I219PZII17aMZQQB vhkpymYhMiEPRn4TCWuzfhzLNWRMYaecG1bIYr44W3lxaqUmNRe3V6t0oB+H/UitCB q5iyTNl5DJMsKsfHBJlgfhHqgQfhXsA5tZTS3dMbppKBiiRa+PsBSyqzRaF0UbUf3e 3ASmB8wTg2klxEsDr86k/7UHM0WrTMIAF8g7w3nuON6xPIJtIygi1bm8QOEmBL1yZY MGneo8IEDYycyTYPpGD14TlxtGv2xR1fHpNFzVMvzE6KbKQwTzvIEpDp+OvZFZaOSx 2d9SsNEISzTfg== From: "Matthieu Baerts (NGI0)" Date: Sat, 01 Nov 2025 10:14:42 +0100 Subject: [PATCH mptcp-net 1/6] selftests: mptcp: connect: fix fallback note due to OoO 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: <20251101-slft-join-inst-v1-1-10572512a0b2@kernel.org> References: <20251101-slft-join-inst-v1-0-10572512a0b2@kernel.org> In-Reply-To: <20251101-slft-join-inst-v1-0-10572512a0b2@kernel.org> To: MPTCP Upstream Cc: "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1331; i=matttbe@kernel.org; h=from:subject:message-id; bh=Z/5W2x7rJRFgws1zoyWeVLKH2bwRKGy6TKM2NYw94wY=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDJZz/ecK2Z9nsxc6RZR/pSv/092uyW76d5Cy4mLkyVff bNZLcbbUcrCIMbFICumyCLdFpk/83kVb4mXnwXMHFYmkCEMXJwCMJGLNxkZJiTd6n2+2Y/hoOae LT+b1Pm+KHEZWWbO9759Y7lNRQnTGob/GVqFrkfSgp9wpzE+YU82rAq9cCvP7Erx1DXLypJyJnp wAgA= X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 The "fallback due to TCP OoO" was never printed because the stat_ooo_now variable was checked twice: once in the parent if-statement, and one in the child one. The second condition was then always true then, and the 'else' branch was never taken. The idea is that when there are more ACK + MP_CAPABLE than expected, the test either fails if there was no out of order packets, or a notice is printed. Fixes: 69ca3d29a755 ("mptcp: update selftest for fallback due to OoO") Signed-off-by: Matthieu Baerts (NGI0) --- tools/testing/selftests/net/mptcp/mptcp_connect.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_connect.sh b/tools/tes= ting/selftests/net/mptcp/mptcp_connect.sh index 47ecb5b3836e..9b7b93f8eb0c 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_connect.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_connect.sh @@ -492,7 +492,7 @@ do_transfer() "than expected (${expect_synrx})" retc=3D1 fi - if [ ${stat_ackrx_now_l} -lt ${expect_ackrx} ] && [ ${stat_ooo_now} -eq 0= ]; then + if [ ${stat_ackrx_now_l} -lt ${expect_ackrx} ]; then if [ ${stat_ooo_now} -eq 0 ]; then mptcp_lib_pr_fail "lower MPC ACK rx (${stat_ackrx_now_l})" \ "than expected (${expect_ackrx})" --=20 2.51.0 From nobody Thu Nov 27 14:00:53 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 4C7FB1A23AC for ; Sat, 1 Nov 2025 09:15:02 +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=1761988503; cv=none; b=QBEfPB5KYiRf3oCjoM3XeqzK/VPykYLzY7YL7HqMjtv8zr25tsj6Xw9Habn2FWHbPPb0G8lMGAR8Gpmy9lStYqYYiBhig23YFaALrFyYORa6afC7un1Ocea9SvVw4Vp4hXpe54j5wjH/cw0PYlpHDNKGjo3yAe0ikyIcIhzeqVE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761988503; c=relaxed/simple; bh=glEMJ7NhArT1aQG4urKiW3p8ogCxkHbTuTgMGKWEQ98=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=holY4U7t+6suDoVI3EIqcW962CbmSbGlih4T9efnUKyQ3Fj4WISwB3dtIK23OJurHuemedeaIwvENZkcKMtOQcTAQ4w5jhi6cq3YDWeB4XWtrjKyWo2kXvh3nce5P/+Ef48JUQJE8kP/sN9VpDZezUSjaw65iBA/bQHyQeINbNo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=QPCjxTe6; 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="QPCjxTe6" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7FD8BC4CEF1; Sat, 1 Nov 2025 09:15:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1761988502; bh=glEMJ7NhArT1aQG4urKiW3p8ogCxkHbTuTgMGKWEQ98=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=QPCjxTe6hdKx2QQiVUwtDB6QCdlSX1ojPGBl/9w4i5uCG6Zz9oTW3YZ0kp8C+VHg4 t8578xXxTu9CNQ9c8a0XIw6167IFnC1TdKR/Ueof1uA9ZurYGRTd/8b0CNosCOwoxL k3MTuEvGbb/MGCvXSu1YpdPE5d0Cp1xCcAZEWPWjLFzX7+sltGHhk/jcO7XHD+Vd0v clMIiiyKayg/pvcbYNq3YWiPqWuSa/qvGhWOGsin2U9vnH8uDzRRVQbxWqdeCl8Gn7 hCbQ0xh96EckWW8/UeRZapST4orrjR2HzsHhYovHmpKBOsZhNqUnaiq/wf4GSVnmom CddMZbHsW04VQ== From: "Matthieu Baerts (NGI0)" Date: Sat, 01 Nov 2025 10:14:43 +0100 Subject: [PATCH mptcp-net 2/6] selftests: mptcp: join: rm: set backup flag 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: <20251101-slft-join-inst-v1-2-10572512a0b2@kernel.org> References: <20251101-slft-join-inst-v1-0-10572512a0b2@kernel.org> In-Reply-To: <20251101-slft-join-inst-v1-0-10572512a0b2@kernel.org> To: MPTCP Upstream Cc: "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=6701; i=matttbe@kernel.org; h=from:subject:message-id; bh=glEMJ7NhArT1aQG4urKiW3p8ogCxkHbTuTgMGKWEQ98=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDJZz/emv65YyTudYdLvOF3FyQIf5FwCLu7/GCL8YdkxI +52+Tj+jlIWBjEuBlkxRRbptsj8mc+reEu8/Cxg5rAygQxh4OIUgIncXcfwiynn84v0i8ttZrWw z2N9zPhX3j6i2oqXyThghuuydbseH2JkaHWS0Pzif+V2mEW61jYZR1mONcf9l+7wEjo4ofbrPSU lDgA= X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 Some of these 'remove' tests rarely fail because a subflow has been reset instead of cleanly removed. This can happen when one extra subflow which has never carried data is being closed (FIN) on one side, while the other is sending data for the first time. To avoid such subflows to be used right at the end, the backup flag has been added. With that, data will be only carried on the initial subflow. Fixes: d2c4333a801c ("selftests: mptcp: add testcases for removing addrs") Signed-off-by: Matthieu Baerts (NGI0) --- tools/testing/selftests/net/mptcp/mptcp_join.sh | 54 ++++++++++++---------= ---- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testin= g/selftests/net/mptcp/mptcp_join.sh index e0cdb9c662aa..399805812197 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -2552,7 +2552,7 @@ remove_tests() if reset "remove single subflow"; then pm_nl_set_limits $ns1 0 1 pm_nl_set_limits $ns2 0 1 - pm_nl_add_endpoint $ns2 10.0.3.2 flags subflow + pm_nl_add_endpoint $ns2 10.0.3.2 flags subflow,backup addr_nr_ns2=3D-1 speed=3Dslow \ run_tests $ns1 $ns2 10.0.1.1 chk_join_nr 1 1 1 @@ -2565,8 +2565,8 @@ remove_tests() if reset "remove multiple subflows"; then pm_nl_set_limits $ns1 0 2 pm_nl_set_limits $ns2 0 2 - pm_nl_add_endpoint $ns2 10.0.2.2 flags subflow - pm_nl_add_endpoint $ns2 10.0.3.2 flags subflow + pm_nl_add_endpoint $ns2 10.0.2.2 flags subflow,backup + pm_nl_add_endpoint $ns2 10.0.3.2 flags subflow,backup addr_nr_ns2=3D-2 speed=3Dslow \ run_tests $ns1 $ns2 10.0.1.1 chk_join_nr 2 2 2 @@ -2577,7 +2577,7 @@ remove_tests() # single address, remove if reset "remove single address"; then pm_nl_set_limits $ns1 0 1 - pm_nl_add_endpoint $ns1 10.0.2.1 flags signal + pm_nl_add_endpoint $ns1 10.0.2.1 flags signal,backup pm_nl_set_limits $ns2 1 1 addr_nr_ns1=3D-1 speed=3Dslow \ run_tests $ns1 $ns2 10.0.1.1 @@ -2590,9 +2590,9 @@ remove_tests() # subflow and signal, remove if reset "remove subflow and signal"; then pm_nl_set_limits $ns1 0 2 - pm_nl_add_endpoint $ns1 10.0.2.1 flags signal + pm_nl_add_endpoint $ns1 10.0.2.1 flags signal,backup pm_nl_set_limits $ns2 1 2 - pm_nl_add_endpoint $ns2 10.0.3.2 flags subflow + pm_nl_add_endpoint $ns2 10.0.3.2 flags subflow,backup addr_nr_ns1=3D-1 addr_nr_ns2=3D-1 speed=3Dslow \ run_tests $ns1 $ns2 10.0.1.1 chk_join_nr 2 2 2 @@ -2604,10 +2604,10 @@ remove_tests() # subflows and signal, remove if reset "remove subflows and signal"; then pm_nl_set_limits $ns1 0 3 - pm_nl_add_endpoint $ns1 10.0.2.1 flags signal + pm_nl_add_endpoint $ns1 10.0.2.1 flags signal,backup pm_nl_set_limits $ns2 1 3 - pm_nl_add_endpoint $ns2 10.0.3.2 flags subflow - pm_nl_add_endpoint $ns2 10.0.4.2 flags subflow + pm_nl_add_endpoint $ns2 10.0.3.2 flags subflow,backup + pm_nl_add_endpoint $ns2 10.0.4.2 flags subflow,backup addr_nr_ns1=3D-1 addr_nr_ns2=3D-2 speed=3D10 \ run_tests $ns1 $ns2 10.0.1.1 chk_join_nr 3 3 3 @@ -2619,9 +2619,9 @@ remove_tests() # addresses remove if reset "remove addresses"; then pm_nl_set_limits $ns1 3 3 - pm_nl_add_endpoint $ns1 10.0.2.1 flags signal id 250 - pm_nl_add_endpoint $ns1 10.0.3.1 flags signal - pm_nl_add_endpoint $ns1 10.0.4.1 flags signal + pm_nl_add_endpoint $ns1 10.0.2.1 flags signal,backup id 250 + pm_nl_add_endpoint $ns1 10.0.3.1 flags signal,backup + pm_nl_add_endpoint $ns1 10.0.4.1 flags signal,backup pm_nl_set_limits $ns2 3 3 addr_nr_ns1=3D-3 speed=3D10 \ run_tests $ns1 $ns2 10.0.1.1 @@ -2634,10 +2634,10 @@ remove_tests() # invalid addresses remove if reset "remove invalid addresses"; then pm_nl_set_limits $ns1 3 3 - pm_nl_add_endpoint $ns1 10.0.12.1 flags signal + pm_nl_add_endpoint $ns1 10.0.12.1 flags signal,backup # broadcast IP: no packet for this address will be received on ns1 - pm_nl_add_endpoint $ns1 224.0.0.1 flags signal - pm_nl_add_endpoint $ns1 10.0.3.1 flags signal + pm_nl_add_endpoint $ns1 224.0.0.1 flags signal,backup + pm_nl_add_endpoint $ns1 10.0.3.1 flags signal,backup pm_nl_set_limits $ns2 2 2 addr_nr_ns1=3D-3 speed=3D10 \ run_tests $ns1 $ns2 10.0.1.1 @@ -2651,10 +2651,10 @@ remove_tests() # subflows and signal, flush if reset "flush subflows and signal"; then pm_nl_set_limits $ns1 0 3 - pm_nl_add_endpoint $ns1 10.0.2.1 flags signal + pm_nl_add_endpoint $ns1 10.0.2.1 flags signal,backup pm_nl_set_limits $ns2 1 3 - pm_nl_add_endpoint $ns2 10.0.3.2 flags subflow - pm_nl_add_endpoint $ns2 10.0.4.2 flags subflow + pm_nl_add_endpoint $ns2 10.0.3.2 flags subflow,backup + pm_nl_add_endpoint $ns2 10.0.4.2 flags subflow,backup addr_nr_ns1=3D-8 addr_nr_ns2=3D-8 speed=3Dslow \ run_tests $ns1 $ns2 10.0.1.1 chk_join_nr 3 3 3 @@ -2667,9 +2667,9 @@ remove_tests() if reset "flush subflows"; then pm_nl_set_limits $ns1 3 3 pm_nl_set_limits $ns2 3 3 - pm_nl_add_endpoint $ns2 10.0.2.2 flags subflow id 150 - pm_nl_add_endpoint $ns2 10.0.3.2 flags subflow - pm_nl_add_endpoint $ns2 10.0.4.2 flags subflow + pm_nl_add_endpoint $ns2 10.0.2.2 flags subflow,backup id 150 + pm_nl_add_endpoint $ns2 10.0.3.2 flags subflow,backup + pm_nl_add_endpoint $ns2 10.0.4.2 flags subflow,backup addr_nr_ns1=3D-8 addr_nr_ns2=3D-8 speed=3Dslow \ run_tests $ns1 $ns2 10.0.1.1 chk_join_nr 3 3 3 @@ -2686,9 +2686,9 @@ remove_tests() # addresses flush if reset "flush addresses"; then pm_nl_set_limits $ns1 3 3 - pm_nl_add_endpoint $ns1 10.0.2.1 flags signal id 250 - pm_nl_add_endpoint $ns1 10.0.3.1 flags signal - pm_nl_add_endpoint $ns1 10.0.4.1 flags signal + pm_nl_add_endpoint $ns1 10.0.2.1 flags signal,backup id 250 + pm_nl_add_endpoint $ns1 10.0.3.1 flags signal,backup + pm_nl_add_endpoint $ns1 10.0.4.1 flags signal,backup pm_nl_set_limits $ns2 3 3 addr_nr_ns1=3D-8 addr_nr_ns2=3D-8 speed=3Dslow \ run_tests $ns1 $ns2 10.0.1.1 @@ -2701,9 +2701,9 @@ remove_tests() # invalid addresses flush if reset "flush invalid addresses"; then pm_nl_set_limits $ns1 3 3 - pm_nl_add_endpoint $ns1 10.0.12.1 flags signal - pm_nl_add_endpoint $ns1 10.0.3.1 flags signal - pm_nl_add_endpoint $ns1 10.0.14.1 flags signal + pm_nl_add_endpoint $ns1 10.0.12.1 flags signal,backup + pm_nl_add_endpoint $ns1 10.0.3.1 flags signal,backup + pm_nl_add_endpoint $ns1 10.0.14.1 flags signal,backup pm_nl_set_limits $ns2 3 3 addr_nr_ns1=3D-8 speed=3Dslow \ run_tests $ns1 $ns2 10.0.1.1 --=20 2.51.0 From nobody Thu Nov 27 14:00:53 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 21D3E2BEC5A for ; Sat, 1 Nov 2025 09:15:02 +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=1761988505; cv=none; b=f8x9OX8F/BGj61SEmMlocKqaM+rdtS5aN43osdU3SJS3NXwX0ut/aPhrksUMK1pLM527u6HhXYI8dntTa2HpG7kh05IZjfTBxb8BSgVtJo7ZnXm5L/7y5bjVfscP0x1CXUemPAgmrPVBLjkUsXpdMfylVLP8htVFP4lUNsiwuxI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761988505; c=relaxed/simple; bh=ocLbHxZ9wo2QXyV1i8WpgqWZ27rONG/afCrvvjhF7M4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=CCBmS5cXNWoTD7taAFEJN8KsDlxLDC7EY6OslUtJAHXu+Pp24SQW0I7rZEkJF10zGUIVj3DDu9qpdwRDGcY4fH0UqcPPWayfZ0meOtOIM/SD3jK4cRUMTjljVnlrTXjG7ZRWPesjqn5OL2w0v8m9fcAoWHgvwfa7NokPKvIL8PA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=dfA0nRtI; 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="dfA0nRtI" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 58292C4CEF8; Sat, 1 Nov 2025 09:15:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1761988502; bh=ocLbHxZ9wo2QXyV1i8WpgqWZ27rONG/afCrvvjhF7M4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=dfA0nRtIkekixjLDyGB/ah6n/F6U2FdbK0nW4VOebyCZrD/RL/7lmfTZR/4+sBczx Fs5y7Ctb8aJzJ8PBl02PM2aLicQXwYHhj2abchAff7u0Q3z1lIujxQ59EhTd8nCCmR ymBFHcZe09pTNkahB/fJSwBJiSjMeOKRQ1mdesnAQgAbqAMMUNyjG8/98YOvCymuFi 23vSQ0ZLIHXJImMP9zJDg1HRnQcazJnSea3DlKqE5fG8OqiPLMrPyr+UeyOCUSuRAf BVMssHS07vq2OS+XKRyU0MZNI4eqf1TaqNKTIgNjujguKcYI3niCP7yvC99SlDh12x dVK3Q0Nf+a1JQ== From: "Matthieu Baerts (NGI0)" Date: Sat, 01 Nov 2025 10:14:44 +0100 Subject: [PATCH mptcp-net 3/6] selftests: mptcp: join: endpoints: longer transfer 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: <20251101-slft-join-inst-v1-3-10572512a0b2@kernel.org> References: <20251101-slft-join-inst-v1-0-10572512a0b2@kernel.org> In-Reply-To: <20251101-slft-join-inst-v1-0-10572512a0b2@kernel.org> To: MPTCP Upstream Cc: "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=2743; i=matttbe@kernel.org; h=from:subject:message-id; bh=ocLbHxZ9wo2QXyV1i8WpgqWZ27rONG/afCrvvjhF7M4=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDJZz/dFMGkq3rqZJ7nm2tZfwfL1L7+8262cKHxT8VKhh W8Fv59bRykLgxgXg6yYIot0W2T+zOdVvCVefhYwc1iZQIYwcHEKwESiLjD8YjbU47qzq2T9XaXQ mDeXNHK0Qq0MF0zen2X3MalZdhFTEcMfnsthk54s2iL7wbX1n5Tjig2LKxvvyt4PY82vlOpn45z ABwA= X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 In rare cases, when the test environment is very slow, some userspace tests can fail because some expected events have not been seen. Because the tests are expecting a long on-going connection, and they are not waiting for the end of the transfer, it is fine to make the connection longer. This connection will be killed at the end, after the verifications, so making it longer doesn't change anything, apart from avoid it to end before the end of the verifications To play it safe, all endpoints tests not waiting for the end of the transfer are now sharing a longer file (128KB) at slow speed. Fixes: 69c6ce7b6eca ("selftests: mptcp: add implicit endpoint test case") Fixes: e274f7154008 ("selftests: mptcp: add subflow limits test-cases") Fixes: b5e2fb832f48 ("selftests: mptcp: add explicit test case for remove/r= eadd") Fixes: e06959e9eebd ("selftests: mptcp: join: test for flush/re-add endpoin= ts") Signed-off-by: Matthieu Baerts (NGI0) --- tools/testing/selftests/net/mptcp/mptcp_join.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testin= g/selftests/net/mptcp/mptcp_join.sh index 399805812197..b5a7045c1392 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -4094,7 +4094,7 @@ endpoint_tests() pm_nl_set_limits $ns1 2 2 pm_nl_set_limits $ns2 2 2 pm_nl_add_endpoint $ns1 10.0.2.1 flags signal - { speed=3Dslow \ + { test_linkfail=3D128 speed=3Dslow \ run_tests $ns1 $ns2 10.0.1.1 & } 2>/dev/null local tests_pid=3D$! =20 @@ -4121,7 +4121,7 @@ endpoint_tests() pm_nl_set_limits $ns2 0 3 pm_nl_add_endpoint $ns2 10.0.1.2 id 1 dev ns2eth1 flags subflow pm_nl_add_endpoint $ns2 10.0.2.2 id 2 dev ns2eth2 flags subflow - { test_linkfail=3D4 speed=3D5 \ + { test_linkfail=3D128 speed=3D5 \ run_tests $ns1 $ns2 10.0.1.1 & } 2>/dev/null local tests_pid=3D$! =20 @@ -4199,7 +4199,7 @@ endpoint_tests() # broadcast IP: no packet for this address will be received on ns1 pm_nl_add_endpoint $ns1 224.0.0.1 id 2 flags signal pm_nl_add_endpoint $ns1 10.0.1.1 id 42 flags signal - { test_linkfail=3D4 speed=3D5 \ + { test_linkfail=3D128 speed=3D5 \ run_tests $ns1 $ns2 10.0.1.1 & } 2>/dev/null local tests_pid=3D$! =20 @@ -4272,7 +4272,7 @@ endpoint_tests() # broadcast IP: no packet for this address will be received on ns1 pm_nl_add_endpoint $ns1 224.0.0.1 id 2 flags signal pm_nl_add_endpoint $ns2 10.0.3.2 id 3 flags subflow - { test_linkfail=3D4 speed=3D20 \ + { test_linkfail=3D128 speed=3D20 \ run_tests $ns1 $ns2 10.0.1.1 & } 2>/dev/null local tests_pid=3D$! =20 --=20 2.51.0 From nobody Thu Nov 27 14:00:53 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 B952628DB49 for ; Sat, 1 Nov 2025 09:15:03 +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=1761988503; cv=none; b=kXKb/1o3JM8FXPGYWUw2SiIlBffRXr5xRQRz89NbCDOb55v+VU2eyaAyM9tNOQUB6zLA4wGio9OpvA+AtEK5b3sj2IRREHRnZG/HoGF/tnx9LZfibBcUhonHJPTX5whxrkqfr9uwdTWSzOGpDK9d0BJX0j5ilGUH417KpoTlPTk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761988503; c=relaxed/simple; bh=uQvWJWqihZkGpKPZrKlmGpWWzLcBWMn4qN10M0TfeC8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=WlGSXqCzzVo0DeoufhiTWfhjl+UTwyYKefvxiHQn4MrDvUdr2Q/1+QqJO0PPK1YKm1H2PYCYmRTCPY6HcpowkpgpR6JAzO6d7lE9EpD3oRl8Ew7O/TxcsG4mSTtUnk4MDO9FXvjR2tACqCXtZkAVNjZGAhPT7VBnT+hCbocJDW4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=dDsjWrl+; 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="dDsjWrl+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2FA93C113D0; Sat, 1 Nov 2025 09:15:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1761988503; bh=uQvWJWqihZkGpKPZrKlmGpWWzLcBWMn4qN10M0TfeC8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=dDsjWrl+oQhhxGEqEuecj6ry4Y51Wd7OoqWV2TuWpeC6GBl4+tVAUjT38ih/iVKJl IO2tmg/tSnsmB0TeRv7kBCYJDQQkua4eBE6lQ94qkFWwky/1wvcoh7s16rnCwO2lcQ EfhHCFyCtHfM2l5fbt1SxwK7TT6j8qh1hurtA/7E6hWZyf1sGwxsdGnOc2yidfaEck 3EkTo0/k5uDJYgWETS8ZTGP0GSbXV55tM4IDYXDD1+YA9EzEmFzky2PM6wqE6Hl71v 24PslSjoAZvMdt/roUwijavs+LoGhgQIYBI9iMOOCNKlw4nqxhpme4Tg77vm9czVQz zrtfqmTnsOPVw== From: "Matthieu Baerts (NGI0)" Date: Sat, 01 Nov 2025 10:14:45 +0100 Subject: [PATCH mptcp-net 4/6] selftests: mptcp: join: userspace: longer transfer 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: <20251101-slft-join-inst-v1-4-10572512a0b2@kernel.org> References: <20251101-slft-join-inst-v1-0-10572512a0b2@kernel.org> In-Reply-To: <20251101-slft-join-inst-v1-0-10572512a0b2@kernel.org> To: MPTCP Upstream Cc: "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=2937; i=matttbe@kernel.org; h=from:subject:message-id; bh=uQvWJWqihZkGpKPZrKlmGpWWzLcBWMn4qN10M0TfeC8=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDJZz0+Qm3qj/3YP78+FrGbtnq/OLJ9vHNUUGWrukXhg4 jSh/uWxHaUsDGJcDLJiiizSbZH5M59X8ZZ4+VnAzGFlAhnCwMUpABNZLMrIcES4J/2NRuGSd0Yz l3WxHZkb1xnAHNc9r7LTOCiUe+uzFEaGXZ9u6n8p84pb9eOWfLXWltlnxaYLunsuldusYfQ+tWk +CwA= X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 In rare cases, when the test environment is very slow, some userspace tests can fail because some expected events have not been seen. Because the tests are expecting a long on-going connection, and they are not waiting for the end of the transfer, it is fine to make the connection longer. This connection will be killed at the end, after the verifications, so making it longer doesn't change anything, apart from avoid it to end before the end of the verifications To play it safe, all userspace tests not waiting for the end of the transfer are now sharing a longer file (128KB) at slow speed. Fixes: 4369c198e599 ("selftests: mptcp: test userspace pm out of transfer") Fixes: b2e2248f365a ("selftests: mptcp: userspace pm create id 0 subflow") Fixes: e3b47e460b4b ("selftests: mptcp: userspace pm remove initial subflow= ") Fixes: b9fb176081fb ("selftests: mptcp: userspace pm send RM_ADDR for ID 0") Signed-off-by: Matthieu Baerts (NGI0) --- tools/testing/selftests/net/mptcp/mptcp_join.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testin= g/selftests/net/mptcp/mptcp_join.sh index b5a7045c1392..1af96a63516c 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -3957,7 +3957,7 @@ userspace_tests() continue_if mptcp_lib_has_file '/proc/sys/net/mptcp/pm_type'; then set_userspace_pm $ns1 pm_nl_set_limits $ns2 2 2 - { speed=3D5 \ + { test_linkfail=3D128 speed=3D5 \ run_tests $ns1 $ns2 10.0.1.1 & } 2>/dev/null local tests_pid=3D$! wait_mpj $ns1 @@ -3990,7 +3990,7 @@ userspace_tests() continue_if mptcp_lib_has_file '/proc/sys/net/mptcp/pm_type'; then set_userspace_pm $ns2 pm_nl_set_limits $ns1 0 1 - { speed=3D5 \ + { test_linkfail=3D128 speed=3D5 \ run_tests $ns1 $ns2 10.0.1.1 & } 2>/dev/null local tests_pid=3D$! wait_mpj $ns2 @@ -4018,7 +4018,7 @@ userspace_tests() continue_if mptcp_lib_has_file '/proc/sys/net/mptcp/pm_type'; then set_userspace_pm $ns2 pm_nl_set_limits $ns1 0 1 - { speed=3D5 \ + { test_linkfail=3D128 speed=3D5 \ run_tests $ns1 $ns2 10.0.1.1 & } 2>/dev/null local tests_pid=3D$! wait_mpj $ns2 @@ -4039,7 +4039,7 @@ userspace_tests() continue_if mptcp_lib_has_file '/proc/sys/net/mptcp/pm_type'; then set_userspace_pm $ns2 pm_nl_set_limits $ns1 0 1 - { speed=3D5 \ + { test_linkfail=3D128 speed=3D5 \ run_tests $ns1 $ns2 10.0.1.1 & } 2>/dev/null local tests_pid=3D$! wait_mpj $ns2 @@ -4063,7 +4063,7 @@ userspace_tests() continue_if mptcp_lib_has_file '/proc/sys/net/mptcp/pm_type'; then set_userspace_pm $ns1 pm_nl_set_limits $ns2 1 1 - { speed=3D5 \ + { test_linkfail=3D128 speed=3D5 \ run_tests $ns1 $ns2 10.0.1.1 & } 2>/dev/null local tests_pid=3D$! wait_mpj $ns1 --=20 2.51.0 From nobody Thu Nov 27 14:00:53 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 8E75F2BEC57 for ; Sat, 1 Nov 2025 09:15:04 +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=1761988504; cv=none; b=mBV1F3yiefZjiCSkufCXVMK9o2m4rnGTYSlvNZLG8K5BZ4B7oB6Y7mlzzWyOBO0oTm6uQ4BbkIacB3GnnfnmPU7XzLNg+YrHIsVhZIsolDbyBni8GvVLiDCMHVW3R85wECKrgfyD2lxah3FnJEMaDQXP4Lyjma2fQRtaNDXVa3w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761988504; c=relaxed/simple; bh=j85NVJkS37w/7eW+9H26tgNisTYBkmaVUXChPCz532Y=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=eV+SQy/8T6OtC5Yqc+G1zJ8O+q+NnNmQcslkXiOw0lOtPjYWv+w8zA5EJQUC4RR8ZozceTiX6/v5LLT8GXqevMWetz9CexyrYThdArwl8lTmewcVVrAVS88sS30fwGm4ulFyKgPIzOKt5v/SAb1HsMZsLhZMsC26B4f/I0GDzlk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=EcMR+Msr; 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="EcMR+Msr" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 06BF3C113D0; Sat, 1 Nov 2025 09:15:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1761988504; bh=j85NVJkS37w/7eW+9H26tgNisTYBkmaVUXChPCz532Y=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=EcMR+MsrYY6SovzIQI0uRDyS4nxuxm4U9VwE49QlWuCRus2j/BP4nyPQEfizojZ+m 9oyQupnbIwLRGWBayVeAi/oIl5R6fz0AD80cPunTw4DjHuUS5zLe8dEtHxwT73Dq7c cEzGCgZPfVl5tfE16AHjJdEVoPYyikrQn7CqMuoDoRjV6NY7YMLIqXCX1qEmqitNmn 1mT88/WFnJ8VYQyqOTtLOZmVUmO3Tmd1/vFmbzAWDmZVbERWYGC5BG3QKEKW0EJDeX WNNE2jTv6fhHCghHAYwL7y0yhAv0KS94vzpC/fdc39K+iGWXPkZl728LBJhLdRuPNM zSY1llpTxobbg== From: "Matthieu Baerts (NGI0)" Date: Sat, 01 Nov 2025 10:14:46 +0100 Subject: [PATCH mptcp-net 5/6] selftests: mptcp: join: fastclose: drop plain RST 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: <20251101-slft-join-inst-v1-5-10572512a0b2@kernel.org> References: <20251101-slft-join-inst-v1-0-10572512a0b2@kernel.org> In-Reply-To: <20251101-slft-join-inst-v1-0-10572512a0b2@kernel.org> To: MPTCP Upstream Cc: "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=3485; i=matttbe@kernel.org; h=from:subject:message-id; bh=j85NVJkS37w/7eW+9H26tgNisTYBkmaVUXChPCz532Y=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDJZz08M9GXUDL7eryh6SePIz6gFyX5vPpcfUFj4cMLSs oV3cxQ6OkpZGMS4GGTFFFmk2yLzZz6v4i3x8rOAmcPKBDKEgYtTAG5yJSPDw+/NrmFp7DHVAqVM h/gjj67MCd720HiuVPLMmlNx9a9nM/wv+POv7GOTudXxb0YW9/1nTe6Rn7ntNksud+n++NN3pdQ ZAQ== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 These tests are sending data without any throttling. Quickly, one side will shutdown the connection, which will force sending a RST with MP_FASTCLOSE. On the kernel side, the following path will be taken: mptcp_close --> __mptcp_close --> mptcp_do_fastclose --> __mptcp_close_ssk --> tcp_disconnect --> tcp_send_active_reset The subflow will be closed and the reset containing the MP_FASTCLOSE will be queued to be sent. If some data are received at the same time, it is possible a "plain" reset -- without ACK -- is sent from tcp_v[46]_send_reset, because no socket has been found for this packet (no_tcp_socket). In some cases, this "plain" reset can be sent before the one with the MP_FASTCLOSE. When this happens, the receiver will first close the connection upon the first RST reception, and then drop the second one because the connection has already been closed. In this case, the connection has been correctly reset, but the MPFastcloseRx and MPRstRx MIB counters have not been incremented, which is not what the test expects. To solve this issue, the "plain" reset are now dropped to make sure the one with the MP_FASTCLOSE is parsed by the receiver. Note that this instability seems to be more visible since commit 8cc6e542f150 ("mptcp: propagate shutdown to subflows when possible"), certainly because the subflows are closed slightly quicker. Another solution is also possible: reset the connection with no ongoing data. But this means more changes: data being sent, probably set SO_LINGER, etc. With this small modification, the test should no longer be flaky. It is then OK to remove the MPTCP_LIB_SUBTEST_FLAKY mark. Fixes: 01542c9bf9ab ("selftests: mptcp: add fastclose testcase") Signed-off-by: Matthieu Baerts (NGI0) --- tools/testing/selftests/net/mptcp/mptcp_join.sh | 23 +++++++++++++++++++--= -- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testin= g/selftests/net/mptcp/mptcp_join.sh index 1af96a63516c..0b084c502122 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -335,6 +335,23 @@ reset_check_counter() fi } =20 +# $1: test name ; $2: counter to check +reset_fastclose() +{ + reset_check_counter "${1}" "${2}" || return 1 + + local netns + for netns in "$ns1" "$ns2"; do + # Drop "plain" RST sent because the connection is closed + if ! ip netns exec "${netns}" "${iptables}" -A OUTPUT -p tcp \ + --tcp-flags ALL RST \ + -j DROP; then + mark_as_skipped "unable to set the 'fastclose' rule" + return 1 + fi + done +} + # $1: test name reset_with_cookies() { @@ -3650,8 +3667,7 @@ fullmesh_tests() =20 fastclose_tests() { - if reset_check_counter "fastclose test" "MPTcpExtMPFastcloseTx"; then - MPTCP_LIB_SUBTEST_FLAKY=3D1 + if reset_fastclose "fastclose test" "MPTcpExtMPFastcloseTx"; then test_linkfail=3D1024 fastclose=3Dclient \ run_tests $ns1 $ns2 10.0.1.1 chk_join_nr 0 0 0 @@ -3659,8 +3675,7 @@ fastclose_tests() chk_rst_nr 1 1 invert fi =20 - if reset_check_counter "fastclose server test" "MPTcpExtMPFastcloseRx"; t= hen - MPTCP_LIB_SUBTEST_FLAKY=3D1 + if reset_fastclose "fastclose server test" "MPTcpExtMPFastcloseRx"; then test_linkfail=3D1024 fastclose=3Dserver \ run_tests $ns1 $ns2 10.0.1.1 join_rst_nr=3D1 \ --=20 2.51.0 From nobody Thu Nov 27 14:00:53 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 DC7002BEFF1 for ; Sat, 1 Nov 2025 09:15:05 +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=1761988508; cv=none; b=Tm/W8XFLN1HbrTadKGDjpd4haQD5d3HczoJmLW5+fZiUIjBpi307ZejbU25z+rYLBMRYeli70ZIITzI8BUuceuYgzGsgm3ZfHzWA7wPP2fJWi/dPSxgZIYFd/3qnL3pFNSbGr9vX+Yn7O/yDp7PAC6Zh7jNvT7MIOqPsS7AZf5k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761988508; c=relaxed/simple; bh=mmxZqX7Mj5b4ZP2T2+tx6rK6JsYV9Adi9IOdoGMvEUE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=POXXci902IR82u1orbMztHLPVL7Nq4QaojXh/AMZ9Ef7SEv/zw+BB9IHLD7ABYFFoWJk33oJfawEN/51toExKwPzm2IAEXTp5oY/fFI4Ql5OtfbeP4cUr6lAyPj/TF+nvk5Zz9GUXcm70shfm1x1k4+wH1cAvwmVLGp7S7/+lk4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=GopGl/73; 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="GopGl/73" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D1596C116B1; Sat, 1 Nov 2025 09:15:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1761988505; bh=mmxZqX7Mj5b4ZP2T2+tx6rK6JsYV9Adi9IOdoGMvEUE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=GopGl/73Fl2VdQe8vkgMcnIhI7lzqddXPeU+7s3E/cjTGkV1DCUMy/EhOOaeG7Jne fER1m0BAwBbDn92MimRat4ss7j9ig/Pp87tAuf2jJfd28fhx+oqKJ8L0KRCgRnpX+P maUG/AREWSOzLIpVOrUYHdYE86aoz+Vza+CBRpUQOXSANH5LHKVnday//wINHeRZmc LORhsAenXikj13ytJnNH9D2quhI8M6+kkICckF1AjdRZ2i1lXggxdLsrsWDodde4B7 /YJD+tnwRGoZSI7zdZjCu11QXliTgq27k2E2MfaObwCgbAd5ATI9RUqxxHJcJbd1c5 J1S3v8oZBDXVQ== From: "Matthieu Baerts (NGI0)" Date: Sat, 01 Nov 2025 10:14:47 +0100 Subject: [PATCH mptcp-net 6/6] selftests: mptcp: connect: trunc: read all recv data 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: <20251101-slft-join-inst-v1-6-10572512a0b2@kernel.org> References: <20251101-slft-join-inst-v1-0-10572512a0b2@kernel.org> In-Reply-To: <20251101-slft-join-inst-v1-0-10572512a0b2@kernel.org> To: MPTCP Upstream Cc: "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=2363; i=matttbe@kernel.org; h=from:subject:message-id; bh=mmxZqX7Mj5b4ZP2T2+tx6rK6JsYV9Adi9IOdoGMvEUE=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDJZz09idGpLuu2X4SzqcojN9U6I/LlEUcHqL75H/BI+z hGpnrako5SFQYyLQVZMkUW6LTJ/5vMq3hIvPwuYOaxMIEMYuDgFYCJFXxkZ/m0IKf6RuLc7fs2W g7VRvincrMaqxbf/++dyyf5ji+iJZWSY+2BV6QrR93NWVFSrzJ4df8rjYCqv2Lbm3p1+Wnd6g6Y xAQA= X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 MPTCP Join "fastclose server" selftest is sometimes failing because the client output file doesn't have the expected size, e.g. 296B instead of 1024B. When looking at a packet trace when this happens, the server sent the expected 1024B in two parts -- 100B, then 924B -- then the MP_FASTCLOSE. It is then strange to see the client only receiving 296B, which would mean it only got a part of the second packet. The problem is then not on the networking side, but rather on the data reception side. When mptcp_connect is launched with '-f -1', it means the connection might stop before having sent everything, because a reset has been received. When this happens, the program was directly stopped. But it is also possible there are still some data to read, simply because the previous 'read' step was done with a buffer smaller than the pending data, see do_rnd_read(). In this case, it is important to read what's left in the kernel buffers before stopping without error like before. Fixes: 6bf41020b72b ("selftests: mptcp: update and extend fastclose test-ca= ses") Signed-off-by: Matthieu Baerts (NGI0) --- tools/testing/selftests/net/mptcp/mptcp_connect.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_connect.c b/tools/test= ing/selftests/net/mptcp/mptcp_connect.c index c030b08a7195..6ad2126b08a7 100644 --- a/tools/testing/selftests/net/mptcp/mptcp_connect.c +++ b/tools/testing/selftests/net/mptcp/mptcp_connect.c @@ -710,8 +710,12 @@ static int copyfd_io_poll(int infd, int peerfd, int ou= tfd, =20 bw =3D do_rnd_write(peerfd, winfo->buf + winfo->off, winfo->len); if (bw < 0) { - if (cfg_rcv_trunc) - return 0; + /* expected reset, continue to read */ + if (cfg_rcv_trunc && errno =3D=3D ECONNRESET) { + fds.events &=3D ~POLLOUT; + continue; + } + perror("write"); return 111; } @@ -737,8 +741,10 @@ static int copyfd_io_poll(int infd, int peerfd, int ou= tfd, } =20 if (fds.revents & (POLLERR | POLLNVAL)) { - if (cfg_rcv_trunc) - return 0; + if (cfg_rcv_trunc) { + fds.events &=3D ~(POLLERR | POLLNVAL); + continue; + } fprintf(stderr, "Unexpected revents: " "POLLERR/POLLNVAL(%x)\n", fds.revents); return 5; --=20 2.51.0