From nobody Thu Nov 27 14:00:54 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 2BCD22D4B57 for ; Sun, 2 Nov 2025 11:30:22 +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=1762083023; cv=none; b=gn2bykVEz3MPrm2IFgQNLayWIfeN0xoY1y5prEKTIIj5z73v1OsYDeqTJDtcEbRzxAN+ScmkDHY0+4R+e78FR+xBHicHsIvu5JqfqJlKmaNRaLR2eBT1VcUXcTX0PJ7xtZ88U+tzho4TOa+s3zzRYGv6/L8PPP72ix/XCTZaZ3Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762083023; c=relaxed/simple; bh=Z/5W2x7rJRFgws1zoyWeVLKH2bwRKGy6TKM2NYw94wY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=R7QUc6pQfJ/AthjCpxn7vIj2/hokHwNCZSXZMJ+adP2Itu6u00kfeFrlZeJrzvKHPCE5wTvNw3rdLzChNI0Ngjh+PVRGdhL5hwcHjLbQsjAMBckIqNWravC9GNqSRpn8Zb6K+II6LCEK8KFA8IiqJiwDmuy+EvCeTrsVZQKIRLM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Anot0GBD; 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="Anot0GBD" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 494C1C116C6; Sun, 2 Nov 2025 11:30:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762083022; bh=Z/5W2x7rJRFgws1zoyWeVLKH2bwRKGy6TKM2NYw94wY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Anot0GBDSdlXYTOkcRPHd2Bt6lec1Ljd5UELH+fpR2No5bMGWj675OnBVHfWozFli rPVJtdE/JmgYvO6sN6NAx6qX5J0FTcEC96t/y+gvuhYdmsnJn7YM1DFP9WnwiRF7cQ gZj9YG4nXZU7Y1QPm31aLKBLzP+t4CNwh8JqAdvBQHdNnhelwdYkRBevd0umfxq5mQ QOWuP7Ndatfpx/bibtRjXpvx3bCr/G/3VMY33yIbrHFx8w8D0A7tOOwBKFaNGn8VRX 4f4/1RxnWJmwFMLBOnDCKKoP7L7Ruhg3Sm1LErZBZ9vFTWtayN+lJTC3Iad7dbNoIY y6FuMeCPeNv6Q== From: "Matthieu Baerts (NGI0)" Date: Sun, 02 Nov 2025 12:30:03 +0100 Subject: [PATCH mptcp-net v2 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: <20251102-slft-join-inst-v2-1-b4f3ba15a7c4@kernel.org> References: <20251102-slft-join-inst-v2-0-b4f3ba15a7c4@kernel.org> In-Reply-To: <20251102-slft-join-inst-v2-0-b4f3ba15a7c4@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/Th0Gd3rumMp9WSGDLZHY51BRm83R17Q/4yy6mm81UC/LYBfEYX1p5a96i/Z oLlKyGzjlIWBjEuBlkxRRbptsj8mc+reEu8/Cxg5rAygQxh4OIUgImohjAyHFDLkd7i/ofhy1nX BWtmn1lzSszweCLbRf2422/tKk0jmxkZPk04v/fCryktm2VU/8+1e/QlxuOJK4d/u4lZxpp/Dgw HWAE= 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) Reviewed-by: Geliang Tang --- 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:54 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 DE7032D5936 for ; Sun, 2 Nov 2025 11:30: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=1762083023; cv=none; b=GA74e6kWt05JHJKrNhCeLop5ipG2pF8YdUjE+/PvLrP+lAfIBOkOBAjK8v5svuVuW2sBUkOBrAX8+jB9spUJrK7SIQImi0kMZ2LE1dE9qJhgbxT55zoM2LHOGLtPvU7K2TerVMei7AoG9vWa75J0BKt0m65lfBS9sIOsS8V9FoQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762083023; c=relaxed/simple; bh=glEMJ7NhArT1aQG4urKiW3p8ogCxkHbTuTgMGKWEQ98=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=pSBFJJNjiv26K2P/wy80ltGmTZ74MTpZpU7Sdl+kGGOu+llO1gRKDpRlAraNb20CLXAGYdd0x4SIzzUeA7Q8sWVYMGaWaUsjXEaHIyf+361/2mJNk3bM6ZYbTCLZ3hGlQqpNweu2kQvNPooOdEbTqchdtfAe96j0FH2BQCN7IBM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=IeMD4knF; 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="IeMD4knF" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 20A4EC4CEF7; Sun, 2 Nov 2025 11:30:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762083023; bh=glEMJ7NhArT1aQG4urKiW3p8ogCxkHbTuTgMGKWEQ98=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=IeMD4knFGZVuYfJyHbD1FP0dsc9Rd3NPJOBFN2Fhpw0Nd5eaF1VBY1KYb5Y3jNje1 fAuZzjOTzZsKfnKKLtfzUtaOT8azFj/jvfdeiQCm2WR/SGyhJs7ZN1ulUdainPtf5D KreIbjBou1rIpk5/1j6jXzSbZpVy3IeZMp4krFE55dbcssHUaWqR1YmxQkDOfM09sF 4de4hzo/fL4dAXHZEj3263i/KzuT/Xgj0ARUbAMGFHb+OHXQrDa+XHZpDrNmbZRAEg 9ZBX6h4YpXEIlDJeymW1s6K0GqPEanzI0vgj8/ftI7rR7kJ2HJOGqTEzPH3GjySo70 TDo+WdARjgJIw== From: "Matthieu Baerts (NGI0)" Date: Sun, 02 Nov 2025 12:30:04 +0100 Subject: [PATCH mptcp-net v2 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: <20251102-slft-join-inst-v2-2-b4f3ba15a7c4@kernel.org> References: <20251102-slft-join-inst-v2-0-b4f3ba15a7c4@kernel.org> In-Reply-To: <20251102-slft-join-inst-v2-0-b4f3ba15a7c4@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/Th0Gd3rumMp9WSGDLZHY6HV1jn/gp8L3a/5p5hCtMn45PpSjvM3kT93vPuh etlGbZbHaUsDGJcDLJiiizSbZH5M59X8ZZ4+VnAzGFlAhnCwMUpABNpfMTwP1Z47t2UuF0M3j6X qnQqJ3wtmfnj1b53pzfmFL86lBijY8jwz4Q94uWlh/UB3xhW6IY833WhWKN0ws9M3fuluy6mHpQ vYwAA 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) Reviewed-by: Geliang Tang --- 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:54 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 B2EEC2D4B40 for ; Sun, 2 Nov 2025 11:30:24 +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=1762083024; cv=none; b=j2Gp1syWTQeIDBupxcjBkEOaGaAIAeWxxuKKHHO2YgSJUlCLGhh+iMyPxkkaH96/STHPuc6sxVgO0yRQL+nox8XnINI6i5XrRBpBs7qr5T35eQN7mHlLA6NivhxWIs3FQVV09SdnIRj4hl0z9gD4z3SA2zn2rLxeM+joyEhuHOc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762083024; c=relaxed/simple; bh=ocLbHxZ9wo2QXyV1i8WpgqWZ27rONG/afCrvvjhF7M4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=CIvJZbl//fzwzXqflOLhOw1UhGi1ZOCzqFdEBzX1JuU68M9Yw0Tmk1uABT0TPlm7y1k+HjM+KuUQeZDELQxyZfGOPiHUzptaMDGRAqNCB8a2KDMxOnjErEubP+id//skiVcqrErqGwejNuGnENJxVFKT6XQbYeutP8JUgCZEwiQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=VW5AbLnn; 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="VW5AbLnn" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EBFC9C116C6; Sun, 2 Nov 2025 11:30:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762083024; bh=ocLbHxZ9wo2QXyV1i8WpgqWZ27rONG/afCrvvjhF7M4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=VW5AbLnn7QA9zM6lcnWHxo661NWyJN3E5KZd4ISpmZt+gc8ql8m4djfxOJVhekzW9 4yJ/LNzUaSXIUNG5fMK8EXKtPMyXgeKI5/HRS9eR00ME29JczQn2GAFnchoGr8V3Sb bHLBh+Jh7p3sTVq8Q0w/8jI1vss0ws4mH8aT0L3Ao9Sx4Uh71FjgAgK/R706C3n2O0 TwfPCLRmwp2oKgsCqlnm3tlVUrzKjgpcOn6OCEwISoLghQSuJsJ6yCMtD/iY+ilNYI 8MCH32vmpYuI4c1hO+7FnhfBDSa0AXNizlzNrTS+zZOo9GnvQhc+6uBMaPijHkc2Nb STTcsfH+VcXSg== From: "Matthieu Baerts (NGI0)" Date: Sun, 02 Nov 2025 12:30:05 +0100 Subject: [PATCH mptcp-net v2 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: <20251102-slft-join-inst-v2-3-b4f3ba15a7c4@kernel.org> References: <20251102-slft-join-inst-v2-0-b4f3ba15a7c4@kernel.org> In-Reply-To: <20251102-slft-join-inst-v2-0-b4f3ba15a7c4@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/Th0Gd3rumMp9WSGDLZHU5MP+8zid1b1ct5iZ1l/R3pSrtVClJha1mUS+9Xn Tt0dx1rRykLgxgXg6yYIot0W2T+zOdVvCVefhYwc1iZQIYwcHEKwESachgZHn2YUsIuekv9m6n/ jtbues43K6cc4zgRc2/fhlfKeleybzL8L7M/e+np7OLDwhenHtCM5v56fsHLtCkajb/kRFOsuJL suAE= 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) Reviewed-by: Geliang Tang --- 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:54 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 610D62D4B40 for ; Sun, 2 Nov 2025 11:30:25 +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=1762083025; cv=none; b=hOwWog2MW7oKq46lwV626RyWJarAGnZHaEAodnMhJf7feb1i834eV44kYwYTgWxGJLN6yWo/gKbATtMG8yVKraJCpuxEqHPcBZARl0wnUCOvft7mGtdg1eQxvINOrCdJPiVnfgPNciaI/Kt6kFnLJHyPTvrXVZD6lT9Gh3EJwfg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762083025; c=relaxed/simple; bh=uQvWJWqihZkGpKPZrKlmGpWWzLcBWMn4qN10M0TfeC8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=lzFc6nURf6QTpLR+xZVMWX7up+FPbwssSM9LaQ5b6Eq5/jNEfP3ovLiu96zsmKeQkJOlrS97u9avQKF5b0FExWS48/mu257yMxDupC893tJksoCOfAiSGxJyYoC5dPjDMR6mIlwr2WPpLAcsjmdi5jLqE79C1oiRB15ZCvLlvu8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=AKAOb0vL; 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="AKAOb0vL" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C2F68C4CEF7; Sun, 2 Nov 2025 11:30:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762083025; bh=uQvWJWqihZkGpKPZrKlmGpWWzLcBWMn4qN10M0TfeC8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=AKAOb0vLoXrU5mjVk5hCPZvDJ/OzDzooLNVFJ/tG/9L68TG7XJkfMPqBxEAQpotYE amo2WT5uCrLq5/CGVA0WiQfF2BUkDHYQmm4yyNe+SJqTCcApwuF8Ez7N/KtaRwRHMR XspGre73+YNEaK/jIWlotgprfQ+Ir2LDbdynVH6OQfGs5u2NRd6fishMKMepudwl63 TYrqGJfRi9ocic8SjqCl8iyrBmGm9Q7QQIZSdxdQTAw+9MTb3OGICpM+p3j4sVppBQ u54AY5h7RbcRDGSXBlCJj8WsWd9Aoxt/ZfPtebr8NmcBuEMJ8ko/S3rRIptz+GnUmp cQTEn9i9R+2Lw== From: "Matthieu Baerts (NGI0)" Date: Sun, 02 Nov 2025 12:30:06 +0100 Subject: [PATCH mptcp-net v2 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: <20251102-slft-join-inst-v2-4-b4f3ba15a7c4@kernel.org> References: <20251102-slft-join-inst-v2-0-b4f3ba15a7c4@kernel.org> In-Reply-To: <20251102-slft-join-inst-v2-0-b4f3ba15a7c4@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/Th0Gd3rumMp9WSGDLZHU51FAdmZbV/YdNhe2u4O6bd7e9O7y1+5Td/3ku++ u//7y93OkpZGMS4GGTFFFmk2yLzZz6v4i3x8rOAmcPKBDKEgYtTACayIIzhf9gUB0GWzrZ3J8vO N/td/55xdFVd8t9mA2bbp/Gz+Q5xMzD84b9q8f0me7eh7wEOY4a0F0E2BwtTF/KufvePt/BBe9Y 6XgA= 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) Reviewed-by: Geliang Tang --- 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:54 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 8F1652D593D for ; Sun, 2 Nov 2025 11:30:26 +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=1762083026; cv=none; b=YAMBxW93sJCDAKkAPxN/sg+Xms8vYJ+XdEWO15sRFgGZyzgE22WCb+gnuNLWZ1iR2KfONde77o1yfDwBNu5JmFRCeIJpxjgt5daIE38yctfB4LNf33TNHg5i6+/HYLIplgtzhtG5rkQVfgblbehcSd4QfngQ4nu3JUZsXQcB2FU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762083026; c=relaxed/simple; bh=j85NVJkS37w/7eW+9H26tgNisTYBkmaVUXChPCz532Y=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=N49paivsGT7FrFsatJfD1gxoTB8MWaItU1evHXyNhyIlC+e4kJ2XDwTItWK6CtB1NroEE3Ou/13eAX2KeKrfYxhm9JE60tTqkom+q2af1Yzp/aLmpQLKn5UR8+ZkHvJGfUz0pjVVvqgUx9D58KptEOet2FwpOg7nmiT6HFUMYVY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Sk6cld93; 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="Sk6cld93" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9A932C4CEF7; Sun, 2 Nov 2025 11:30:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762083026; bh=j85NVJkS37w/7eW+9H26tgNisTYBkmaVUXChPCz532Y=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Sk6cld93eoo2DDpbJBHDjOgLhb6PVQyQjRFcVsiYp3u2EZTkPSkrNP4Zjf2IpVnxS beC6nmCSts+Y3aQ26I7U1I0W3ef3gymhNT5b8UOLSRRsoyzqFYZ+yKjbnRgP5myHzj HS9GmRHRxnwgJNYT52xf75CD+0P7LuGHuDQlvlm2xU/sN3twPswq9fTvqPNmUWuPSX Wc+eKhJZguQ86CwBP02g14dnf8NtlA5VBuOQxUiRNGckJj/hfhi84T/7DARASEpdOr /dLNyXpn3dYRK07j84ojd+mUsTAmFfmXXy4HqO/CI1JgSID+pvE/16DAUh23UONE5n 2CtjUtp6GHYuw== From: "Matthieu Baerts (NGI0)" Date: Sun, 02 Nov 2025 12:30:07 +0100 Subject: [PATCH mptcp-net v2 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: <20251102-slft-join-inst-v2-5-b4f3ba15a7c4@kernel.org> References: <20251102-slft-join-inst-v2-0-b4f3ba15a7c4@kernel.org> In-Reply-To: <20251102-slft-join-inst-v2-0-b4f3ba15a7c4@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/Th0Gd3rumMp9WSGDLZHU57K2VyVUvMXKzkGlD1zi596wX37ktvp+19+EJIo jOob93CjlIWBjEuBlkxRRbptsj8mc+reEu8/Cxg5rAygQxh4OIUgIk4sDP8T7v5ZV6v4sTlNpEM NYXNX+V1rnBmMd/KmTlP+GvtY7l4O0aGD/vy1bqfPP1h62W2aE2blmLnqQMMOkd8im8VBDn5u3x lBwA= 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) Reviewed-by: Geliang Tang --- 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:54 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 454452D5938 for ; Sun, 2 Nov 2025 11:30:27 +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=1762083027; cv=none; b=MEaXoAHOkOHiJgPYsdLCe/STxqu5IZWoQ2aqwK/orFK5FVgF5UQsjhinXRdCjIHm9eNpND4SZPruscycaTXkEMupvuWm4fY0o/I9uRpPl3HtFHwgrv03hSALvfH5kdTyLVlqoZLB3b2KfZboJvcuZHpebSRYTjHc3ql+IDae1uo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762083027; c=relaxed/simple; bh=qIBsqFVvBorBqc84mVDtrWVlmPySnuF9WwgXa52rhZg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=VwVdS/sOZUfa9rvy7ExRshiyeNtPujYquxc1WWi4ruZrCGJDW+Y77CMM3HqifHbF3M3hTESDnTYXqIYpxQyXqUi6KRqe9423XwuzNirjnbw17b9yxaSQ0xI75bXTWh1Fn9DnbgKeMmLbNyodoEYTfUIGtQV6dJHwnbyD2oWrFow= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=W2Eah65L; 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="W2Eah65L" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 716E1C4CEFD; Sun, 2 Nov 2025 11:30:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762083026; bh=qIBsqFVvBorBqc84mVDtrWVlmPySnuF9WwgXa52rhZg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=W2Eah65LJ2dS4T1flGSZBKHkf8VJu6ZHfGQjZkfRRCTMUmbY5qaeb+2R3ZyzMLtLM G3+gAh+E9XDst9to5eZY9jBFVRXpYloyZVnad0UJfOZoQ+ydt8UIpX9GpnCimRRLh1 zWQHqNjVdQjxJUBlBuUacTpBFSm6rTv4IAG6XDzs8EOcEOJlIFO2M8W9l5G38MyODN nFOpMwwPuyECdN7XBajGLfMzzGnikVUeHjo/dCNDYkB5WoEcwJL23JNO/i6vXExyB1 EMrTJos7ad7VBf5OBhaI/GhbA3cZHia5/1QtX7KhaSAGKJEJ7k2K+ingkxjaVK5wfi VANhNYSnnlj2A== From: "Matthieu Baerts (NGI0)" Date: Sun, 02 Nov 2025 12:30:08 +0100 Subject: [PATCH mptcp-net v2 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: <20251102-slft-join-inst-v2-6-b4f3ba15a7c4@kernel.org> References: <20251102-slft-join-inst-v2-0-b4f3ba15a7c4@kernel.org> In-Reply-To: <20251102-slft-join-inst-v2-0-b4f3ba15a7c4@kernel.org> To: MPTCP Upstream Cc: "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=2778; i=matttbe@kernel.org; h=from:subject:message-id; bh=qIBsqFVvBorBqc84mVDtrWVlmPySnuF9WwgXa52rhZg=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDLZHc68bYrat+dcde7Nv7ONjq2LX/SpSiiKLVY459EKo 5PH/fL+dJSyMIhxMciKKbJIt0Xmz3xexVvi5WcBM4eVCWQIAxenAExEsJCR4f0sL/4K8RCL3zsW nH3Bor6v5P2evc+2puR8X+rH2y+y8jYjw0vV0GMMW8V+zNx7csFCLa2P31a+vvd/UpLL5TSnJRx Wk3kB 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. SIGPIPE is now ignored, not to quit the app before having read everything. Fixes: 6bf41020b72b ("selftests: mptcp: update and extend fastclose test-ca= ses") Signed-off-by: Matthieu Baerts (NGI0) Reviewed-by: Geliang Tang --- v2: - Also catch EPIPE, and ignore SIGPIPE --- tools/testing/selftests/net/mptcp/mptcp_connect.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_connect.c b/tools/test= ing/selftests/net/mptcp/mptcp_connect.c index c030b08a7195..404a77bf366a 100644 --- a/tools/testing/selftests/net/mptcp/mptcp_connect.c +++ b/tools/testing/selftests/net/mptcp/mptcp_connect.c @@ -710,8 +710,14 @@ 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 || + errno =3D=3D EPIPE)) { + fds.events &=3D ~POLLOUT; + continue; + } + perror("write"); return 111; } @@ -737,8 +743,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; @@ -1441,7 +1449,7 @@ static void parse_opts(int argc, char **argv) */ if (cfg_truncate < 0) { cfg_rcv_trunc =3D true; - signal(SIGPIPE, handle_signal); + signal(SIGPIPE, SIG_IGN); } break; case 'j': --=20 2.51.0