[PATCH] Squash to "selftests: mptcp: implement pm_nl_set_endpoint"

Geliang Tang posted 1 patch 2 years, 3 months ago
Failed in applying to current master (apply log)
.../testing/selftests/net/mptcp/mptcp_join.sh | 20 +++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
[PATCH] Squash to "selftests: mptcp: implement pm_nl_set_endpoint"
Posted by Geliang Tang 2 years, 3 months ago
I just noticed Davide had added support for changing the backup flag in
iproute2-next, so my patch "[PATCH iproute2-next 3/3] mptcp: add the
backup flag setting" needs to be dropped.

Furthermore, Davide's patch used 'change id $id backup' instead of 'set
$addr backup'. So this squash-to patch is needed.

pm_nl_set_endpoint is renamed to pm_nl_change_endpoint in this patch, so
please rename the subject too:

 Subject: selftests: mptcp: implement pm_nl_change_endpoint

Signed-off-by: Geliang Tang <geliang.tang@suse.com>
---
 .../testing/selftests/net/mptcp/mptcp_join.sh | 20 +++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
index 7ceb8ec11f79..46f7adab802b 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -374,14 +374,15 @@ pm_nl_show_endpoint()
 	fi
 }
 
-pm_nl_set_endpoint()
+pm_nl_change_endpoint()
 {
 	local ns=$1
 	local addr=$2
-	local bkup=$3
+	local id=$3
+	local bkup=$4
 
 	if [ $ip_mptcp -eq 1 ]; then
-		ip -n $ns mptcp endpoint set $addr $bkup
+		ip -n $ns mptcp endpoint change id $id $bkup
 	else
 		ip netns exec $ns ./pm_nl_ctl set $addr flags $bkup
 	fi
@@ -586,6 +587,10 @@ do_transfer()
 		for netns in "$ns1" "$ns2"; do
 			pm_nl_show_endpoint $netns | while read line; do
 				local arr=($line)
+				local nr=0
+				local addr
+				local id
+
 				# 'pm_nl_ctl' shows the address at the end
 				let pos=${#arr[@]}-1
 
@@ -594,7 +599,14 @@ do_transfer()
 					pos=0
 				fi
 				addr=${arr[$pos]}
-				pm_nl_set_endpoint $netns $addr $bkup
+
+				for i in ${arr[@]}; do
+					if [ $i = "id" ]; then
+						id=${arr[$nr+1]}
+					fi
+					let nr+=1
+				done
+				pm_nl_change_endpoint $netns $addr $id $bkup
 			done
 		done
 	fi
-- 
2.31.1


Re: [PATCH] Squash to "selftests: mptcp: implement pm_nl_set_endpoint"
Posted by Mat Martineau 2 years, 3 months ago
On Mon, 10 Jan 2022, Geliang Tang wrote:

> I just noticed Davide had added support for changing the backup flag in
> iproute2-next, so my patch "[PATCH iproute2-next 3/3] mptcp: add the
> backup flag setting" needs to be dropped.
>
> Furthermore, Davide's patch used 'change id $id backup' instead of 'set
> $addr backup'. So this squash-to patch is needed.
>
> pm_nl_set_endpoint is renamed to pm_nl_change_endpoint in this patch, so
> please rename the subject too:
>
> Subject: selftests: mptcp: implement pm_nl_change_endpoint
>
> Signed-off-by: Geliang Tang <geliang.tang@suse.com>

I did include this patch when reviewing the "use 'ip mptcp' in selftests" 
series. It's good to squash, waiting on discussion of one question in 
patch 7/9

- Mat

> ---
> .../testing/selftests/net/mptcp/mptcp_join.sh | 20 +++++++++++++++----
> 1 file changed, 16 insertions(+), 4 deletions(-)
>
> diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
> index 7ceb8ec11f79..46f7adab802b 100755
> --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
> +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
> @@ -374,14 +374,15 @@ pm_nl_show_endpoint()
> 	fi
> }
>
> -pm_nl_set_endpoint()
> +pm_nl_change_endpoint()
> {
> 	local ns=$1
> 	local addr=$2
> -	local bkup=$3
> +	local id=$3
> +	local bkup=$4
>
> 	if [ $ip_mptcp -eq 1 ]; then
> -		ip -n $ns mptcp endpoint set $addr $bkup
> +		ip -n $ns mptcp endpoint change id $id $bkup
> 	else
> 		ip netns exec $ns ./pm_nl_ctl set $addr flags $bkup
> 	fi
> @@ -586,6 +587,10 @@ do_transfer()
> 		for netns in "$ns1" "$ns2"; do
> 			pm_nl_show_endpoint $netns | while read line; do
> 				local arr=($line)
> +				local nr=0
> +				local addr
> +				local id
> +
> 				# 'pm_nl_ctl' shows the address at the end
> 				let pos=${#arr[@]}-1
>
> @@ -594,7 +599,14 @@ do_transfer()
> 					pos=0
> 				fi
> 				addr=${arr[$pos]}
> -				pm_nl_set_endpoint $netns $addr $bkup
> +
> +				for i in ${arr[@]}; do
> +					if [ $i = "id" ]; then
> +						id=${arr[$nr+1]}
> +					fi
> +					let nr+=1
> +				done
> +				pm_nl_change_endpoint $netns $addr $id $bkup
> 			done
> 		done
> 	fi
> -- 
> 2.31.1
>
>
>

--
Mat Martineau
Intel