From patchwork Tue Sep 3 10:08:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 13788446 X-Patchwork-Delegate: matthieu.baerts@tessares.net 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 C24AE1A4E88; Tue, 3 Sep 2024 10:08:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725358098; cv=none; b=KqIRPSbIzLJaaGu+IJtRTD9rv0x5rVX+eQZTczR6T42mD/tr/PasLlEtOJhd9BF5dXm6AuKUsnXh0I5JFiP6JtkL0pfjsYVXqe0+uutEDg7BtJTl/LUrM2eoAhrlqgfv+H8/CfInD/ZigYESq8k1ZxwIlMUJCwZe3WVkohEp9dM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725358098; c=relaxed/simple; bh=UzNjJGFouj8dhslGdiJb4b/LAO9FTe2HEbAadmZy6EY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Uzf4x3WPZzXVdgvROL154HFYF7nfD8FNL6iX+kB7r13nGLzTgGXBrg49s1BLLEm42011O+Y057s0sYp/u6MEM1TZAv4C27f4523gAgzBekQRwtTH9gpX58/JCdEI4Jkn0Vf/QnHK966Nd08sa4iWKt0y5yVKlN9Xlw9ztinckxk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=uTw4dwQu; 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="uTw4dwQu" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C4098C4CEC5; Tue, 3 Sep 2024 10:08:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725358098; bh=UzNjJGFouj8dhslGdiJb4b/LAO9FTe2HEbAadmZy6EY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uTw4dwQucCUHDdq0luNISCiMKoPxXZVDGPGHyBV18D1/zXDhk34hD23T3kwI+emqf o6BIfiJ3C00DVKF0AVJUtGbolZHcY2WIXdWkQSGtpK4o7UFHDGFAyDegJkjzyALv7B +KH2btmTGMC4KkSldHQ0Z31ehbL+pr7416P3kxUNxmbpUoy5iMOtYyg5XjohnvzPil xDgNqDuV45zyru6LUP2qEBibm7IysV5yGNidyQgCpb24Tl5yEnCTCrgYy9aC54LDEV QWlH7xutsfckTNWE21djne89nxtrQ/AflVQBdtFqzYAkEz0RwdULclTIRfyoZYmtCB aVBxVtj2XPscQ== From: "Matthieu Baerts (NGI0)" To: mptcp@lists.linux.dev, stable@vger.kernel.org, gregkh@linuxfoundation.org Cc: Paolo Abeni , Matthieu Baerts , "David S . Miller" Subject: [PATCH 6.6.y 1/4] selftests: mptcp: add explicit test case for remove/readd Date: Tue, 3 Sep 2024 12:08:09 +0200 Message-ID: <20240903100807.3365691-7-matttbe@kernel.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <2024082617-capture-unbolted-5880@gregkh> References: <2024082617-capture-unbolted-5880@gregkh> Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1878; i=matttbe@kernel.org; h=from:subject; bh=v/48NbHMmW6SB5kTtotOFsNLfOnzM8ecvHHEzA7c2mg=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBm1uAHSluqY7SjylecZ+REkH5uXOfEBa8L+EvSx xhEPX/1ZI+JAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZtbgBwAKCRD2t4JPQmmg cwc6D/4lalGurp03mPhpC/zHgJ4yZoz5WdgVo06LRbYYxX0y40x8/N0PAYAoHJ+vPO+fttj1Ocy PbpaQJ/o4BHTroegf/uge07o6BAtx5Kg6eduAocRKfnc/lggp1QeIKS7R3mEhcZTd/mbGfCKH4K HujLL/4b86FU5Q/V2CYGOL6NMZnCUAcu5Thyujn5cW2q1DZhTEodqBA8mBHgHXaeJcUCSfyoWPP 2vFS4ZEYeojENRgAE068bObwLTjkuZjyrnp/FB4S0F7QvZsiGdRYTOb5z6XI/V39++uFRVbp/pz c1zPYUPERhEpXZczYTn5aXxtbbHAHHZiAs/EdQwpKvPtIyU+NT3cLdHtFYo4BQH8pR6co5ltIa1 /nxIg7/+FZ7QRJu1JgJVHQfH3PhayducBtdmfU0S3sKYuhes3onyqNL+2twjU5mcGWNFRUnyCLZ hcVGmSFY2qo9lRla6NQb97g0+eFVFwS4U1BZkypIuAffiSKXLMQ23x5952qsvTn+elLBEI2iCsN yLSbJo6CT1dNtMxwOaTI1eE5oq5z4R3c5NcaQkCE8i1jIVj9yMK08AtiRO5cDGn3fSoj90xr8bO sAXZRYaPcPiXxvt/rK4mKBmpXJQ0DgvmbVT58qHiZ3NdYGlQOU+3A8tRybku2f8y2mRXSbB34Cg OMd9D8diVY4F1nQ== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 From: Paolo Abeni commit b5e2fb832f48bc01d937a053e0550a1465a2f05d upstream. Delete and re-create a signal endpoint and ensure that the PM actually deletes and re-create the subflow. Signed-off-by: Paolo Abeni Reviewed-by: Matthieu Baerts (NGI0) Signed-off-by: Matthieu Baerts (NGI0) Signed-off-by: David S. Miller Stable-dep-of: e06959e9eebd ("selftests: mptcp: join: test for flush/re-add endpoints") Signed-off-by: Matthieu Baerts (NGI0) --- .../testing/selftests/net/mptcp/mptcp_join.sh | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index 2be13dd19ddd..69f78879cfa1 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -3632,6 +3632,35 @@ endpoint_tests() chk_join_nr 6 6 6 chk_rm_nr 4 4 fi + + # remove and re-add + if reset "delete re-add signal" && + mptcp_lib_kallsyms_has "subflow_rebuild_header$"; then + pm_nl_set_limits $ns1 1 1 + pm_nl_set_limits $ns2 1 1 + pm_nl_add_endpoint $ns1 10.0.2.1 id 1 flags signal + test_linkfail=4 speed=20 \ + run_tests $ns1 $ns2 10.0.1.1 & + local tests_pid=$! + + wait_mpj $ns2 + pm_nl_check_endpoint "creation" \ + $ns1 10.0.2.1 id 1 flags signal + chk_subflow_nr "before delete" 2 + chk_mptcp_info subflows 1 subflows 1 + + pm_nl_del_endpoint $ns1 1 10.0.2.1 + sleep 0.5 + chk_subflow_nr "after delete" 1 + chk_mptcp_info subflows 0 subflows 0 + + pm_nl_add_endpoint $ns1 10.0.2.1 flags signal + wait_mpj $ns2 + chk_subflow_nr "after re-add" 2 + chk_mptcp_info subflows 1 subflows 1 + mptcp_lib_kill_wait $tests_pid + fi + } # [$1: error message] From patchwork Tue Sep 3 10:08:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 13788447 X-Patchwork-Delegate: matthieu.baerts@tessares.net 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 571D917C9B3; Tue, 3 Sep 2024 10:08: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=1725358101; cv=none; b=gxIuhRxCBFOUh1RJKJuPv9crSUGg9LzcHv4wgLGTslgnMz4xfugV8p5rf/SdI9Ro3n8VIJa0x87LHp9NbSUpkVs5biGenZkqYL2iT2+DWy7GKJ+ttB8owWDgmBcF+QSnYwOkpK+9x/+Nxm9HwQ6bTWt/pVxkP1au8rNqTY5HAtY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725358101; c=relaxed/simple; bh=LGrbH01udiahr2f5q3ht4r6aoqoA6kr6U8G2RxHCO0c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lFlRJpw+a6yDRCz0CHoqdR5SzhnwtFQerMPs5EPylOuRC3pXlF7sZ9EdqagIUzY04qCJySc1h8jiJ3YQa+gVS43MDwWt5EKor/f8VsBZbR1Q447f06buWtAlwpUtC3jKdKB68EhK+SGcMR0NVzR+7+I4wxnFvBs7FL2yvVdFoWM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=MWwZ5U1T; 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="MWwZ5U1T" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DBEAFC4CEC8; Tue, 3 Sep 2024 10:08:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725358100; bh=LGrbH01udiahr2f5q3ht4r6aoqoA6kr6U8G2RxHCO0c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MWwZ5U1TCIYurLZej3f3H72LBn+pWcxUZv3AeC5NWhccwEvjEBigCI2oHgDLfsS4j KSccr82rM+fo8Gpm/7mMcXk/zmlLbWsnAhSU1S0e+SoYuaH2z0OoAecFD/4jy3YKlG e1o8fWb/LoQpR6O+lqeXHLykYT1pzKqaXrFkXj4X0ry23SYbrVHdkyfNwZ6ZNc9o+E tUHaKG4w60mYun48FJVMyGLSKIAaRTbopwxt9Ze2LCpu9qSF7PZwGlTT2uDgaG6Y4h psAA63X2kZo3J/ziVsH0hqAn+WYyOaDcCTbeK+5WGbb7FyPtw6A7pmyrOtSHMh2gVV fSTWA0DPY8dFg== From: "Matthieu Baerts (NGI0)" To: mptcp@lists.linux.dev, stable@vger.kernel.org, gregkh@linuxfoundation.org Cc: "Matthieu Baerts (NGI0)" , Mat Martineau , Jakub Kicinski Subject: [PATCH 6.6.y 2/4] selftests: mptcp: join: test for flush/re-add endpoints Date: Tue, 3 Sep 2024 12:08:10 +0200 Message-ID: <20240903100807.3365691-8-matttbe@kernel.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <2024082617-capture-unbolted-5880@gregkh> References: <2024082617-capture-unbolted-5880@gregkh> Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2517; i=matttbe@kernel.org; h=from:subject; bh=LGrbH01udiahr2f5q3ht4r6aoqoA6kr6U8G2RxHCO0c=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBm1uAH0/5lNfr9nukPzC9laJfl0r+YDkYd2O0fs +fv51iGjnmJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZtbgBwAKCRD2t4JPQmmg cxZgEADtbT6+qJsMdkKlBH38SJDNzLva82FmrGVBIoztWH1fUZ3P3JD8rxrYlUrXbgJgaLe6wW4 YFGM6e9qyijJYMqrHV1olpMuiEidS17tZEzPJoTMi0KFmRnG39L86hhJ7gGMeADB75QAzUcO1ys 8ZwmfSe5g2yOLDVv4MVusW2j4KHMh4/I3sCKfnJV/aVjQ4Cafrp1ogbqEZm977rHf/j6VHs8q27 n1X6nsrWUmJNzhASLsSGYvipHoSskANEK2y7NvnfyjY7kL/xeEXkV6ia+zv8FMR5cbbFMgBW86I IZkg4Gkqy6lMIpJwWsIjDdQhmr7oKhlKMS1YIFzSPi2qixPXE3lEBV9/5npqaaQq25/qFz7LlCw sl3+xPslPLxXttKjkb2dxmcLo9y8oI+iaetEC0ds97V4f117GgBuBCeAa23dlKhl1rePREnmQ6O ctwJIMxEO8Xk1U/2Wcp+LAj9Ma3m6CdfO8hz5WkD1T7yTR5Pr3+DStJsvFYMRrYLlGUcFl4rFQb FaBIRxyC21S6dY/CVtKKQCf2VYQLlwpzBrYhG7X6xlM5+nhWpXI35zMPqGrEu9V6q8UfyDLzc1L lBjy7L4TosDxr/ikPDujYoQvCEFzg4BFUgYvhN3WaMX7yLPjx97oQvlhF/CyxGWGfPnYxQym21I OYIkH1Nszlz9xZQ== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 commit e06959e9eebdfea4654390f53b65cff57691872e upstream. After having flushed endpoints that didn't cause the creation of new subflows, it is important to check endpoints can be re-created, re-using previously used IDs. Before the previous commit, the client would not have been able to re-create the subflow that was previously rejected. The 'Fixes' tag here below is the same as the one from the previous commit: this patch here is not fixing anything wrong in the selftests, but it validates the previous fix for an issue introduced by this commit ID. Fixes: 06faa2271034 ("mptcp: remove multi addresses and subflows in PM") Cc: stable@vger.kernel.org Reviewed-by: Mat Martineau Signed-off-by: Matthieu Baerts (NGI0) Link: https://patch.msgid.link/20240819-net-mptcp-pm-reusing-id-v1-6-38035d40de5b@kernel.org Signed-off-by: Jakub Kicinski Signed-off-by: Matthieu Baerts (NGI0) --- .../testing/selftests/net/mptcp/mptcp_join.sh | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index 69f78879cfa1..0352c05ca519 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -3661,6 +3661,36 @@ endpoint_tests() mptcp_lib_kill_wait $tests_pid fi + # flush and re-add + if reset_with_tcp_filter "flush re-add" ns2 10.0.3.2 REJECT OUTPUT && + mptcp_lib_kallsyms_has "subflow_rebuild_header$"; then + pm_nl_set_limits $ns1 0 2 + pm_nl_set_limits $ns2 1 2 + # 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=4 speed=20 \ + run_tests $ns1 $ns2 10.0.1.1 & + local tests_pid=$! + + wait_attempt_fail $ns2 + chk_subflow_nr "before flush" 1 + chk_mptcp_info subflows 0 subflows 0 + + pm_nl_flush_endpoint $ns2 + pm_nl_flush_endpoint $ns1 + wait_rm_addr $ns2 0 + ip netns exec "${ns2}" ${iptables} -D OUTPUT -s "10.0.3.2" -p tcp -j REJECT + pm_nl_add_endpoint $ns2 10.0.3.2 id 3 flags subflow + wait_mpj $ns2 + pm_nl_add_endpoint $ns1 10.0.3.1 id 2 flags signal + wait_mpj $ns2 + mptcp_lib_kill_wait $tests_pid + + chk_join_nr 2 2 2 + chk_add_nr 2 2 + chk_rm_nr 1 0 invert + fi } # [$1: error message] From patchwork Tue Sep 3 10:08:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 13788448 X-Patchwork-Delegate: matthieu.baerts@tessares.net 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 0F6C717C9B3; Tue, 3 Sep 2024 10:08: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=1725358103; cv=none; b=AwzbQh3hsUPNa9qbAFTPmchTUdT+cIy4ENGqdcIGalegSBy4XEMsBn2w9Ay5GQljox2z4zSE5HUP+dXoEYceh3joLLLcjhNN+5fMiZCjuw7dVvl2T76pWphE/h4YVcEJjNoTzmgrsGggtk7ijRSh/kebtaUMS75HO+250vEhTeY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725358103; c=relaxed/simple; bh=ONfsUj6ZHszT7rtw9q5ppYwiNFmhk+sHUvvYejz2uVI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Z9fhrF6P2frsgpWT2ZjwJMow9xws+u7fyzj9fc/hvCn3MXuAghaqWlT60fdh92TtuOSFoIRMdWPncx1+444d1jrCqryxaEImNwk5du/ZJfqLpPajgKvosDesnckBWiLDizuAOztgFCJKFVWD1RlRxHWlX4Sex8mfmdYqlb4foTU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=eOn5DXua; 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="eOn5DXua" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5237AC4CEC9; Tue, 3 Sep 2024 10:08:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725358102; bh=ONfsUj6ZHszT7rtw9q5ppYwiNFmhk+sHUvvYejz2uVI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eOn5DXuaa1tLIPV64SIbOrHcUeTixTLFYRJwEdVCex5LPTtTl5w14e2hzfod/ee4g uvMIAs75d8UKXbriLsHwS6+E5smtof9baujl3ak+I/MN+cTLeXmkyqpKJf2Ppvjt3r BrjSq7XGMa836k7Ufh/gpYnRnKPE/c71Gta+LkbFwD0KJL/YI5COKluoJhv90tIdzf OLby1tKv6i47XB5amLzygJ17gRkPW9nPy90k9N7TKfYO8UfU/N+OcAsJArrYAwhkcf pj2F0Z4fjQzkNom+/DQ3m8UTbUCThljneoWgiGO824DymVlnTckLxR0jmOa5uV5GKr WwktvGyHcK9qw== From: "Matthieu Baerts (NGI0)" To: mptcp@lists.linux.dev, stable@vger.kernel.org, gregkh@linuxfoundation.org Cc: "Matthieu Baerts (NGI0)" , Mat Martineau , Jakub Kicinski Subject: [PATCH 6.6.y 3/4] selftests: mptcp: join: check re-using ID of unused ADD_ADDR Date: Tue, 3 Sep 2024 12:08:11 +0200 Message-ID: <20240903100807.3365691-9-matttbe@kernel.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <2024082617-capture-unbolted-5880@gregkh> References: <2024082617-capture-unbolted-5880@gregkh> Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2949; i=matttbe@kernel.org; h=from:subject; bh=ONfsUj6ZHszT7rtw9q5ppYwiNFmhk+sHUvvYejz2uVI=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBm1uAICzqPd5pjnnpmFe0xW04TGDC7r/Pu8DfNs Tx96+QcnOmJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZtbgCAAKCRD2t4JPQmmg cz/fEADBxTNUNMM3xELF3FxSbBdQqyUlqOlVveVPeZMGDNpPRGhtDOrPf8m+mIQmb4ygCen2sQg 2E1409hTUBtq7JxXnw96IiEh9ZO6MpxmlOkC1/i/SCs83N6iAgTae/7zpxhaXSIALxSUvuWe79o zEMNKpLaaUw08DIFN/DSFbk/yGlkvf0p+q1H7Q42aQo9YAMG5glbZCoHBvsnSYJF16UITYrrWON 4SyN3U2MGCMzlPJhSoK5pf9ieuntdC0R1giL9WJrlQhpoC97F82ra0sPOFAsnL/0VPKS01j3HT3 w/E5ylKNyHW297zWB3QRreYe6A3WofuagwoYvQq4cXGXakjiQV8G9q68JuB3vKZJm7XYJ0vY14F VKbtQMAYhhnncX28qzpf3swQJqM+nLh3zhwG3UiKLs/jntAWGpewKeI1mZELed0YfQX7QR6YWJ3 F5BTTbcq/pQYCJyqDwniT3JrHUpRcrVaAXirmvHaOC/SpafXD9LWckdMPPmQp2dXXdFjr+2Nzvk /CnzAAmKrANhNpdCja9x4+lDFN/rrbyZS0H8KU4ISPZT8m8MouaGdwVwXdMZuqaJbCfy9nZFjqF RkcnW9kpscM73N2MOY7tk/jUSDHcQiJsYzz2lu68PIWd/DOPAXMJxvmQ+DO33ya3XRnR1BBxxJu AZU6cYMBWMXdZdg== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 commit a13d5aad4dd9a309eecdc33cfd75045bd5f376a3 upstream. This test extends "delete re-add signal" to validate the previous commit. An extra address is announced by the server, but this address cannot be used by the client. The result is that no subflow will be established to this address. Later, the server will delete this extra endpoint, and set a new one, with a valid address, but re-using the same ID. Before the previous commit, the server would not have been able to announce this new address. While at it, extra checks have been added to validate the expected numbers of MPJ, ADD_ADDR and RM_ADDR. The 'Fixes' tag here below is the same as the one from the previous commit: this patch here is not fixing anything wrong in the selftests, but it validates the previous fix for an issue introduced by this commit ID. Fixes: b6c08380860b ("mptcp: remove addr and subflow in PM netlink") Cc: stable@vger.kernel.org Reviewed-by: Mat Martineau Signed-off-by: Matthieu Baerts (NGI0) Link: https://patch.msgid.link/20240819-net-mptcp-pm-reusing-id-v1-2-38035d40de5b@kernel.org Signed-off-by: Jakub Kicinski Signed-off-by: Matthieu Baerts (NGI0) --- .../testing/selftests/net/mptcp/mptcp_join.sh | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index 0352c05ca519..cdba2607b272 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -3636,9 +3636,11 @@ endpoint_tests() # remove and re-add if reset "delete re-add signal" && mptcp_lib_kallsyms_has "subflow_rebuild_header$"; then - pm_nl_set_limits $ns1 1 1 - pm_nl_set_limits $ns2 1 1 + pm_nl_set_limits $ns1 0 2 + pm_nl_set_limits $ns2 2 2 pm_nl_add_endpoint $ns1 10.0.2.1 id 1 flags signal + # 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 test_linkfail=4 speed=20 \ run_tests $ns1 $ns2 10.0.1.1 & local tests_pid=$! @@ -3650,15 +3652,21 @@ endpoint_tests() chk_mptcp_info subflows 1 subflows 1 pm_nl_del_endpoint $ns1 1 10.0.2.1 + pm_nl_del_endpoint $ns1 2 224.0.0.1 sleep 0.5 chk_subflow_nr "after delete" 1 chk_mptcp_info subflows 0 subflows 0 - pm_nl_add_endpoint $ns1 10.0.2.1 flags signal + pm_nl_add_endpoint $ns1 10.0.2.1 id 1 flags signal + pm_nl_add_endpoint $ns1 10.0.3.1 id 2 flags signal wait_mpj $ns2 - chk_subflow_nr "after re-add" 2 - chk_mptcp_info subflows 1 subflows 1 + chk_subflow_nr "after re-add" 3 + chk_mptcp_info subflows 2 subflows 2 mptcp_lib_kill_wait $tests_pid + + chk_join_nr 3 3 3 + chk_add_nr 4 4 + chk_rm_nr 2 1 invert fi # flush and re-add From patchwork Tue Sep 3 10:08:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 13788449 X-Patchwork-Delegate: matthieu.baerts@tessares.net 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 7E2E51A4E9D; Tue, 3 Sep 2024 10:08: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=1725358106; cv=none; b=d1KRru9Xobgn4coSgyYBuvglIOcbBd6w5LjpVWHhrCEX7T7zl3AVUxhu+6agG4XkDy0OLg0BMeXfTvRdhnOb7EOxoNZr8czaLWD6CvShGROW/XD8ixpfsTexAt/98ezcGyh95+2gFF052JFDDIZQ2U/hCl1suHRvAJdaJz4m/18= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725358106; c=relaxed/simple; bh=YDUAGoreZMhWbHrXJ2ejXtenow1Sp55e6Ka0MDTS7Nw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=okRQ0gPrMxPT7lMRWwe26QMueCrUyV3/1shydZuGhbroM2vMZ21QUQmGrk/DkBMYb6zd6DwKNGWSA2P3bP8xiMi2rCpD/4fZAlxFywx9oketcX8mYgHu8o/QbSiShB+8xtCrkdFAl0lCcKepIuL4bxJno81qjsPcTSmv3PWHevo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=pf7UJBLF; 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="pf7UJBLF" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 69CEFC4CEC9; Tue, 3 Sep 2024 10:08:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725358105; bh=YDUAGoreZMhWbHrXJ2ejXtenow1Sp55e6Ka0MDTS7Nw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pf7UJBLFqbWw663Fkc3XZYiT8FE3H+/BId1mPnInr4rrH9DubzxBRikMyJL/hQZst OYPmTtAvOpSuth4xic86sQNCPVO1+ASaoSXAaRYIez5EZYwoHtwozWDJcIA4sDsgvq h83arx4j0/1iGt7KBd+JPVkbvgbZ6pK1oRczMyu21SPJPFC0/ycnqI4nwiUGRmcy3e dJe6Pyqm0i7th3jWjC70+KqwBFSoqsHgDl3gMu+7t4JLeQQyd4f7nF7XKF3gK8N+bP dZiLjZf2qLPiIhM+WEdnmjjdoDn9bsZ3/GKGV29tAMw9hh1mp2snIdT5Aj1qIT9trJ cxutVSIYcoQlQ== From: "Matthieu Baerts (NGI0)" To: mptcp@lists.linux.dev, stable@vger.kernel.org, gregkh@linuxfoundation.org Cc: "Matthieu Baerts (NGI0)" , Mat Martineau , Paolo Abeni Subject: [PATCH 6.6.y 4/4] selftests: mptcp: join: check re-adding init endp with != id Date: Tue, 3 Sep 2024 12:08:12 +0200 Message-ID: <20240903100807.3365691-10-matttbe@kernel.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <2024082617-capture-unbolted-5880@gregkh> References: <2024082617-capture-unbolted-5880@gregkh> Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2908; i=matttbe@kernel.org; h=from:subject; bh=YDUAGoreZMhWbHrXJ2ejXtenow1Sp55e6Ka0MDTS7Nw=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBm1uAIKdWA8/62anLwQn+NfaNMkURj06gGQLsHm 4MwQpqu/QOJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZtbgCAAKCRD2t4JPQmmg c8e4EADqrs2OAH8g8w3p1DMN8lE4LYQKEcD2/Q19XXgZ+nkYbqzQ/FtdzzA0eeVe4mK2c23uu1w NvsQAQNAnFfN8pL8Slr+JCn9rLK+HmZKNhleQW3JD13UsVEH5fqL+LaJbAfHGR0QofAFTkGCBzu CTVSTSoQDABe8kLV9pp3zyi/cEl4E963DtQve5R6pFTeA+vOwaWQXQahCeq+vGogWgVOc7b4YkE HzTlrykE4w9iztKDKn5SFGLjH636H9FJu/ZwVbHV5we9Qey3B/yZpkdS+3rlzMDeDdJjUw38kw9 pWChBqudTM0pDLaGTE1HblYtXpOJ13x9EYAnU5DMccZBI2sgxZRXKA879CS0tr08NRRJydWO8Gn 22tv8fzjVJSpQs4ICPQG7z3eFv+GpIwvwfPDDZ4s5BWwfa+L79nBD8e1kmVt4IbyraYLCnVwkMy ySI/AGABMRzdSTpB4tZlhKAU/XtIeien8UzsRyK7hCI/NNIE+/ymcJ1sIY7U+S+JU54Zosu9sbe WsdASf1HsLcvyEK+IraJXjtj/BHpvGV5NXcWnplypINd2U7FudhMRaYmfMAwaUCwHF4n9+V6j+I MrmwQUCM9wOAVG2HeBD1jm9UCo9b8vv6g5vrW5SwEvcdgN18u+LPiknxwDo4Q65j9ajgCaFCmYP E2ACKgs4BWxc+kA== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 commit 1c2326fcae4f0c5de8ad0d734ced43a8e5f17dac upstream. The initial subflow has a special local ID: 0. It is specific per connection. When a global endpoint is deleted and re-added later, it can have a different ID, but the kernel should still use the ID 0 if it corresponds to the initial address. This test validates this behaviour: the endpoint linked to the initial subflow is removed, and re-added with a different ID. Note that removing the initial subflow will not decrement the 'subflows' counters, which corresponds to the *additional* subflows. On the other hand, when the same endpoint is re-added, it will increment this counter, as it will be seen as an additional subflow this time. The 'Fixes' tag here below is the same as the one from the previous commit: this patch here is not fixing anything wrong in the selftests, but it validates the previous fix for an issue introduced by this commit ID. Fixes: 3ad14f54bd74 ("mptcp: more accurate MPC endpoint tracking") Cc: stable@vger.kernel.org Reviewed-by: Mat Martineau Signed-off-by: Matthieu Baerts (NGI0) Signed-off-by: Paolo Abeni Signed-off-by: Matthieu Baerts (NGI0) --- .../testing/selftests/net/mptcp/mptcp_join.sh | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index cdba2607b272..a338ad9b779c 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -3636,11 +3636,12 @@ endpoint_tests() # remove and re-add if reset "delete re-add signal" && mptcp_lib_kallsyms_has "subflow_rebuild_header$"; then - pm_nl_set_limits $ns1 0 2 - pm_nl_set_limits $ns2 2 2 + pm_nl_set_limits $ns1 0 3 + pm_nl_set_limits $ns2 3 3 pm_nl_add_endpoint $ns1 10.0.2.1 id 1 flags signal # 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=4 speed=20 \ run_tests $ns1 $ns2 10.0.1.1 & local tests_pid=$! @@ -3662,11 +3663,21 @@ endpoint_tests() wait_mpj $ns2 chk_subflow_nr "after re-add" 3 chk_mptcp_info subflows 2 subflows 2 + + pm_nl_del_endpoint $ns1 42 10.0.1.1 + sleep 0.5 + chk_subflow_nr "after delete ID 0" 2 + chk_mptcp_info subflows 2 subflows 2 + + pm_nl_add_endpoint $ns1 10.0.1.1 id 99 flags signal + wait_mpj $ns2 + chk_subflow_nr "after re-add" 3 + chk_mptcp_info subflows 3 subflows 3 mptcp_lib_kill_wait $tests_pid - chk_join_nr 3 3 3 - chk_add_nr 4 4 - chk_rm_nr 2 1 invert + chk_join_nr 4 4 4 + chk_add_nr 5 5 + chk_rm_nr 3 2 invert fi # flush and re-add