From nobody Wed Dec 4 19:02:44 2024 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 481933EA90; Mon, 4 Mar 2024 16:44:54 +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=1709570695; cv=none; b=lMWtsiioCq/Fa75SAHvc/2e1eov+1CN/xv6I2y4bLXZzh7yKbNLHbHms7lkW88Q9lvkjp9WdU9m4iiMBmAyiuDOW7axOGko8nUIUzQXUAAiG7TeVdFYbwBASXMfv32jsWqoaEs80yDeqcnUWZiL9JGViEh3vkFUAYceXmTuazJQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709570695; c=relaxed/simple; bh=gkc8KLVAFPIs457HwUZ6i7GDkStIarZaAOYitoCOh38=; h=Subject:To:Cc:From:Date:In-Reply-To:Message-ID:MIME-Version: Content-Type; b=bp5iSnojGiFy8Q4vOjDUykeuVvWUGmwWTY3GvQw0g1urqvu+FV2YCBQ2idwctCT9il77QnVQZS6pLP5anrowdr/PCvQ6ijuTWXfd5G/6gt0lIfw+JcUTmLWcQX34TC8mVicHH9SI8Sdvo3F26zRHkDM/ta/T4I6qnWVd4U5vuAk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=eo8chjnY; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="eo8chjnY" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 63CDFC433C7; Mon, 4 Mar 2024 16:44:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1709570694; bh=gkc8KLVAFPIs457HwUZ6i7GDkStIarZaAOYitoCOh38=; h=Subject:To:Cc:From:Date:In-Reply-To:From; b=eo8chjnY9OyQ4+GOfhZqfPgXabobEuCCvCQBCSV+/A/XwjVJI7+SIswYhgGD3/M16 waICwaDiXKyUcAokg5QltCyGnTEUW4dAqS3jTGiOG0v+dT1X/idcyXb9U0UC7uowS+ ZnXaN6LuLZd9EJf/p7hDqkSVoyFfxoPqC0zAwvfI= Subject: Patch "selftests: mptcp: update userspace pm test helpers" has been added to the 6.6-stable tree To: geliang.tang@suse.com,gregkh@linuxfoundation.org,kuba@kernel.org,martineau@kernel.org,matttbe@kernel.org,mptcp@lists.linux.dev Cc: From: Date: Mon, 04 Mar 2024 17:44:27 +0100 In-Reply-To: <20240304142508.2086803-10-matttbe@kernel.org> Message-ID: <2024030427-remix-bulginess-f14a@gregkh> Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-stable: commit X-Patchwork-Hint: ignore Content-Type: text/plain; charset="utf-8" This is a note to let you know that I've just added the patch titled selftests: mptcp: update userspace pm test helpers to the 6.6-stable tree which can be found at: http://www.kernel.org/git/?p=3Dlinux/kernel/git/stable/stable-queue.git= ;a=3Dsummary The filename of the patch is: selftests-mptcp-update-userspace-pm-test-helpers.patch and it can be found in the queue-6.6 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. From matttbe@kernel.org Mon Mar 4 15:25:26 2024 From: "Matthieu Baerts (NGI0)" Date: Mon, 4 Mar 2024 15:25:12 +0100 Subject: selftests: mptcp: update userspace pm test helpers To: stable@vger.kernel.org, gregkh@linuxfoundation.org Cc: MPTCP Upstream , Geliang Tang , Matthieu Baerts , Mat Martineau , Jakub Kicinski Message-ID: <20240304142508.2086803-10-matttbe@kernel.org> From: Geliang Tang commit 757c828ce94905a2975873d5e90a376c701b2b90 upstream. This patch adds a new argument namespace to userspace_pm_add_addr() and userspace_pm_add_sf() to make these two helper more versatile. Add two more versatile helpers for userspace pm remove subflow or address: userspace_pm_rm_addr() and userspace_pm_rm_sf(). The original test helpers userspace_pm_rm_sf_addr_ns1() and userspace_pm_rm_sf_addr_ns2() can be replaced by these new helpers. Reviewed-by: Matthieu Baerts Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Link: https://lore.kernel.org/r/20231128-send-net-next-2023107-v4-4-8d6b941= 50f6b@kernel.org Signed-off-by: Jakub Kicinski Signed-off-by: Matthieu Baerts (NGI0) Signed-off-by: Greg Kroah-Hartman --- tools/testing/selftests/net/mptcp/mptcp_join.sh | 100 +++++++++++--------= ----- 1 file changed, 49 insertions(+), 51 deletions(-) --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -2821,6 +2821,7 @@ backup_tests() fi } =20 +SUB_ESTABLISHED=3D10 # MPTCP_EVENT_SUB_ESTABLISHED LISTENER_CREATED=3D15 #MPTCP_EVENT_LISTENER_CREATED LISTENER_CLOSED=3D16 #MPTCP_EVENT_LISTENER_CLOSED =20 @@ -3281,75 +3282,70 @@ fail_tests() fi } =20 +# $1: ns ; $2: addr ; $3: id userspace_pm_add_addr() { - local addr=3D$1 - local id=3D$2 + local evts=3D$evts_ns1 local tk =20 - tk=3D$(grep "type:1," "$evts_ns1" | - sed -n 's/.*\(token:\)\([[:digit:]]*\).*$/\2/p;q') - ip netns exec $ns1 ./pm_nl_ctl ann $addr token $tk id $id + [ "$1" =3D=3D "$ns2" ] && evts=3D$evts_ns2 + tk=3D$(mptcp_lib_evts_get_info token "$evts") + + ip netns exec $1 ./pm_nl_ctl ann $2 token $tk id $3 sleep 1 } =20 -userspace_pm_rm_sf_addr_ns1() +# $1: ns ; $2: id +userspace_pm_rm_addr() { - local addr=3D$1 - local id=3D$2 - local tk sp da dp - local cnt_addr cnt_sf - - tk=3D$(grep "type:1," "$evts_ns1" | - sed -n 's/.*\(token:\)\([[:digit:]]*\).*$/\2/p;q') - sp=3D$(grep "type:10" "$evts_ns1" | - sed -n 's/.*\(sport:\)\([[:digit:]]*\).*$/\2/p;q') - da=3D$(grep "type:10" "$evts_ns1" | - sed -n 's/.*\(daddr6:\)\([0-9a-f:.]*\).*$/\2/p;q') - dp=3D$(grep "type:10" "$evts_ns1" | - sed -n 's/.*\(dport:\)\([[:digit:]]*\).*$/\2/p;q') - cnt_addr=3D$(rm_addr_count ${ns1}) - cnt_sf=3D$(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 "${cnt_addr}" - wait_rm_sf $ns1 "${cnt_sf}" + local evts=3D$evts_ns1 + local tk + local cnt + + [ "$1" =3D=3D "$ns2" ] && evts=3D$evts_ns2 + tk=3D$(mptcp_lib_evts_get_info token "$evts") + + cnt=3D$(rm_addr_count ${1}) + ip netns exec $1 ./pm_nl_ctl rem token $tk id $2 + wait_rm_addr $1 "${cnt}" } =20 +# $1: ns ; $2: addr ; $3: id userspace_pm_add_sf() { - local addr=3D$1 - local id=3D$2 + local evts=3D$evts_ns1 local tk da dp =20 - tk=3D$(sed -n 's/.*\(token:\)\([[:digit:]]*\).*$/\2/p;q' "$evts_ns2") - da=3D$(sed -n 's/.*\(daddr4:\)\([0-9.]*\).*$/\2/p;q' "$evts_ns2") - dp=3D$(sed -n 's/.*\(dport:\)\([[:digit:]]*\).*$/\2/p;q' "$evts_ns2") - ip netns exec $ns2 ./pm_nl_ctl csf lip $addr lid $id \ + [ "$1" =3D=3D "$ns2" ] && evts=3D$evts_ns2 + tk=3D$(mptcp_lib_evts_get_info token "$evts") + da=3D$(mptcp_lib_evts_get_info daddr4 "$evts") + dp=3D$(mptcp_lib_evts_get_info dport "$evts") + + ip netns exec $1 ./pm_nl_ctl csf lip $2 lid $3 \ rip $da rport $dp token $tk sleep 1 } =20 -userspace_pm_rm_sf_addr_ns2() +# $1: ns ; $2: addr $3: event type +userspace_pm_rm_sf() { - local addr=3D$1 - local id=3D$2 + local evts=3D$evts_ns1 + local t=3D${3:-1} + local ip=3D4 local tk da dp sp - local cnt_addr cnt_sf + local cnt + + [ "$1" =3D=3D "$ns2" ] && evts=3D$evts_ns2 + if is_v6 $2; then ip=3D6; fi + tk=3D$(mptcp_lib_evts_get_info token "$evts") + da=3D$(mptcp_lib_evts_get_info "daddr$ip" "$evts" $t) + dp=3D$(mptcp_lib_evts_get_info dport "$evts" $t) + sp=3D$(mptcp_lib_evts_get_info sport "$evts" $t) =20 - tk=3D$(sed -n 's/.*\(token:\)\([[:digit:]]*\).*$/\2/p;q' "$evts_ns2") - da=3D$(sed -n 's/.*\(daddr4:\)\([0-9.]*\).*$/\2/p;q' "$evts_ns2") - dp=3D$(sed -n 's/.*\(dport:\)\([[:digit:]]*\).*$/\2/p;q' "$evts_ns2") - sp=3D$(grep "type:10" "$evts_ns2" | - sed -n 's/.*\(sport:\)\([[:digit:]]*\).*$/\2/p;q') - cnt_addr=3D$(rm_addr_count ${ns2}) - cnt_sf=3D$(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 \ + cnt=3D$(rm_sf_count ${1}) + ip netns exec $1 ./pm_nl_ctl dsf lip $2 lport $sp \ rip $da rport $dp token $tk - wait_rm_addr $ns2 "${cnt_addr}" - wait_rm_sf $ns2 "${cnt_sf}" + wait_rm_sf $1 "${cnt}" } =20 userspace_tests() @@ -3436,13 +3432,14 @@ userspace_tests() run_tests $ns1 $ns2 10.0.1.1 & local tests_pid=3D$! wait_mpj $ns1 - userspace_pm_add_addr 10.0.2.1 10 + 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_sf_addr_ns1 10.0.2.1 10 + userspace_pm_rm_addr $ns1 10 + userspace_pm_rm_sf $ns1 "::ffff:10.0.2.1" $SUB_ESTABLISHED chk_rm_nr 1 1 invert chk_mptcp_info subflows 0 subflows 0 chk_subflows_total 1 1 @@ -3459,11 +3456,12 @@ userspace_tests() run_tests $ns1 $ns2 10.0.1.1 & local tests_pid=3D$! wait_mpj $ns2 - userspace_pm_add_sf 10.0.3.2 20 + userspace_pm_add_sf $ns2 10.0.3.2 20 chk_join_nr 1 1 1 chk_mptcp_info subflows 1 subflows 1 chk_subflows_total 2 2 - userspace_pm_rm_sf_addr_ns2 10.0.3.2 20 + userspace_pm_rm_addr $ns2 20 + userspace_pm_rm_sf $ns2 10.0.3.2 $SUB_ESTABLISHED chk_rm_nr 1 1 chk_mptcp_info subflows 0 subflows 0 chk_subflows_total 1 1 Patches currently in stable-queue which might be from matttbe@kernel.org are queue-6.6/selftests-mptcp-add-mptcp_lib_is_v6.patch queue-6.6/mptcp-push-at-dss-boundaries.patch queue-6.6/mptcp-fix-double-free-on-socket-dismantle.patch queue-6.6/mptcp-fix-snd_wnd-initialization-for-passive-socket.patch queue-6.6/selftests-mptcp-rm-subflow-with-v4-v4mapped-addr.patch queue-6.6/selftests-mptcp-update-userspace-pm-test-helpers.patch queue-6.6/mptcp-map-v4-address-to-v6-when-destroying-subflow.patch queue-6.6/selftests-mptcp-add-evts_get_info-helper.patch queue-6.6/mptcp-fix-potential-wake-up-event-loss.patch queue-6.6/selftests-mptcp-join-add-ss-mptcp-support-check.patch queue-6.6/mptcp-fix-possible-deadlock-in-subflow-diag.patch queue-6.6/mptcp-avoid-printing-warning-once-on-client-side.patch queue-6.6/selftests-mptcp-add-chk_subflows_total-helper.patch