From patchwork Wed Oct 25 23:37:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mat Martineau X-Patchwork-Id: 13436951 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 F097737CBC; Wed, 25 Oct 2023 23:37:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="cmbo5JNV" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3E8BBC433CD; Wed, 25 Oct 2023 23:37:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698277032; bh=0Di+LDA6poLyY50CFcEryH1kp7/yqPYEEUiE9SfuaPc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=cmbo5JNVyaW/IMkAJa+6RusWM9N0ru0TCxXGI+DfwBfaUeDWIqPtCaQ+myJYogy00 trgxp8HObXoAnejNNNj8yJwkkfRhJHmicOTWKVw8zCE61wB9bLh3FRaDmhdqUd1Y5m orjbra2cApx+QiL/QZ3sjZ+o9PB67t2vPklVDGUUVQHH03/fpPRKgNSe52yMFss6CU N1TbX3RqI9GYFPdjo4zf1HQ6hV/CoyM52IkUxbt+uw9igQvOGofk+A84l1pbMLzsWy ehHjHxBfzUnVpH8j91FTv7oIo9Q5nwPa7n5rvLrnnviLpxOYV8mnyCQnz+z/ut8QoG YhoGM5VZvkZKw== From: Mat Martineau Date: Wed, 25 Oct 2023 16:37:02 -0700 Subject: [PATCH net-next 01/10] selftests: mptcp: run userspace pm tests slower Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20231025-send-net-next-20231025-v1-1-db8f25f798eb@kernel.org> References: <20231025-send-net-next-20231025-v1-0-db8f25f798eb@kernel.org> In-Reply-To: <20231025-send-net-next-20231025-v1-0-db8f25f798eb@kernel.org> To: Matthieu Baerts , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Geliang Tang , Kishen Maloor Cc: netdev@vger.kernel.org, mptcp@lists.linux.dev, Mat Martineau , stable@vger.kernel.org X-Mailer: b4 0.12.4 From: Geliang Tang Some userspace pm tests failed are reported by CI: 112 userspace pm add & remove address syn [ ok ] synack [ ok ] ack [ ok ] add [ ok ] echo [ ok ] mptcp_info subflows=1:1 [ ok ] subflows_total 2:2 [ ok ] mptcp_info add_addr_signal=1:1 [ ok ] rm [ ok ] rmsf [ ok ] Info: invert mptcp_info subflows=0:0 [ ok ] subflows_total 1:1 [fail] got subflows 0:0 expected 1:1 Server ns stats TcpPassiveOpens 2 0.0 TcpInSegs 118 0.0 This patch fixes them by changing 'speed' to 5 to run the tests much more slowly. Fixes: 4369c198e599 ("selftests: mptcp: test userspace pm out of transfer") Cc: stable@vger.kernel.org Reviewed-by: Matthieu Baerts Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau --- tools/testing/selftests/net/mptcp/mptcp_join.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index dc895b7b94e1..edc569bab4b8 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -3417,7 +3417,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=10 \ + speed=5 \ run_tests $ns1 $ns2 10.0.1.1 & local tests_pid=$! wait_mpj $ns1 @@ -3438,7 +3438,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=10 \ + speed=5 \ run_tests $ns1 $ns2 10.0.1.1 & local tests_pid=$! wait_mpj $ns2 From patchwork Wed Oct 25 23:37:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mat Martineau X-Patchwork-Id: 13436952 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 32A86381A8; Wed, 25 Oct 2023 23:37:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Sc2Y6oJJ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 79CF9C43395; Wed, 25 Oct 2023 23:37:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698277032; bh=oWhq8MDM3cTZAxpiFQKriinw5wYjuNCtFlUpEjC9Uyo=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Sc2Y6oJJ0/ZX36ftASStFjvoiI+/oBiksikRUXfbpAXyiCPtlvUs204jbwGpob+1P ntnbDWykcMzJfw4yQLDegNeLy2qghX7aCQpaqXYmci9trW5SGZ24eOVuryZCafk9R4 GuMCOV5qeWw6HvF+X76cyfFhvgk9Iu8DHdxsDTQ7em0pfKkkz+ToRl2BjKk/Vi62KR yj56DYryYbOw3/6ewgz88ZzNtfcLpTI0qBD4jckGXfeDlqiOdIQ/PZZtrPkmjYuu9K hxWSpLf616g/K/QsAP/RUxWZQqE2xD9itTMBi7L4L3OlEOH3A+wVo3KSjR5Kbe5Lda Cq6IHaPiWqxKg== From: Mat Martineau Date: Wed, 25 Oct 2023 16:37:03 -0700 Subject: [PATCH net-next 02/10] selftests: mptcp: fix wait_rm_addr/sf parameters Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20231025-send-net-next-20231025-v1-2-db8f25f798eb@kernel.org> References: <20231025-send-net-next-20231025-v1-0-db8f25f798eb@kernel.org> In-Reply-To: <20231025-send-net-next-20231025-v1-0-db8f25f798eb@kernel.org> To: Matthieu Baerts , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Geliang Tang , Kishen Maloor Cc: netdev@vger.kernel.org, mptcp@lists.linux.dev, Mat Martineau , stable@vger.kernel.org X-Mailer: b4 0.12.4 From: Geliang Tang The second input parameter of 'wait_rm_addr/sf $1 1' is misused. If it's 1, wait_rm_addr/sf will never break, and will loop ten times, then 'wait_rm_addr/sf' equals to 'sleep 1'. This delay time is too long, which can sometimes make the tests fail. A better way to use wait_rm_addr/sf is to use rm_addr/sf_count to obtain the current value, and then pass into wait_rm_addr/sf. Fixes: 4369c198e599 ("selftests: mptcp: test userspace pm out of transfer") Cc: stable@vger.kernel.org Suggested-by: Matthieu Baerts Reviewed-by: Matthieu Baerts Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau --- tools/testing/selftests/net/mptcp/mptcp_join.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index edc569bab4b8..5917a74b749d 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -3289,6 +3289,7 @@ userspace_pm_rm_sf_addr_ns1() local addr=$1 local id=$2 local tk sp da dp + local cnt_addr cnt_sf tk=$(grep "type:1," "$evts_ns1" | sed -n 's/.*\(token:\)\([[:digit:]]*\).*$/\2/p;q') @@ -3298,11 +3299,13 @@ userspace_pm_rm_sf_addr_ns1() sed -n 's/.*\(daddr6:\)\([0-9a-f:.]*\).*$/\2/p;q') dp=$(grep "type:10" "$evts_ns1" | sed -n 's/.*\(dport:\)\([[:digit:]]*\).*$/\2/p;q') + cnt_addr=$(rm_addr_count ${ns1}) + cnt_sf=$(rm_sf_count ${ns1}) ip netns exec $ns1 ./pm_nl_ctl rem token $tk id $id ip netns exec $ns1 ./pm_nl_ctl dsf lip "::ffff:$addr" \ lport $sp rip $da rport $dp token $tk - wait_rm_addr $ns1 1 - wait_rm_sf $ns1 1 + wait_rm_addr $ns1 "${cnt_addr}" + wait_rm_sf $ns1 "${cnt_sf}" } userspace_pm_add_sf() @@ -3324,17 +3327,20 @@ userspace_pm_rm_sf_addr_ns2() local addr=$1 local id=$2 local tk da dp sp + local cnt_addr cnt_sf tk=$(sed -n 's/.*\(token:\)\([[:digit:]]*\).*$/\2/p;q' "$evts_ns2") da=$(sed -n 's/.*\(daddr4:\)\([0-9.]*\).*$/\2/p;q' "$evts_ns2") dp=$(sed -n 's/.*\(dport:\)\([[:digit:]]*\).*$/\2/p;q' "$evts_ns2") sp=$(grep "type:10" "$evts_ns2" | sed -n 's/.*\(sport:\)\([[:digit:]]*\).*$/\2/p;q') + cnt_addr=$(rm_addr_count ${ns2}) + cnt_sf=$(rm_sf_count ${ns2}) ip netns exec $ns2 ./pm_nl_ctl rem token $tk id $id ip netns exec $ns2 ./pm_nl_ctl dsf lip $addr lport $sp \ rip $da rport $dp token $tk - wait_rm_addr $ns2 1 - wait_rm_sf $ns2 1 + wait_rm_addr $ns2 "${cnt_addr}" + wait_rm_sf $ns2 "${cnt_sf}" } userspace_tests() From patchwork Wed Oct 25 23:37:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mat Martineau X-Patchwork-Id: 13436953 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 52A60381AD; Wed, 25 Oct 2023 23:37:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="i26CsGYC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BA49EC433B9; Wed, 25 Oct 2023 23:37:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698277032; bh=GyNOg92sM3p0ShPkfaGKDtFNcD8NFmdnpi3MEJceRfk=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=i26CsGYCgYdBKFtgsah5O2+wzT/iEI/7yNx9bC1bXOTLlEHi3xsQ2QErM28QtOsx1 SFiMhissGcWr1b5NNTlbLel7kvxXIsJttmD5dkZoRaykTtNV0Imwl5wBJey5WEZ0AO B0VfGHaWj0FRcg0HxQr8rYG+5ou/knGgtDy7xzfELIPy7YRSfa0AM57Ud5xqxq3uqT kWSo9A8TE6TOGNkedqJkjmXUIl0e9Q88WKHEP672Tg+XWWTfsyUa7yb+H0S5qwdBx2 XTvbrmRIsUNF+R1gEctEI3jfhAWeWgZM9/Y2xbsyK6X2g3Yx85L28NEB+65/dk3bCk opar4hKmoirFQ== From: Mat Martineau Date: Wed, 25 Oct 2023 16:37:04 -0700 Subject: [PATCH net-next 03/10] 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: <20231025-send-net-next-20231025-v1-3-db8f25f798eb@kernel.org> References: <20231025-send-net-next-20231025-v1-0-db8f25f798eb@kernel.org> In-Reply-To: <20231025-send-net-next-20231025-v1-0-db8f25f798eb@kernel.org> To: Matthieu Baerts , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Geliang Tang , Kishen Maloor Cc: netdev@vger.kernel.org, mptcp@lists.linux.dev, Mat Martineau , stable@vger.kernel.org X-Mailer: b4 0.12.4 From: Geliang Tang This patch adds the ability to send RM_ADDR for local ID 0. Check whether id 0 address is removed, if not, put id 0 into a removing list, pass it to mptcp_pm_remove_addr() to remove id 0 address. There is no reason not to allow the userspace to remove the initial address (ID 0). This special case was not taken into account not letting the userspace to delete all addresses as announced. Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/379 Fixes: d9a4594edabf ("mptcp: netlink: Add MPTCP_PM_CMD_REMOVE") Cc: stable@vger.kernel.org Reviewed-by: Matthieu Baerts Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau --- net/mptcp/pm_userspace.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/net/mptcp/pm_userspace.c b/net/mptcp/pm_userspace.c index 0f92e5b13a8a..25fa37ac3620 100644 --- a/net/mptcp/pm_userspace.c +++ b/net/mptcp/pm_userspace.c @@ -208,6 +208,40 @@ int mptcp_pm_nl_announce_doit(struct sk_buff *skb, struct genl_info *info) return err; } +static int mptcp_userspace_pm_remove_id_zero_address(struct mptcp_sock *msk, + struct genl_info *info) +{ + struct mptcp_rm_list list = { .nr = 0 }; + struct mptcp_subflow_context *subflow; + struct sock *sk = (struct sock *)msk; + bool has_id_0 = false; + int err = -EINVAL; + + lock_sock(sk); + mptcp_for_each_subflow(msk, subflow) { + if (subflow->local_id == 0) { + has_id_0 = true; + break; + } + } + if (!has_id_0) { + GENL_SET_ERR_MSG(info, "address with id 0 not found"); + goto remove_err; + } + + list.ids[list.nr++] = 0; + + spin_lock_bh(&msk->pm.lock); + mptcp_pm_remove_addr(msk, &list); + spin_unlock_bh(&msk->pm.lock); + + err = 0; + +remove_err: + release_sock(sk); + return err; +} + int mptcp_pm_nl_remove_doit(struct sk_buff *skb, struct genl_info *info) { struct nlattr *token = info->attrs[MPTCP_PM_ATTR_TOKEN]; @@ -239,6 +273,11 @@ int mptcp_pm_nl_remove_doit(struct sk_buff *skb, struct genl_info *info) goto remove_err; } + if (id_val == 0) { + err = mptcp_userspace_pm_remove_id_zero_address(msk, info); + goto remove_err; + } + lock_sock((struct sock *)msk); list_for_each_entry(entry, &msk->pm.userspace_pm_local_addr_list, list) { From patchwork Wed Oct 25 23:37:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mat Martineau X-Patchwork-Id: 13436955 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 8FDF7381BA; Wed, 25 Oct 2023 23:37:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="GSYmxu9o" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F3B01C433BD; Wed, 25 Oct 2023 23:37:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698277033; bh=iHTW92DQYzrFSdt6z90d4EIwPhRKgXAhTgEPt3iGoqI=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=GSYmxu9oSs1sV+fYywY1t/o1O6SyqSIgi5WzfFTfQfvzT2NwC5Yc1i0DmW2OmQ73L 8FvYyqhW1qCRv2darmBmwYRv37wkhs7pGDFQ6udfM2YE8dMMEQumTGyH0zdErf/JEY KzLHAVCyw4WwQvkhRkzPz+tOpR9XrOc70/izG1+wt98VO0JvpEU7lqsFSNfeI3dCbu XLWRK1nlVrJ3JVzBfFTT/WoEqwm9/dzzpVcUqfoNkrfW8nuklLj6al9MpcMHgna9HC +hebTEQxTo9iS+XQXO7q3gjFpFyz9WoDMR1rAEnvFq1eOygrslAuzhVCLSmseYTsGK vv/U25tzMxTxw== From: Mat Martineau Date: Wed, 25 Oct 2023 16:37:05 -0700 Subject: [PATCH net-next 04/10] mptcp: drop useless ssk in pm_subflow_check_next Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20231025-send-net-next-20231025-v1-4-db8f25f798eb@kernel.org> References: <20231025-send-net-next-20231025-v1-0-db8f25f798eb@kernel.org> In-Reply-To: <20231025-send-net-next-20231025-v1-0-db8f25f798eb@kernel.org> To: Matthieu Baerts , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Geliang Tang , Kishen Maloor Cc: netdev@vger.kernel.org, mptcp@lists.linux.dev, Mat Martineau X-Mailer: b4 0.12.4 From: Geliang Tang The code using 'ssk' parameter of mptcp_pm_subflow_check_next() has been dropped in commit "95d686517884 (mptcp: fix subflow accounting on close)". So drop this useless parameter ssk. Reviewed-by: Matthieu Baerts Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau --- net/mptcp/pm.c | 2 +- net/mptcp/protocol.c | 2 +- net/mptcp/protocol.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c index d8da5374d9e1..4ae19113b8eb 100644 --- a/net/mptcp/pm.c +++ b/net/mptcp/pm.c @@ -184,7 +184,7 @@ void mptcp_pm_subflow_established(struct mptcp_sock *msk) spin_unlock_bh(&pm->lock); } -void mptcp_pm_subflow_check_next(struct mptcp_sock *msk, const struct sock *ssk, +void mptcp_pm_subflow_check_next(struct mptcp_sock *msk, const struct mptcp_subflow_context *subflow) { struct mptcp_pm_data *pm = &msk->pm; diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index 1dacc072dcca..a29116eda30a 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -2490,7 +2490,7 @@ void mptcp_close_ssk(struct sock *sk, struct sock *ssk, /* subflow aborted before reaching the fully_established status * attempt the creation of the next subflow */ - mptcp_pm_subflow_check_next(mptcp_sk(sk), ssk, subflow); + mptcp_pm_subflow_check_next(mptcp_sk(sk), subflow); __mptcp_close_ssk(sk, ssk, subflow, MPTCP_CF_PUSH); } diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h index 9092fcf18798..a5322074353b 100644 --- a/net/mptcp/protocol.h +++ b/net/mptcp/protocol.h @@ -888,7 +888,7 @@ bool mptcp_pm_allow_new_subflow(struct mptcp_sock *msk); void mptcp_pm_connection_closed(struct mptcp_sock *msk); void mptcp_pm_subflow_established(struct mptcp_sock *msk); bool mptcp_pm_nl_check_work_pending(struct mptcp_sock *msk); -void mptcp_pm_subflow_check_next(struct mptcp_sock *msk, const struct sock *ssk, +void mptcp_pm_subflow_check_next(struct mptcp_sock *msk, const struct mptcp_subflow_context *subflow); void mptcp_pm_add_addr_received(const struct sock *ssk, const struct mptcp_addr_info *addr); From patchwork Wed Oct 25 23:37:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mat Martineau X-Patchwork-Id: 13436954 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 7664D381B4; Wed, 25 Oct 2023 23:37:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Cq6Yj4F/" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3AB99C4166B; Wed, 25 Oct 2023 23:37:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698277033; bh=IgjebdIFVSu5Y4tpT4Iv0onAf3HAZuKQBub99pp6y2U=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Cq6Yj4F/Ko3JT/7/LkRqQvb4iJluhN1mukm+Gs5MNpdEsNWgtg3k9razrHhsK/+FK ogwGextNuagLg2ixZ5ZdipZYO+3WWT/pu9khWdeSGymgJH3lGT8dWVgJVx1y/q8FBH 33SeCkTwaYNUREO9Hw7tF5z3HXexpooPtQuYvsJEFO/B/6GI3CmLwOujOx+ocEchC1 1RF6UIUg+dzJXhL8/xJR8vfbHzqpC5GeqUbAWL9JIRdKSKbjullVZ9sEC6/04k1nwM 6v47MqwVR8B9pgSxmhSR/Pu0ZuJvqJQTRYptGfOWX3IdnqWfaILUK5tF7ayhk2RAYW V52cpzklXiqVw== From: Mat Martineau Date: Wed, 25 Oct 2023 16:37:06 -0700 Subject: [PATCH net-next 05/10] mptcp: use mptcp_check_fallback helper Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20231025-send-net-next-20231025-v1-5-db8f25f798eb@kernel.org> References: <20231025-send-net-next-20231025-v1-0-db8f25f798eb@kernel.org> In-Reply-To: <20231025-send-net-next-20231025-v1-0-db8f25f798eb@kernel.org> To: Matthieu Baerts , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Geliang Tang , Kishen Maloor Cc: netdev@vger.kernel.org, mptcp@lists.linux.dev, Mat Martineau X-Mailer: b4 0.12.4 From: Geliang Tang Use __mptcp_check_fallback() helper defined in net/mptcp/protocol.h, instead of open-coding it in both __mptcp_do_fallback() and mptcp_diag_fill_info(). Reviewed-by: Matthieu Baerts Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau --- net/mptcp/protocol.h | 2 +- net/mptcp/sockopt.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h index a5322074353b..fe6f2d399ee8 100644 --- a/net/mptcp/protocol.h +++ b/net/mptcp/protocol.h @@ -1065,7 +1065,7 @@ static inline bool mptcp_check_fallback(const struct sock *sk) static inline void __mptcp_do_fallback(struct mptcp_sock *msk) { - if (test_bit(MPTCP_FALLBACK_DONE, &msk->flags)) { + if (__mptcp_check_fallback(msk)) { pr_debug("TCP fallback already done (msk=%p)", msk); return; } diff --git a/net/mptcp/sockopt.c b/net/mptcp/sockopt.c index 574e221bb765..77f5e8932abf 100644 --- a/net/mptcp/sockopt.c +++ b/net/mptcp/sockopt.c @@ -916,7 +916,7 @@ void mptcp_diag_fill_info(struct mptcp_sock *msk, struct mptcp_info *info) mptcp_pm_get_local_addr_max(msk); } - if (test_bit(MPTCP_FALLBACK_DONE, &msk->flags)) + if (__mptcp_check_fallback(msk)) flags |= MPTCP_INFO_FLAG_FALLBACK; if (READ_ONCE(msk->can_ack)) flags |= MPTCP_INFO_FLAG_REMOTE_KEY_RECEIVED; From patchwork Wed Oct 25 23:37:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mat Martineau X-Patchwork-Id: 13436956 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 B930A381C9; Wed, 25 Oct 2023 23:37:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="NfnDFh29" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7242AC433D9; Wed, 25 Oct 2023 23:37:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698277033; bh=14cp60kxcA5TVRPTGt8VB60tSh4oksh/vqRJXjj+jbY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=NfnDFh29/lHX0BPfEhKUwJ8adq4UjmBRIPZoOGX+f10umDk+V+XzRX0VWGLRII3d4 k6qrOWSUkZx3pssac70sGtp4/QufTYZgmJ7UQemm9zeOwizX5kFD97dmq6u7U4ieHJ E6vu/1m3WcmRCshN9NybAY9veSUEg14td2Nc8pHeuGkOc+bQnXq0NylUbVLKfJe+Go 5ZwMueWKXFBVjGFhlclYCOQUoxIQQx+wXE8uk++HUGykNazA0y8GuYgjV0DfkSqOHJ Cxt19Psl4i/ukk86QRSaLGQ4gCnmjb1Q869Brk02uq6OpSkPNfCjpdo613++uvnEvC H9971ptOop2jQ== From: Mat Martineau Date: Wed, 25 Oct 2023 16:37:07 -0700 Subject: [PATCH net-next 06/10] mptcp: use mptcp_get_ext helper Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20231025-send-net-next-20231025-v1-6-db8f25f798eb@kernel.org> References: <20231025-send-net-next-20231025-v1-0-db8f25f798eb@kernel.org> In-Reply-To: <20231025-send-net-next-20231025-v1-0-db8f25f798eb@kernel.org> To: Matthieu Baerts , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Geliang Tang , Kishen Maloor Cc: netdev@vger.kernel.org, mptcp@lists.linux.dev, Mat Martineau X-Mailer: b4 0.12.4 From: Geliang Tang Use mptcp_get_ext() helper defined in protocol.h instead of open-coding it in mptcp_sendmsg_frag(). Reviewed-by: Matthieu Baerts Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau --- net/mptcp/protocol.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index a29116eda30a..a0b8356cd8c5 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -1267,7 +1267,7 @@ static int mptcp_sendmsg_frag(struct sock *sk, struct sock *ssk, * queue management operation, to avoid breaking the ext <-> * SSN association set here */ - mpext = skb_ext_find(skb, SKB_EXT_MPTCP); + mpext = mptcp_get_ext(skb); if (!mptcp_skb_can_collapse_to(data_seq, skb, mpext)) { TCP_SKB_CB(skb)->eor = 1; goto alloc_skb; @@ -1289,7 +1289,7 @@ static int mptcp_sendmsg_frag(struct sock *sk, struct sock *ssk, i = skb_shinfo(skb)->nr_frags; reuse_skb = false; - mpext = skb_ext_find(skb, SKB_EXT_MPTCP); + mpext = mptcp_get_ext(skb); } /* Zero window and all data acked? Probe. */ From patchwork Wed Oct 25 23:37:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mat Martineau X-Patchwork-Id: 13436957 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 04567381D5; Wed, 25 Oct 2023 23:37:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="TEQwBWiv" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A8E61C4339A; Wed, 25 Oct 2023 23:37:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698277033; bh=nH9eSRyr97sQBl762zJNIzDebdiVrUxjMr2kzANZ30Q=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=TEQwBWiv3PqdP6EucXStiNrBQBPq5C0GLm1tMMjh/06ed4iiLN/zC4qxMEKf17HQV UnHa9bqhig2LYDlUXIwQuRosMhvkKQonDA3B2D0ZhiLV6WIV5zyDq7rZwdbnt2k8q7 Wak+Zz/zOwd02R5sq4fX4IroqW6OIr+Zql9lrpn/q4eEaPGWFh5P/9UAU5mavOQRvT P/9b6pV5FTj0GL6Hih2zzBRUNYiGklKPcEcXoVcHjt8Tp4ojcKQ99do6nUHGkBHbO7 cUv00xLM/c9Pin0yD/kVYuclK7utG3Nvkwgz8b4qaUYtJWF5PUc7Q8L3wzzwZvqRBE Er84urt2PUR0Q== From: Mat Martineau Date: Wed, 25 Oct 2023 16:37:08 -0700 Subject: [PATCH net-next 07/10] mptcp: move sk assignment statement ahead Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20231025-send-net-next-20231025-v1-7-db8f25f798eb@kernel.org> References: <20231025-send-net-next-20231025-v1-0-db8f25f798eb@kernel.org> In-Reply-To: <20231025-send-net-next-20231025-v1-0-db8f25f798eb@kernel.org> To: Matthieu Baerts , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Geliang Tang , Kishen Maloor Cc: netdev@vger.kernel.org, mptcp@lists.linux.dev, Mat Martineau X-Mailer: b4 0.12.4 From: Geliang Tang If we move the sk assignment statement ahead in mptcp_nl_cmd_sf_create() or mptcp_nl_cmd_sf_destroy(), right after the msk null-check statements, sk can be used after the create_err or destroy_err labels instead of open-coding it again. Reviewed-by: Matthieu Baerts Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau --- net/mptcp/pm_userspace.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/net/mptcp/pm_userspace.c b/net/mptcp/pm_userspace.c index 25fa37ac3620..7bb2b29e5b96 100644 --- a/net/mptcp/pm_userspace.c +++ b/net/mptcp/pm_userspace.c @@ -335,6 +335,8 @@ int mptcp_pm_nl_subflow_create_doit(struct sk_buff *skb, struct genl_info *info) return err; } + sk = (struct sock *)msk; + if (!mptcp_pm_is_userspace(msk)) { GENL_SET_ERR_MSG(info, "invalid request; userspace PM not selected"); goto create_err; @@ -352,8 +354,6 @@ int mptcp_pm_nl_subflow_create_doit(struct sk_buff *skb, struct genl_info *info) goto create_err; } - sk = (struct sock *)msk; - if (!mptcp_pm_addr_families_match(sk, &addr_l, &addr_r)) { GENL_SET_ERR_MSG(info, "families mismatch"); err = -EINVAL; @@ -381,7 +381,7 @@ int mptcp_pm_nl_subflow_create_doit(struct sk_buff *skb, struct genl_info *info) spin_unlock_bh(&msk->pm.lock); create_err: - sock_put((struct sock *)msk); + sock_put(sk); return err; } @@ -458,6 +458,8 @@ int mptcp_pm_nl_subflow_destroy_doit(struct sk_buff *skb, struct genl_info *info return err; } + sk = (struct sock *)msk; + if (!mptcp_pm_is_userspace(msk)) { GENL_SET_ERR_MSG(info, "invalid request; userspace PM not selected"); goto destroy_err; @@ -487,7 +489,6 @@ int mptcp_pm_nl_subflow_destroy_doit(struct sk_buff *skb, struct genl_info *info goto destroy_err; } - sk = (struct sock *)msk; lock_sock(sk); ssk = mptcp_nl_find_ssk(msk, &addr_l, &addr_r); if (ssk) { @@ -507,7 +508,7 @@ int mptcp_pm_nl_subflow_destroy_doit(struct sk_buff *skb, struct genl_info *info release_sock(sk); destroy_err: - sock_put((struct sock *)msk); + sock_put(sk); return err; } From patchwork Wed Oct 25 23:37: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: 13436958 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 941A438F83; Wed, 25 Oct 2023 23:37:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="bLmFDtEW" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E1951C433C9; Wed, 25 Oct 2023 23:37:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698277034; bh=x0HBeQb2k3AZMmRAEAWGa+ksnu67qnn8G3b35KG4pEI=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=bLmFDtEWgY3z4+mF12hT7+gdzbuFfMYTV/a6QY0WQTqUHN4EVmTXkQU4FWtksAhsN 29VMBNC4jpgirlQQVC8Jrfi8V6fOdI/muwLWh+Bx0xZio4EAt7Zz05QoCn9QPrYASc FdSePWXdP5ILqqV8pm3gg/Da44hU/PuHYPBg8GT2ZnpdkrIlH64l8anVg796iT/LKp kNp0TQAd1i8lRh6qZ6rk1mXc2QK+gCTEaBzoEcIRares/Nx0WcK7X97iWLUSKGQne3 +XUwrGR2ACS/onJgOXizzWlxShfpZzKouGSrytv52PcdETsKnkUC66LsaUIJVD5HVe 5LLlLOpReA7jQ== From: Mat Martineau Date: Wed, 25 Oct 2023 16:37:09 -0700 Subject: [PATCH net-next 08/10] mptcp: define more local variables sk Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20231025-send-net-next-20231025-v1-8-db8f25f798eb@kernel.org> References: <20231025-send-net-next-20231025-v1-0-db8f25f798eb@kernel.org> In-Reply-To: <20231025-send-net-next-20231025-v1-0-db8f25f798eb@kernel.org> To: Matthieu Baerts , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Geliang Tang , Kishen Maloor Cc: netdev@vger.kernel.org, mptcp@lists.linux.dev, Mat Martineau X-Mailer: b4 0.12.4 From: Geliang Tang '(struct sock *)msk' is used several times in mptcp_nl_cmd_announce(), mptcp_nl_cmd_remove() or mptcp_userspace_pm_set_flags() in pm_userspace.c, it's worth adding a local variable sk to point it. Reviewed-by: Matthieu Baerts Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau --- net/mptcp/pm_userspace.c | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/net/mptcp/pm_userspace.c b/net/mptcp/pm_userspace.c index 7bb2b29e5b96..5c01b9bc619a 100644 --- a/net/mptcp/pm_userspace.c +++ b/net/mptcp/pm_userspace.c @@ -152,6 +152,7 @@ int mptcp_pm_nl_announce_doit(struct sk_buff *skb, struct genl_info *info) struct mptcp_pm_addr_entry addr_val; struct mptcp_sock *msk; int err = -EINVAL; + struct sock *sk; u32 token_val; if (!addr || !token) { @@ -167,6 +168,8 @@ int mptcp_pm_nl_announce_doit(struct sk_buff *skb, struct genl_info *info) return err; } + sk = (struct sock *)msk; + if (!mptcp_pm_is_userspace(msk)) { GENL_SET_ERR_MSG(info, "invalid request; userspace PM not selected"); goto announce_err; @@ -190,7 +193,7 @@ int mptcp_pm_nl_announce_doit(struct sk_buff *skb, struct genl_info *info) goto announce_err; } - lock_sock((struct sock *)msk); + lock_sock(sk); spin_lock_bh(&msk->pm.lock); if (mptcp_pm_alloc_anno_list(msk, &addr_val.addr)) { @@ -200,11 +203,11 @@ int mptcp_pm_nl_announce_doit(struct sk_buff *skb, struct genl_info *info) } spin_unlock_bh(&msk->pm.lock); - release_sock((struct sock *)msk); + release_sock(sk); err = 0; announce_err: - sock_put((struct sock *)msk); + sock_put(sk); return err; } @@ -251,6 +254,7 @@ int mptcp_pm_nl_remove_doit(struct sk_buff *skb, struct genl_info *info) struct mptcp_sock *msk; LIST_HEAD(free_list); int err = -EINVAL; + struct sock *sk; u32 token_val; u8 id_val; @@ -268,6 +272,8 @@ int mptcp_pm_nl_remove_doit(struct sk_buff *skb, struct genl_info *info) return err; } + sk = (struct sock *)msk; + if (!mptcp_pm_is_userspace(msk)) { GENL_SET_ERR_MSG(info, "invalid request; userspace PM not selected"); goto remove_err; @@ -278,7 +284,7 @@ int mptcp_pm_nl_remove_doit(struct sk_buff *skb, struct genl_info *info) goto remove_err; } - lock_sock((struct sock *)msk); + lock_sock(sk); list_for_each_entry(entry, &msk->pm.userspace_pm_local_addr_list, list) { if (entry->addr.id == id_val) { @@ -289,7 +295,7 @@ int mptcp_pm_nl_remove_doit(struct sk_buff *skb, struct genl_info *info) if (!match) { GENL_SET_ERR_MSG(info, "address with specified id not found"); - release_sock((struct sock *)msk); + release_sock(sk); goto remove_err; } @@ -297,15 +303,15 @@ int mptcp_pm_nl_remove_doit(struct sk_buff *skb, struct genl_info *info) mptcp_pm_remove_addrs(msk, &free_list); - release_sock((struct sock *)msk); + release_sock(sk); list_for_each_entry_safe(match, entry, &free_list, list) { - sock_kfree_s((struct sock *)msk, match, sizeof(*match)); + sock_kfree_s(sk, match, sizeof(*match)); } err = 0; remove_err: - sock_put((struct sock *)msk); + sock_put(sk); return err; } @@ -518,6 +524,7 @@ int mptcp_userspace_pm_set_flags(struct net *net, struct nlattr *token, { struct mptcp_sock *msk; int ret = -EINVAL; + struct sock *sk; u32 token_val; token_val = nla_get_u32(token); @@ -526,6 +533,8 @@ int mptcp_userspace_pm_set_flags(struct net *net, struct nlattr *token, if (!msk) return ret; + sk = (struct sock *)msk; + if (!mptcp_pm_is_userspace(msk)) goto set_flags_err; @@ -533,11 +542,11 @@ int mptcp_userspace_pm_set_flags(struct net *net, struct nlattr *token, rem->addr.family == AF_UNSPEC) goto set_flags_err; - lock_sock((struct sock *)msk); + lock_sock(sk); ret = mptcp_pm_nl_mp_prio_send_ack(msk, &loc->addr, &rem->addr, bkup); - release_sock((struct sock *)msk); + release_sock(sk); set_flags_err: - sock_put((struct sock *)msk); + sock_put(sk); return ret; } From patchwork Wed Oct 25 23:37:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mat Martineau X-Patchwork-Id: 13436960 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 EA2B639934; Wed, 25 Oct 2023 23:37:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="cid/1eiA" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 279FCC43397; Wed, 25 Oct 2023 23:37:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698277034; bh=nSuFbYfmMcnG6/Bus3aZEFgms4N+Cgbmq5LGxxuZa4s=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=cid/1eiAMHlvPTb6FGwNJxYtiZzPmudpFyNN3LW7+W82j80i3E+R4tdr7gOh3XTpE XaTeStiySMhXc5VjIhfQwKJwl38818WT90cI51OMdf8A3gnVCJcwfwvsvAmxJWyPxW ZCRO3Hy3VTz0jBgK9+aG2Q3Z6or/f7c7OjRN+t9A+lH7qK/lkejLc8nGNn8qBEk0Jo xEOZqyzGkwTlmmC57f5XF34I8b+0itd10ynp6Tx9iBtNFKC7TUAa0nGrXQRH9MwZSr /mXNFAJGUrq0jfbuGRYd+WSMSw/TTBq6S9nmjksKzrXX2ztYNLlNaX0tn3wvHK4w2O sHjZI7sPjsCzg== From: Mat Martineau Date: Wed, 25 Oct 2023 16:37:10 -0700 Subject: [PATCH net-next 09/10] selftests: mptcp: sockopt: drop mptcp_connect var Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20231025-send-net-next-20231025-v1-9-db8f25f798eb@kernel.org> References: <20231025-send-net-next-20231025-v1-0-db8f25f798eb@kernel.org> In-Reply-To: <20231025-send-net-next-20231025-v1-0-db8f25f798eb@kernel.org> To: Matthieu Baerts , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Geliang Tang , Kishen Maloor Cc: netdev@vger.kernel.org, mptcp@lists.linux.dev, Mat Martineau X-Mailer: b4 0.12.4 From: Geliang Tang Global var mptcp_connect defined at the front of mptcp_sockopt.sh is duplicate with local var mptcp_connect defined in do_transfer(), drop this useless global one. Reviewed-by: Matthieu Baerts Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau --- tools/testing/selftests/net/mptcp/mptcp_sockopt.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh b/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh index 8c8694f21e7d..a817af6616ec 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh @@ -11,7 +11,6 @@ cout="" ksft_skip=4 timeout_poll=30 timeout_test=$((timeout_poll * 2 + 1)) -mptcp_connect="" iptables="iptables" ip6tables="ip6tables" From patchwork Wed Oct 25 23:37:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mat Martineau X-Patchwork-Id: 13436959 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 E850638FBF; Wed, 25 Oct 2023 23:37:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="klos5CCR" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5F833C43395; Wed, 25 Oct 2023 23:37:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698277034; bh=o385p5F5wUZ+V11bTPAb8hg/SEwj63EpE55axa4fTPY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=klos5CCRSuXnlEFHduinfS5zZTgNkaWMx7DJ4jyyQ7soEeWKBPnVIAjFqOdmPL7Xz gBq8zfTibfkFVhVCL7uVMIdv8aj0XbyBtL29dFjL1MSWFRObTWZIWF/VqoHBNukyzJ r7ZWjfns0zSfUhfGqND1495J0eA8ydvrCm47VBvQxpPVfQAxi8BnvbvO7z/r/euhEO uns4PC0OSik+v50xt0aV0GlPSuiq3ZsA8O0zghqjaxhsfm8N7ieawTAOhEWR+1zVbr ZoLmI8DtLcyQV5wjULcujweSbzLzGt+0UIpuPyAU9NSDfV16sZFW2VP/14IsXDx8Qr yj+frrkJzQN+A== From: Mat Martineau Date: Wed, 25 Oct 2023 16:37:11 -0700 Subject: [PATCH net-next 10/10] selftests: mptcp: display simult in extra_msg Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20231025-send-net-next-20231025-v1-10-db8f25f798eb@kernel.org> References: <20231025-send-net-next-20231025-v1-0-db8f25f798eb@kernel.org> In-Reply-To: <20231025-send-net-next-20231025-v1-0-db8f25f798eb@kernel.org> To: Matthieu Baerts , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Geliang Tang , Kishen Maloor Cc: netdev@vger.kernel.org, mptcp@lists.linux.dev, Mat Martineau X-Mailer: b4 0.12.4 From: Geliang Tang Just like displaying "invert" after "Info: ", "simult" should be displayed too when rm_subflow_nr doesn't match the expect value in chk_rm_nr(): syn [ ok ] synack [ ok ] ack [ ok ] add [ ok ] echo [ ok ] rm [ ok ] rmsf [ ok ] 3 in [2:4] Info: invert simult syn [ ok ] synack [ ok ] ack [ ok ] add [ ok ] echo [ ok ] rm [ ok ] rmsf [ ok ] Info: invert Reviewed-by: Matthieu Baerts Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau --- tools/testing/selftests/net/mptcp/mptcp_join.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index 5917a74b749d..75a2438efdf3 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -1770,7 +1770,10 @@ chk_rm_nr() # in case of simult flush, the subflow removal count on each side is # unreliable count=$((count + cnt)) - [ "$count" != "$rm_subflow_nr" ] && suffix="$count in [$rm_subflow_nr:$((rm_subflow_nr*2))]" + if [ "$count" != "$rm_subflow_nr" ]; then + suffix="$count in [$rm_subflow_nr:$((rm_subflow_nr*2))]" + extra_msg="$extra_msg simult" + fi if [ $count -ge "$rm_subflow_nr" ] && \ [ "$count" -le "$((rm_subflow_nr *2 ))" ]; then print_ok "$suffix"