From patchwork Fri Oct 27 22:57:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mat Martineau X-Patchwork-Id: 13439274 X-Patchwork-Delegate: mat@martineau.name 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 A007641239; Fri, 27 Oct 2023 22:57:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="N5MU65a2" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 01804C433CB; Fri, 27 Oct 2023 22:57:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698447441; bh=sdH8xmk4MXjKYREeXMVQSHlX4S7XdC6spelvmax2HHI=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=N5MU65a2nJmUAvmCiqb/N+v2x4v1Cz6vxW/5YTuKt7Yt5Pgjz9bhN3kkNcpuTHICF +xM8O3KJ4YSYtHqN0KSTflmuUqUMoP4jWMWQA2khzKm+/zJjecdGJMb8FjFZAbrmfp rXPTatTTDI6f6rD7It+E7lcC+RMfEmAfrMJ9RMGIJr/ibXwRImKD7P1X3CzuftRtig G+Zhr6JITTnA/KwBVLufPFNmOFBMtWtiBm9I3PQM4iKGmPyC43E7MTgwgLQN40NVlg iaENkYdbW9OUAeN17e7E5bdmJj59S+rIhhDX5iUHAGnH31JI4CvdHh//l/QQL7yIjf Vyy+B4S1mDKFA== From: Mat Martineau Date: Fri, 27 Oct 2023 15:57:09 -0700 Subject: [PATCH net-next 08/15] selftests: mptcp: userspace pm send RM_ADDR for ID 0 Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20231027-send-net-next-2023107-v1-8-03eff9452957@kernel.org> References: <20231027-send-net-next-2023107-v1-0-03eff9452957@kernel.org> In-Reply-To: <20231027-send-net-next-2023107-v1-0-03eff9452957@kernel.org> To: Matthieu Baerts , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: netdev@vger.kernel.org, mptcp@lists.linux.dev, Mat Martineau , Geliang Tang X-Mailer: b4 0.12.4 From: Geliang Tang This patch adds a selftest for userspace PM to remove id 0 address. Use userspace_pm_add_addr() helper to add an id 10 address, then use userspace_pm_rm_addr() helper to remove id 0 address. Reviewed-by: Matthieu Baerts Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau --- tools/testing/selftests/net/mptcp/mptcp_join.sh | 26 +++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index 68fb7aa12fef..a2b58cf71bef 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -3537,6 +3537,32 @@ userspace_tests() kill_events_pids wait $tests_pid fi + + # userspace pm send RM_ADDR for ID 0 + if reset_with_events "userspace pm send RM_ADDR for ID 0" && + 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=5 \ + run_tests $ns1 $ns2 10.0.1.1 & + local tests_pid=$! + wait_mpj $ns1 + userspace_pm_add_addr $ns1 10.0.2.1 10 + chk_join_nr 1 1 1 + chk_add_nr 1 1 + chk_mptcp_info subflows 1 subflows 1 + chk_subflows_total 2 2 + chk_mptcp_info add_addr_signal 1 add_addr_accepted 1 + userspace_pm_rm_addr $ns1 0 + # we don't look at the counter linked to the subflows that + # have been removed but to the one linked to the RM_ADDR + chk_rm_nr 1 0 invert + chk_rst_nr 0 0 invert + chk_mptcp_info subflows 1 subflows 1 + chk_subflows_total 1 1 + kill_events_pids + wait $tests_pid + fi } endpoint_tests()