diff mbox series

[mptcp-next,v14,4/7] selftests: mptcp: userspace pm remove initial subflow

Message ID ad94cfc3e206d76f8e213d66fe2a73d335927496.1697031190.git.geliang.tang@suse.com (mailing list archive)
State Superseded, archived
Delegated to: Matthieu Baerts
Headers show
Series userspace pm remove id 0 subflow & address | expand

Checks

Context Check Description
matttbe/build success Build and static analysis OK
matttbe/checkpatch warning total: 0 errors, 1 warnings, 0 checks, 28 lines checked
matttbe/KVM_Validation__normal__except_selftest_mptcp_join_ success Success! ✅
matttbe/KVM_Validation__debug__except_selftest_mptcp_join_ success Success! ✅
matttbe/KVM_Validation__normal__only_selftest_mptcp_join_ success Success! ✅
matttbe/KVM_Validation__debug__only_selftest_mptcp_join_ warning Unstable: 1 failed test(s): selftest_mptcp_join

Commit Message

Geliang Tang Oct. 11, 2023, 1:34 p.m. UTC
This patch adds a selftest for userpsace PM to remove the initial
subflow. Use userspace_pm_add_sf() to add a subflow, and pass initial
ip address to userspace_pm_rm_sf() to remove the initial subflow.

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

Comments

Matthieu Baerts (NGI0) Oct. 11, 2023, 3:57 p.m. UTC | #1
Hi Geliang,

On 11/10/2023 15:34, Geliang Tang wrote:
> This patch adds a selftest for userpsace PM to remove the initial
> subflow. Use userspace_pm_add_sf() to add a subflow, and pass initial
> ip address to userspace_pm_rm_sf() to remove the initial subflow.
> 
> Signed-off-by: Geliang Tang <geliang.tang@suse.com>
> ---
>  .../testing/selftests/net/mptcp/mptcp_join.sh | 22 +++++++++++++++++++
>  1 file changed, 22 insertions(+)
> 
> diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
> index ab6908b7b143..e1304383057c 100755
> --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
> +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
> @@ -3507,6 +3507,28 @@ userspace_tests()
>  		kill_events_pids
>  		wait $tests_pid
>  	fi
> +
> +	# userspace pm remove initial subflow
> +	if reset_with_events "userspace pm remove initial subflow" &&
> +	   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 \
> +			run_tests $ns1 $ns2 10.0.1.1 &
> +		local tests_pid=$!
> +		wait_mpj $ns2
> +		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 $ns2 10.0.1.2

If this command removes the initial subflow ...

> +		chk_rm_nr 0 1

(it is a bit confusing, we could think there are RM_ADDR being sent
here. If you need to change something else, can you add a comment here
that we don't look at the counter linked to the RM_ADDR but to the one
linked to the subflows that have been removed please?)

> +		chk_rst_nr 0 0 invert
> +		chk_mptcp_info subflows 1 subflows 1

... that's normal to still have 1 "extra subflow" here but ...

> +		chk_subflows_total 2 2

... this should be "1 1", no? One subflow has been removed in between,
so we should not have the same counter as before, no?

Cheers,
Matt
Geliang Tang Oct. 12, 2023, 9:07 a.m. UTC | #2
On Wed, Oct 11, 2023 at 05:57:42PM +0200, Matthieu Baerts wrote:
> Hi Geliang,
> 
> On 11/10/2023 15:34, Geliang Tang wrote:
> > This patch adds a selftest for userpsace PM to remove the initial
> > subflow. Use userspace_pm_add_sf() to add a subflow, and pass initial
> > ip address to userspace_pm_rm_sf() to remove the initial subflow.
> > 
> > Signed-off-by: Geliang Tang <geliang.tang@suse.com>
> > ---
> >  .../testing/selftests/net/mptcp/mptcp_join.sh | 22 +++++++++++++++++++
> >  1 file changed, 22 insertions(+)
> > 
> > diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
> > index ab6908b7b143..e1304383057c 100755
> > --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
> > +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
> > @@ -3507,6 +3507,28 @@ userspace_tests()
> >  		kill_events_pids
> >  		wait $tests_pid
> >  	fi
> > +
> > +	# userspace pm remove initial subflow
> > +	if reset_with_events "userspace pm remove initial subflow" &&
> > +	   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 \
> > +			run_tests $ns1 $ns2 10.0.1.1 &
> > +		local tests_pid=$!
> > +		wait_mpj $ns2
> > +		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 $ns2 10.0.1.2
> 
> If this command removes the initial subflow ...
> 
> > +		chk_rm_nr 0 1
> 
> (it is a bit confusing, we could think there are RM_ADDR being sent
> here. If you need to change something else, can you add a comment here
> that we don't look at the counter linked to the RM_ADDR but to the one
> linked to the subflows that have been removed please?)
> 
> > +		chk_rst_nr 0 0 invert
> > +		chk_mptcp_info subflows 1 subflows 1
> 
> ... that's normal to still have 1 "extra subflow" here but ...
> 
> > +		chk_subflows_total 2 2
> 
> ... this should be "1 1", no? One subflow has been removed in between,
> so we should not have the same counter as before, no?

It will be "2 1" if we test TCPF_FIN_WAIT2 as well as TCPF_CLOSE in
__mptcp_has_initial_subflow too. This is no subflow removed in ns1, one
subflow has been removed in ns2. Patch 7 will get "2 1" too.

> 
> Cheers,
> Matt
> -- 
> Tessares | Belgium | Hybrid Access Solutions
> www.tessares.net
diff mbox series

Patch

diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
index ab6908b7b143..e1304383057c 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -3507,6 +3507,28 @@  userspace_tests()
 		kill_events_pids
 		wait $tests_pid
 	fi
+
+	# userspace pm remove initial subflow
+	if reset_with_events "userspace pm remove initial subflow" &&
+	   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 \
+			run_tests $ns1 $ns2 10.0.1.1 &
+		local tests_pid=$!
+		wait_mpj $ns2
+		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 $ns2 10.0.1.2
+		chk_rm_nr 0 1
+		chk_rst_nr 0 0 invert
+		chk_mptcp_info subflows 1 subflows 1
+		chk_subflows_total 2 2
+		kill_events_pids
+		wait $tests_pid
+	fi
 }
 
 endpoint_tests()