From patchwork Mon Sep 2 17:25:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 13787554 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 320FC1AB6E5; Mon, 2 Sep 2024 17:25: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=1725297926; cv=none; b=BQ4gnmwP1upvP6y7s14n0dYmoicRev9VEG2Q3rEfwWjB25hLfofwi0ORXh+r/Z/z+VKrn/YqDfPsWo0V70Ch4h96When4KHeJARAPDMiS6k+AvtRl+SFrvD0w9+zvOdeCSY0+e7SmaTVPlVQtIF0Q+RJDjw+Un7xMt/07PT2p9g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725297926; c=relaxed/simple; bh=HfEJ0Z05Kx9lyhLN3PaWIl9Ko9x3cx47r0Izb7al174=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZNiaNSnHuhdhOB+PB/O0BDECUgnTNo9TATAzBd+jcmACcuN+nzWwyLfqBcpzs0Tr4SH9cEvL3JUtZETO5W2uUEGjlEVZ9z6y5fZYaCYVbER//hKpKflN9qRLBxAG4BsLhBE+/1ZwdTAy9o8Etpafv5oLYE/g6wH3w5wiF3VoL6w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Eh7czBmh; 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="Eh7czBmh" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 85740C4CEC9; Mon, 2 Sep 2024 17:25:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725297926; bh=HfEJ0Z05Kx9lyhLN3PaWIl9Ko9x3cx47r0Izb7al174=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Eh7czBmhyyQ1OIXKyRjvjD1D2rQ+QBAbNGKzcCL8sw+UeBKE3BdqNADjZd/i4Z6Bq h4mawc017W8g+NgAGIn38aCZUXZlhkaH/bPAmSIezB8IqdHTWlqb4ReAQmYfV9OCE8 ZP3XFOcQUeV2llYRfHe8gomlu7q0/xbCqWqnC/zfPJIdmFbgnlHUpqQKz2gAhJCxxY 0JaJEkO/l7+/akA6nPK0JaHZscY5zHRrNg7VLNYeX2Qh+VrJMdseGbnj7XZvyX7+3v LSXsU1S+tbF66WqzmWNyd8qLPWlQFnADTNWQKSrT7CRx0uok99nmiY3N8DwLTl9wpA LECSdLRlkQU0Q== 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.10.y 1/6] selftests: mptcp: add explicit test case for remove/readd Date: Mon, 2 Sep 2024 19:25:18 +0200 Message-ID: <20240902172516.3021978-9-matttbe@kernel.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <2024082617-malt-arbitrary-2f17@gregkh> References: <2024082617-malt-arbitrary-2f17@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=U+jI+zB7yyY7VVqn/y5l2bv90xABV+gkSkncZtwgTQI=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBm1fT8wRWd1RXk6xMQfvU5l+yPRD1h9mul0ySwD FQtC6uEr5yJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZtX0/AAKCRD2t4JPQmmg cwzLEAC53z2DyMTXM82wq8QuNxeEGlXObeS69CeW/KC40dWnxd+eH1ssxyVdix9lsVhSDHGGtE6 p17QsQBJ4erIaU0KZmerxVYodjeTAy+OYA7BxtY76aTW4ZrqEOUN/LVrkPEYBhWrG2mE5eNByPp KpUXY829AeiLRU4QhI/uuZ8uc+5bNqVYBh3ly+BlgC7jMw8Py4Sv6vVjCxiSolqkuX3mSZJgTrG 5TZFnLzImnRtrD4TWGRIIvUhherkqSlzV1tFyi6IOgN8xKkQL8QkZ+mG+q2bygJ7SSsHNsGYvKN wCsptcs9uEIDbJ89E38EE6PELKZAbJvU6jWF9zjjF7zKvubP2XUJv2YSe70x+8vP3XEydkHvMIZ GFa/gvjdKUvHHtXmyPydxnV6jpd2aspM/7fnpQMf0rpnjKzoD0EO4/aS/hewwSYmA+2gFIvPchQ bU6uEYP1JrnukznB8umSXCSn7AZjGepdXtJS5Bv18YohxYvATZZRyWX5xW9sRJ9PFvp30AhgYUe 0Q2FPdN5G9/e2W1nM7StvMWIZMOmIdq8YOhQbgj+4hmtVkezNbo5RUN3twGtTLJ5SmxAYSV79Vd NfuLXTXEVsBIhOVEnM/W/ZPAd/8N0sJ5prNmXeZwPm1qXY9ur8BlQPYk1Kbo6z+BtMdOs79s17F eN0I+f2N8FVG5qg== 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 c0ba79a8ad6d..fb2d8326109e 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -3626,6 +3626,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 Mon Sep 2 17:25:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 13787555 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 715811AB6E5; Mon, 2 Sep 2024 17:25:28 +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=1725297928; cv=none; b=KfaLKQilQvnpSPaltEBK0nQQ8/orHt4+N011pAX3esgEbXSL9qdoVErEFOd7vlyRfRUf5A462HtrLLjR9QsINkNhp910CuIlbn5vnCILTZMvuyl1AhANFIpJfuKxPUnOhP76lYp6Guswl41K8cfE1d/BqPGkC3ILp+w4KG/388c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725297928; c=relaxed/simple; bh=NmV/2KiAqkucjyEihyCSc1dEWciI3jC8QlkGn16kAfE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rpThFGLpkyPcNw3Ze+iwGtw/MWWzQot4VJpwMoKSFNV7dkCs3MmOk7TPiUXgUo/bEe79JHbF45bYqaOC5SZI1JSHvmaUplwBjjjrUDwFThgWECt1QxX/YehhEuBIYQOUPrbRuW4CnbFrxz3Tg+PglNG9Ha9h+NQxlQ0Bje4eYkw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=bf87TAWO; 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="bf87TAWO" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7BD67C4CECF; Mon, 2 Sep 2024 17:25:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725297928; bh=NmV/2KiAqkucjyEihyCSc1dEWciI3jC8QlkGn16kAfE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bf87TAWOwqMib7hwixH9UEBVR+/nH5wKhNccIRE6TAxgj9wF8QyGFh9FtVCCPRq68 U4/2Cz7Z4dlKWCJHXg6cZoS8cuFmTpsUHrZLZsunEuvVj3JnfhG6PN7f4SsaGIVdD7 yDpnfKyL6WqNLxqiYlZdgcW729net1DP4yP/BwFLefc6c0GqopsETe+wej18i8CkOD a71JkN9ktY4j2ZIIKXmYwk5nwwpxZGFUVRM00cUxTPDHhfoQRHc/6e7Yv9w/dJHSS7 LrkU+jE8mEkteLebX7wS93Jy408xccKHa73aqdKq4yYpJ5zm40RIuE68b8G4FgIEXO vlPQMb445lXuQ== 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.10.y 2/6] selftests: mptcp: join: test for flush/re-add endpoints Date: Mon, 2 Sep 2024 19:25:19 +0200 Message-ID: <20240902172516.3021978-10-matttbe@kernel.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <2024082617-malt-arbitrary-2f17@gregkh> References: <2024082617-malt-arbitrary-2f17@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=NmV/2KiAqkucjyEihyCSc1dEWciI3jC8QlkGn16kAfE=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBm1fT8TkXo8jqiHHUQERYrxMMHBJv0nY1WtLu7U UnBDKnHyliJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZtX0/AAKCRD2t4JPQmmg cwrnEACdlMHwCflFLB/HIb3R4CtZaiPCa9RJyW2OEIFcgNWfy787+G9q3/Tz/3cCKMT2B3/z4p7 rAem+4K9pOv5o0Dmw5Foa/1j0E3Zi4uAW0/g2g2AgKuIbD0LmoJ5Jk9ji8WdCFJCNoQQwabZHWL rMSDhkwm14jLEfM5jfvNbEVcwsT2BH+Qu9NOcPaQlIBa6Vf7YM8G49Ucw2jcKz79UxpwTW3CspV dyfUunptIr/3ETTkK+8iq/1rw92VQM2+TTjlz6Oj6adLJ4RZy7HtRlXdthI0Xsmw0xUHrBgsa89 Nnn1ZOMtv6H/yWP6UukNIgoXuhC5RmclsAAZxmztkvSHqF1nTg0dkyGJpcdhfF+QjJrJy3n9Jl8 8Lt78EGk1okTg5BTrTns+66rrRIZyuwJ/9alzvEyHWXsi2i99aIhfxnME7LziXEcrNyAx7cI1Bm tiCCqa4iIKaM/Q+MV+wJdxJZTWEZ19glEJACcTleD+CT8lcPOkg+JNdYo5b2XqfIZMthEYC7lxL 6EbYMUFZVxXgSoZNYRkhjqY5OQY+pL5i3ldkQ92LXIYU4zxFwyidGO+uDZQA3XmzOHAVCjP67O6 5nXmDAWm3KnNuIY+R8MhGRXzax634YhOenPPzoclK27ci8WNb8NlhidHvQJKB2dtHdPcjYGmG9C M80eQ+15kHgzCwg== 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 fb2d8326109e..7dee194bdb62 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -3655,6 +3655,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 Mon Sep 2 17:25:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 13787556 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 0A82E19F129; Mon, 2 Sep 2024 17:25:30 +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=1725297932; cv=none; b=DOJOP4Rk6Hkovzd/ThyvSCCw/GZvFTtqOM3BxpJhoi6iQ1R4vNhruGLRkX4+L0ZSGQj422j64I4UOw9stclgzorFnwgZjHObC1SWGl8fPfowOa/NwDjC/nms9AAtpShuEfEcTLqMEgi7Zd+XRVs4a3RLRYWaWB32as+YYyTvBn4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725297932; c=relaxed/simple; bh=UcWk6p4N12BZ7iOJbyImbMLKPfb7OxRGjLJkRLTqKnk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=r3znyMc1ATBM5sQlCDawUWpuPcdnGp3kBKiLoXYLpOuSsfcWtLJXPCUw2mJ6thj/lMMIx8a40IehauPoluovYRzZyou3GkpaTxcCKbksJk1y9Lqv3kvcw7Q8tnA2oaUjgCrIRc3O6M+XwRtHU9URttqicL1uBkwwqqqAmE0CxYw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=GaiaDrtl; 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="GaiaDrtl" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 73C12C4CEC8; Mon, 2 Sep 2024 17:25:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725297930; bh=UcWk6p4N12BZ7iOJbyImbMLKPfb7OxRGjLJkRLTqKnk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GaiaDrtl6IEYEwbJm0KUT+cB7xZWQ0ebitMB7dGdyfROkkIUpEvEpDBGtEj4c53D+ 3iUI8lp3xDu8jGsbNevXkNDANvdb6ZUspH59Nai5gHhl+96PdBZGHK6G3Oh3923nNX DmJ8zxm/HZfJ/exisdYg20F4+o5967Q6zqxweQxIfsCW44gjC63cWs/5rUlI3efYxQ sJTtCF4o4Vzy59kejCf494U/7YehOfR6Oy/EtxTTlrqY0b22ISNdxoHqNF9AICwsTp kYZSMgfTGtuRZt+uCVM5P0Tgj3lpyewrdUKLfbUugc8eIp5g++fi+Lvpx2lEVgMvAr EI50L2Ufrbqpw== 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.10.y 3/6] selftests: mptcp: join: check re-using ID of unused ADD_ADDR Date: Mon, 2 Sep 2024 19:25:20 +0200 Message-ID: <20240902172516.3021978-11-matttbe@kernel.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <2024082617-malt-arbitrary-2f17@gregkh> References: <2024082617-malt-arbitrary-2f17@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=UcWk6p4N12BZ7iOJbyImbMLKPfb7OxRGjLJkRLTqKnk=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBm1fT9tnxNNYcsPHTzzeNfjWqCtYx3yBBBrhW9Z Hb1g5+WJT2JAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZtX0/QAKCRD2t4JPQmmg c4HsEACCsgEY8UAe5CpeVcZgpTSQSg8hSoVDRk8gu7qvY1BK1Er3FOiLS7Jxo/YuOQIsA3SQUVU w09BsRwswL3trwy0MakoAQuvheAiRzKVz+kMXrmnbfDq2DJhJ+3nMD/YLeMSKQ+k7sK/VhFSdN5 LPVRr8sQhc6Aj3RsgozNIM9vRKHpTr2AE0ieqJsCIhnuB3ig7hUSxFu+fj9lM/cP6VPDSn5gffv GdV1ktHXu78m9x3rjNjFT+cnWPVB9knruul05qr6OHZUdtKgMQJpkugmmeDUOLGDw87/foFCo4z qYaiia3+vsa3PHvDrzvSviVK2q4myJEVcAZpXITlveVNInErpEFxeuqkeeU+gwvVbiaNI2RpZ4B VWzCPZxRgN1b9ChknJXBkItVNcibzI6aFx/o4dNWHvQdzRc7qGaGdoVP7auILxtCrpvJLEOBlnU rzyXKRioU6yEDdQ3s9rgwViNQYKk8jbz3bP/ldcksQRR480a+YnG/p17fTZaTYmUJGplW2917oN +XkfDsSBYtJy6Gf6AwrMpAbHGFtZg6xqeEItjM3P58K1ggZRtzCFHFTHXJKRTSQvkumjzxFzm1V vtkOEuA+dtTtmNVZiyMlXT2eETpq8XSY3xOSAuplH6JfiFpXSVSWGd/3ZIHoqy8Sz3AekEYns4s 0mUWwOh7aohToPA== 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 7dee194bdb62..64a35f96ff92 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -3630,9 +3630,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=$! @@ -3644,15 +3646,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 Mon Sep 2 17:25:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 13787557 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 3CB581AB6E5; Mon, 2 Sep 2024 17:25:32 +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=1725297932; cv=none; b=I2H/iqQYiJtpRlthQsfF9TKHnB2C2nFuBmiPIubCJBYkaM+5AASZ2IdVK/xzrlU/O8cSIA8bjnjZNgombJaPP6dorM+YVexrURUcux83i1R8VJJG9TxpxGvZrpjh9NMYRGnwsJ9muqWPX8K2gZTVkU9KI2Df6DeFmhjjVNYsdVM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725297932; c=relaxed/simple; bh=UEuQirwcMZ1Nt07SbxFTn7blzZQl63kub0Cvm5WliP8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Bv/MdfQLQ/Ptqx/7KH4H4pYuQcWG/+0gEkjCeUAG1NwYQzUm01xyqjv/1Ysk8dUPH5bYb3CXXhKo3Ai28zmggagmLYovxM6cmZvBsCfGGRAxJ5T+OrYmNMAbSmn9EHkWhH3P7Y3pVuWi4o0BMc9FdpTIBnb57XvQvWp9CKU/22s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WrocUqjw; 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="WrocUqjw" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 684EEC4CEC7; Mon, 2 Sep 2024 17:25:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725297931; bh=UEuQirwcMZ1Nt07SbxFTn7blzZQl63kub0Cvm5WliP8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WrocUqjwist7ysMjO56ENJegqZLG06soUbq+roPEVd94LmDCaSDYYLdpYLUq0KuVQ m/pCGYNaXOKuKSOJrLi3/CTEsolWo67FZHD9LG/ficgT9p7PEz+GXPrUBgCL77akEw WZ8KCappl3QrYRIwrDtxftSzKvfccno88s5wAwxDF0P0EyU4zMv7WGTDGVTo7Lx9wP nosh5XEYU8LRR5NPPOiw+y5mJkaCjCJO0lELKIivp5AF72Cye6vsPRwlvgkRJdcTjt D0FxnKv/CDghKhg7KLWBdsIHBjgv4BkBT6eQYYyt+tPrc4s6GitAso4eRVdm7Ueekn wl7YXVAPD5iQw== 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.10.y 4/6] selftests: mptcp: join: check re-adding init endp with != id Date: Mon, 2 Sep 2024 19:25:21 +0200 Message-ID: <20240902172516.3021978-12-matttbe@kernel.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <2024082617-malt-arbitrary-2f17@gregkh> References: <2024082617-malt-arbitrary-2f17@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=UEuQirwcMZ1Nt07SbxFTn7blzZQl63kub0Cvm5WliP8=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBm1fT9OqOcJUf7IRJC8SvlpY6hNi0Uf7MK/vBCs jwCKLTPDMuJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZtX0/QAKCRD2t4JPQmmg cyldEADgkuf/HPnz5urKPXNAzdy+eAQ8zaQV/rcE50cHKTztoAMokl67tD603GkuBpxCxvhwsAs DWMUcpcQuQSS5Crn0aA7XnJZjClPJCAwtxXTkGBLkWexabIkMbsLnPGDzeovXIFVWnWjl49ze4/ qoeknyMqKaHbRRoyCdzhume1w842S90wGa9fELvc1kAchLbI71NVRgzzqH9rUiHDclG6xldozuf /mrJsOF2XnqU3KTcu61LMD3J/W3VcJ0WxAx4wYKc6JLC6TFWJqSqYMJ9NxGKVHMK4jrmRtDSRvS xodedSsuEINYRA6UqOVgLFjj0abdnqeTgJt9yew3zuP27u097rsaoVwljYlsUtJ2WpnaSY+gdu8 Tl2977nioz1ipeg7ph5i9OaicQzP1ce7IRGNn2qfLoK5XAS3W3jDWMt0GehI6acaNn80l4S0P3c YXBmwi3Cy6Mtd2zO8rH2M0v0cMRheXfc86c0teyNOjXMPtNjWwCEZX03zEGloA3wk+Hq5+e1R4T o8O3FLm1dBaaAJMX5atX6PKqAE8TUOlLBqPnwEmTJEbmb/6Wxal+EYZ8eeqmls20F7usXN9Kx4o SYVjAiGzGOSS72xVTjXV6yHgFAuAspDIEFDncdyK7Lbays6umBDzZpnnsJGf8BgIMiVG2tnujgI GVSbwoJsA9iKPFw== 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 64a35f96ff92..965b614e4b16 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -3630,11 +3630,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=$! @@ -3656,11 +3657,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 From patchwork Mon Sep 2 17:25:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 13787558 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 5A8771AB6E8; Mon, 2 Sep 2024 17:25:33 +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=1725297934; cv=none; b=MYRlf2E02yxf9xi3tYuommRvjfoZErJ96I1aNl2TBQ84vP2OXCSUlpahCAq1h6YQG0SuCa3K7clrNfsjblMYC19KUpIId7FisNbQT46NHMmXQo2r10bLuhm0GFTg/ibDlMt6TsmSTIGhGHclmHyYazHOnEVqYenG0ojrQQc3i3U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725297934; c=relaxed/simple; bh=NZIbw2FYveL0QyMGM6tz0H0ji6XZLk8veD1H/rjvdlg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=oeMESCR7AOHZgiGArDuRH9stbGypu8fi5sS42Vd4PYBc11NDG1ht/qE1LIX7qgpulgqNxnH60KGYm/tU8X1oLbzlaZXqEJ1z2WAUD0J44hGnBlgaAca91aHjpASr9YfuD2DnV++aCdFGbn/p2upXiwkNS5QINXP5M9jUmYWCfXY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=CYRBr44I; 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="CYRBr44I" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5E232C4CEC2; Mon, 2 Sep 2024 17:25:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725297933; bh=NZIbw2FYveL0QyMGM6tz0H0ji6XZLk8veD1H/rjvdlg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CYRBr44Icn7zY9QwZ8wLs4gwl+wCuydjQVFj7WCxm1GLKLZlGWWS+7kfIM1gRaQ3P YbDZenmh3/NSmueNH/ZGUnvvy2GNeoz0eWz2WJiDAJd/TGz168ccbFiVAw/ydsXoQe z5MYhKtmejkcOOr+vCa7/dn1mAhogRNDOVHosZ+nNyT9fGLVENhC2Q+hlwQbDg5zym dd+6aVG+JVDvegIkZ3y9S2c+nIrjANGEu1zy+ACrhpyhY1svZ1vS+Fh2VXWVQw+jlI 7aJABfaUPxcUyLdXu3F7COB6gIOUTTp5xebhQQQWbpTmFED5VGq4G6rqtHrKAFMfUV OiwVkr+aLS5Lw== 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.10.y 5/6] selftests: mptcp: join: validate event numbers Date: Mon, 2 Sep 2024 19:25:22 +0200 Message-ID: <20240902172516.3021978-13-matttbe@kernel.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <2024082617-malt-arbitrary-2f17@gregkh> References: <2024082617-malt-arbitrary-2f17@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=6011; i=matttbe@kernel.org; h=from:subject; bh=NZIbw2FYveL0QyMGM6tz0H0ji6XZLk8veD1H/rjvdlg=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBm1fT9uDYq9QjFTig5ytes715Q8CvjBScTbNQW8 ZS2UHcmhRWJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZtX0/QAKCRD2t4JPQmmg c/mtEACvBrEAJgHaZkkoSIbS8OYvSSEoQwtgshl/yCAP2oNX/C9bbTukiNl/GTK0wNJk7S2zPUM fxY8BdAQzw/0uSJnYXSXM+bz0fy+2sZzojvCvJ6m6b6yMkmKXLWFby0Qkiht4cIr1qtfhyLdNnv /l2ygpjdbMvDJMblvz19VRrwmqPR/F0l7pxzPbsDR+GlAUeDyQjOMiYdb0myn3YNsGMRPwdT0JA N7dHmAbuG/W96gAX5Vzm4i7AeDmTYVEsObUDNks8a0jdZKPnVJ8nuQ/WiciSXF8BBXreMBkkShQ CtI7EzMU0Ou5nguF1C8ficgDOTtq16lRrQHGwnvrbxys8TltMYf0Se7UwGoKxrjmRVh/mjamVc5 jgLMZA0b5BTwDxW7nXtF0FL3DhxFU9FCs76tI2S7dtkUNlE85otoIBegT7TF/MyHRaTujE9BB4P mJGxcuq+rURdgLykO57LUySoORnCjuMxF0rc8a4JP5p0qXbTNrGNWrbdL1WNdUtyL9cb441+IR7 VBVF9l1hPhtkGksF/Xoi9q3SwJWVk3z+QWzcjVl3MwU+ZFKplqbKiTWQpId4xYj0/HmMnDuzTvX Wf+4vP3ZZXgpR1lWaeqjnjO8wDtuWZRKZLupJT/N/5pJLOy+mwLFao70G0YyQl8I8tjhTsEKMeZ TsrHP3HHZV7k02Q== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 commit 20ccc7c5f7a3aa48092441a4b182f9f40418392e upstream. This test extends "delete and re-add" and "delete re-add signal" to validate the previous commit: the number of MPTCP events are checked to make sure there are no duplicated or unexpected ones. A new helper has been introduced to easily check these events. The missing events have been added to the lib. 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: b911c97c7dc7 ("mptcp: add netlink event support") 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 | 74 ++++++++++++++++++- .../testing/selftests/net/mptcp/mptcp_lib.sh | 4 + 2 files changed, 75 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index 965b614e4b16..a8ea0fe200fb 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -420,12 +420,17 @@ reset_with_fail() fi } +start_events() +{ + mptcp_lib_events "${ns1}" "${evts_ns1}" evts_ns1_pid + mptcp_lib_events "${ns2}" "${evts_ns2}" evts_ns2_pid +} + reset_with_events() { reset "${1}" || return 1 - mptcp_lib_events "${ns1}" "${evts_ns1}" evts_ns1_pid - mptcp_lib_events "${ns2}" "${evts_ns2}" evts_ns2_pid + start_events } reset_with_tcp_filter() @@ -3333,6 +3338,36 @@ userspace_pm_chk_get_addr() fi } +# $1: ns ; $2: event type ; $3: count +chk_evt_nr() +{ + local ns=${1} + local evt_name="${2}" + local exp="${3}" + + local evts="${evts_ns1}" + local evt="${!evt_name}" + local count + + evt_name="${evt_name:16}" # without MPTCP_LIB_EVENT_ + [ "${ns}" == "ns2" ] && evts="${evts_ns2}" + + print_check "event ${ns} ${evt_name} (${exp})" + + if [[ "${evt_name}" = "LISTENER_"* ]] && + ! mptcp_lib_kallsyms_has "mptcp_event_pm_listener$"; then + print_skip "event not supported" + return + fi + + count=$(grep -cw "type:${evt}" "${evts}") + if [ "${count}" != "${exp}" ]; then + fail_test "got ${count} events, expected ${exp}" + else + print_ok + fi +} + userspace_tests() { # userspace pm type prevents add_addr @@ -3572,6 +3607,7 @@ endpoint_tests() if reset_with_tcp_filter "delete and re-add" ns2 10.0.3.2 REJECT OUTPUT && mptcp_lib_kallsyms_has "subflow_rebuild_header$"; then + start_events pm_nl_set_limits $ns1 0 3 pm_nl_set_limits $ns2 0 3 pm_nl_add_endpoint $ns2 10.0.1.2 id 1 dev ns2eth1 flags subflow @@ -3623,12 +3659,28 @@ endpoint_tests() mptcp_lib_kill_wait $tests_pid + kill_events_pids + chk_evt_nr ns1 MPTCP_LIB_EVENT_LISTENER_CREATED 1 + chk_evt_nr ns1 MPTCP_LIB_EVENT_CREATED 1 + chk_evt_nr ns1 MPTCP_LIB_EVENT_ESTABLISHED 1 + chk_evt_nr ns1 MPTCP_LIB_EVENT_ANNOUNCED 0 + chk_evt_nr ns1 MPTCP_LIB_EVENT_REMOVED 4 + chk_evt_nr ns1 MPTCP_LIB_EVENT_SUB_ESTABLISHED 6 + chk_evt_nr ns1 MPTCP_LIB_EVENT_SUB_CLOSED 4 + + chk_evt_nr ns2 MPTCP_LIB_EVENT_CREATED 1 + chk_evt_nr ns2 MPTCP_LIB_EVENT_ESTABLISHED 1 + chk_evt_nr ns2 MPTCP_LIB_EVENT_ANNOUNCED 0 + chk_evt_nr ns2 MPTCP_LIB_EVENT_REMOVED 0 + chk_evt_nr ns2 MPTCP_LIB_EVENT_SUB_ESTABLISHED 6 + chk_evt_nr ns2 MPTCP_LIB_EVENT_SUB_CLOSED 5 # one has been closed before estab + chk_join_nr 6 6 6 chk_rm_nr 4 4 fi # remove and re-add - if reset "delete re-add signal" && + if reset_with_events "delete re-add signal" && mptcp_lib_kallsyms_has "subflow_rebuild_header$"; then pm_nl_set_limits $ns1 0 3 pm_nl_set_limits $ns2 3 3 @@ -3669,6 +3721,22 @@ endpoint_tests() chk_mptcp_info subflows 3 subflows 3 mptcp_lib_kill_wait $tests_pid + kill_events_pids + chk_evt_nr ns1 MPTCP_LIB_EVENT_LISTENER_CREATED 1 + chk_evt_nr ns1 MPTCP_LIB_EVENT_CREATED 1 + chk_evt_nr ns1 MPTCP_LIB_EVENT_ESTABLISHED 1 + chk_evt_nr ns1 MPTCP_LIB_EVENT_ANNOUNCED 0 + chk_evt_nr ns1 MPTCP_LIB_EVENT_REMOVED 0 + chk_evt_nr ns1 MPTCP_LIB_EVENT_SUB_ESTABLISHED 4 + chk_evt_nr ns1 MPTCP_LIB_EVENT_SUB_CLOSED 2 + + chk_evt_nr ns2 MPTCP_LIB_EVENT_CREATED 1 + chk_evt_nr ns2 MPTCP_LIB_EVENT_ESTABLISHED 1 + chk_evt_nr ns2 MPTCP_LIB_EVENT_ANNOUNCED 5 + chk_evt_nr ns2 MPTCP_LIB_EVENT_REMOVED 3 + chk_evt_nr ns2 MPTCP_LIB_EVENT_SUB_ESTABLISHED 4 + chk_evt_nr ns2 MPTCP_LIB_EVENT_SUB_CLOSED 2 + chk_join_nr 4 4 4 chk_add_nr 5 5 chk_rm_nr 3 2 invert diff --git a/tools/testing/selftests/net/mptcp/mptcp_lib.sh b/tools/testing/selftests/net/mptcp/mptcp_lib.sh index 6ffa9b7a3260..e299090eb042 100644 --- a/tools/testing/selftests/net/mptcp/mptcp_lib.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_lib.sh @@ -9,10 +9,14 @@ readonly KSFT_SKIP=4 readonly KSFT_TEST="${MPTCP_LIB_KSFT_TEST:-$(basename "${0}" .sh)}" # These variables are used in some selftests, read-only +declare -rx MPTCP_LIB_EVENT_CREATED=1 # MPTCP_EVENT_CREATED +declare -rx MPTCP_LIB_EVENT_ESTABLISHED=2 # MPTCP_EVENT_ESTABLISHED +declare -rx MPTCP_LIB_EVENT_CLOSED=3 # MPTCP_EVENT_CLOSED declare -rx MPTCP_LIB_EVENT_ANNOUNCED=6 # MPTCP_EVENT_ANNOUNCED declare -rx MPTCP_LIB_EVENT_REMOVED=7 # MPTCP_EVENT_REMOVED declare -rx MPTCP_LIB_EVENT_SUB_ESTABLISHED=10 # MPTCP_EVENT_SUB_ESTABLISHED declare -rx MPTCP_LIB_EVENT_SUB_CLOSED=11 # MPTCP_EVENT_SUB_CLOSED +declare -rx MPTCP_LIB_EVENT_SUB_PRIORITY=13 # MPTCP_EVENT_SUB_PRIORITY declare -rx MPTCP_LIB_EVENT_LISTENER_CREATED=15 # MPTCP_EVENT_LISTENER_CREATED declare -rx MPTCP_LIB_EVENT_LISTENER_CLOSED=16 # MPTCP_EVENT_LISTENER_CLOSED From patchwork Mon Sep 2 17:25:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 13787559 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 E9E91183CBB; Mon, 2 Sep 2024 17:25:35 +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=1725297936; cv=none; b=YfGV3m/fZyxGoTzWfxX9Z+ciuc2PBXNPAjneqSSxOhd6o3+iQqKzK4ylwjjxtC5vdmiTXfDhCJVQwl9Q59RmNRhI/Mca/OLXeYwp5x4EQ44+1cvMGqWeeSyJKVQXMjXnQutStBJhHQW+lvkhp7YWnImJ9/THAiUz+XfT9ii5XT0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725297936; c=relaxed/simple; bh=i0GO9cmEnkQKQz1YiJmYHXmZrGBPLKjp35I3BqNj7d0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=i0VVa5pVLemsnCgD6p8mI0YQOzIwQUYGu06pmWjxqsSs8Yg4butAKj2rd2KlCvIco/IiNtmd7xdgUYXGHkcELJRtTf6K+gSEMwwPdORAn63WnDP7oXFU1uzHHnW0J0CB2J4jNioy23Pj3UHeT+v3wCc8r0I0f81BxC7vYbcpEcM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=I6lZDSqh; 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="I6lZDSqh" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 55B7FC4CEC8; Mon, 2 Sep 2024 17:25:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725297935; bh=i0GO9cmEnkQKQz1YiJmYHXmZrGBPLKjp35I3BqNj7d0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I6lZDSqhhzeEUZilvoOZr15pMfb0RHSLw14KmjsOuPj7YkN72irqumCYJoia4mfkF 34Xa6zOfk5xKslq7SkrekdHnChuRTnT6tOqcibY9Hvft91/vKjHbaVxq9CsFaliEfL tEa27e5IcmdHDYDXF/V3wSiSZm+6PGkltL0YCyyQ4cnDMEYQxrsEQ3WO/iJB72DKuX kp4H43N74/EGkMoIlTCZL2F1zmB+sYchNjdrjBVKVKe8TVslrQPw7FtIZSB7j1gVTT Q/7sos/4+O6x1GKhyVikpw6HfWM4KIDDlcLcAypl5KKQLXVapjeoECv6AvUVzePtvV J+Zn8q6M8ciNQ== 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.10.y 6/6] selftests: mptcp: join: check re-re-adding ID 0 signal Date: Mon, 2 Sep 2024 19:25:23 +0200 Message-ID: <20240902172516.3021978-14-matttbe@kernel.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <2024082617-malt-arbitrary-2f17@gregkh> References: <2024082617-malt-arbitrary-2f17@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=3347; i=matttbe@kernel.org; h=from:subject; bh=i0GO9cmEnkQKQz1YiJmYHXmZrGBPLKjp35I3BqNj7d0=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBm1fT9DCndlvkCM47XBITNmZf0NJR5VhCedb6X5 Ujbjn1pvBKJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZtX0/QAKCRD2t4JPQmmg c0igEACXtComh9cc/SseE/9t3+50bUDhwTRv7PT5CSmf8gXxIbhTpLaWcg2Ic1KsDjqPIOWwNUs pUawrX2vTnY3oxMRJ7KC0RKaQUnBlGJik3YzNRkFjTQXW5mlTwu1yfl76+IEfZnUgVmmR9UOyDw C7A4K973Bd8CLpJCA6YNfFUYajJbUHShIjp01wjvf51gAUXTl5gEAdtIF9uIT9hFfp52tVagIYs MHy11ivDYzaKaTHRRq88Gwrz1njcQ2EL/Xzaz1SBD7LWwnCx+mwIZni3asOlloPsJ6dUeGPnmUZ VdDjrdfmkg7bvHHwER3fQId+lRmS58eylp7u+Tb5fiQ7UzU6sMnwslJxrXdo6axRLhCQLSfW/QL /59r0wsRwyIRWxZpq2pX22VpGN+DWVNyJkakU+YFcLN89aqHEfAkWCnzdqQiijSPCrTzC0E/nwo XLQl3/Colh3Ndrucmw6+Ax+kEqKo5L/FS+W4ZnKxsa9qihMp90AblcpaTc9DeYl0Al2T88qzfsj 1W+vvyY67/K0CL6fJI6hG9nwgA1YExoge4Olz4fiWSa+fGM2k63ZUZjm7v/TVMyBhpmLmLzqyxh LJ8oYXOXTNtqY42xjCSsDF1U/0LBjE5hLc0fyd5h9HYiTsICa2S5LH2BK/YkzARawg/mzbuCeJJ 7vVb8b4eWz9DtXw== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 commit f18fa2abf81099d822d842a107f8c9889c86043c upstream. This test extends "delete re-add signal" to validate the previous commit: when the 'signal' endpoint linked to the initial subflow (ID 0) is re-added multiple times, it will re-send the ADD_ADDR with id 0. The client should still be able to re-create this subflow, even if the add_addr_accepted limit has been reached as this special address is not considered as a new address. 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: d0876b2284cf ("mptcp: add the incoming RM_ADDR support") 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 | 32 ++++++++++++------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index a8ea0fe200fb..a4762c49a878 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -3688,7 +3688,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=4 speed=20 \ + test_linkfail=4 speed=5 \ run_tests $ns1 $ns2 10.0.1.1 & local tests_pid=$! @@ -3717,7 +3717,17 @@ endpoint_tests() pm_nl_add_endpoint $ns1 10.0.1.1 id 99 flags signal wait_mpj $ns2 - chk_subflow_nr "after re-add" 3 + chk_subflow_nr "after re-add ID 0" 3 + chk_mptcp_info subflows 3 subflows 3 + + pm_nl_del_endpoint $ns1 99 10.0.1.1 + sleep 0.5 + chk_subflow_nr "after re-delete ID 0" 2 + chk_mptcp_info subflows 2 subflows 2 + + pm_nl_add_endpoint $ns1 10.0.1.1 id 88 flags signal + wait_mpj $ns2 + chk_subflow_nr "after re-re-add ID 0" 3 chk_mptcp_info subflows 3 subflows 3 mptcp_lib_kill_wait $tests_pid @@ -3727,19 +3737,19 @@ endpoint_tests() chk_evt_nr ns1 MPTCP_LIB_EVENT_ESTABLISHED 1 chk_evt_nr ns1 MPTCP_LIB_EVENT_ANNOUNCED 0 chk_evt_nr ns1 MPTCP_LIB_EVENT_REMOVED 0 - chk_evt_nr ns1 MPTCP_LIB_EVENT_SUB_ESTABLISHED 4 - chk_evt_nr ns1 MPTCP_LIB_EVENT_SUB_CLOSED 2 + chk_evt_nr ns1 MPTCP_LIB_EVENT_SUB_ESTABLISHED 5 + chk_evt_nr ns1 MPTCP_LIB_EVENT_SUB_CLOSED 3 chk_evt_nr ns2 MPTCP_LIB_EVENT_CREATED 1 chk_evt_nr ns2 MPTCP_LIB_EVENT_ESTABLISHED 1 - chk_evt_nr ns2 MPTCP_LIB_EVENT_ANNOUNCED 5 - chk_evt_nr ns2 MPTCP_LIB_EVENT_REMOVED 3 - chk_evt_nr ns2 MPTCP_LIB_EVENT_SUB_ESTABLISHED 4 - chk_evt_nr ns2 MPTCP_LIB_EVENT_SUB_CLOSED 2 + chk_evt_nr ns2 MPTCP_LIB_EVENT_ANNOUNCED 6 + chk_evt_nr ns2 MPTCP_LIB_EVENT_REMOVED 4 + chk_evt_nr ns2 MPTCP_LIB_EVENT_SUB_ESTABLISHED 5 + chk_evt_nr ns2 MPTCP_LIB_EVENT_SUB_CLOSED 3 - chk_join_nr 4 4 4 - chk_add_nr 5 5 - chk_rm_nr 3 2 invert + chk_join_nr 5 5 5 + chk_add_nr 6 6 + chk_rm_nr 4 3 invert fi # flush and re-add