* [PATCH mptcp-next v17 0/9] userspace pm remove id 0 subflow & address
@ 2023-10-17 3:00 Geliang Tang
2023-10-17 3:00 ` [PATCH mptcp-next v17 1/9] selftests: mptcp: run userspace pm tests slower Geliang Tang
` (9 more replies)
0 siblings, 10 replies; 13+ messages in thread
From: Geliang Tang @ 2023-10-17 3:00 UTC (permalink / raw)
To: mptcp; +Cc: Geliang Tang
From: Geliang Tang <geliang.tang@suse.com>
v17:
- include "fix userspace pm CI failures" series.
- update __mptcp_has_initial_subflow as Paolo suggested.
- update chk_subflows_total.
- update selftests.
v16:
- address Matt's comments in v15.
v15:
- update __mptcp_has_initial_subflow
- address Matt's comments in v14.
v14:
- reuse MPTCP_CF_FASTCLOSE flag.
- use tcp_shutdown instead of mptcp_subflow_shutdown.
v13:
- invoke mptcp_subflow_shutdown() in patch 1 as Paolo suggested.
v12:
- address Matt's comments in v11.
v11:
- avoid sending RSTs.
- rename 'id 0 subflow' to 'inital subflow'.
Geliang Tang (9):
selftests: mptcp: run userspace pm tests slower
selftests: mptcp: fix wait_rm_addr/sf parameters
Squash to "selftests: mptcp: userspace pm create id 0 subflow"
Squash to "mptcp: add mptcpi_subflows_total counter"
Squash to "selftests: mptcp: add chk_subflows_total helper"
selftests: mptcp: userspace pm remove initial subflow
mptcp: userspace pm send RM_ADDR for ID 0
mptcp: userspace pm rename remove_err to out
selftests: mptcp: userspace pm send RM_ADDR for ID 0
net/mptcp/pm_userspace.c | 45 +++++++++++-
net/mptcp/protocol.h | 4 +-
.../testing/selftests/net/mptcp/mptcp_join.sh | 70 +++++++++++++++++--
3 files changed, 108 insertions(+), 11 deletions(-)
--
2.35.3
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH mptcp-next v17 1/9] selftests: mptcp: run userspace pm tests slower
2023-10-17 3:00 [PATCH mptcp-next v17 0/9] userspace pm remove id 0 subflow & address Geliang Tang
@ 2023-10-17 3:00 ` Geliang Tang
2023-10-17 3:00 ` [PATCH mptcp-next v17 2/9] selftests: mptcp: fix wait_rm_addr/sf parameters Geliang Tang
` (8 subsequent siblings)
9 siblings, 0 replies; 13+ messages in thread
From: Geliang Tang @ 2023-10-17 3:00 UTC (permalink / raw)
To: mptcp; +Cc: Geliang Tang
From: Geliang Tang <geliang.tang@suse.com>
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 change 'speed' to 5 to run the tests much more
slower.
Fixes: 4369c198e599 ("selftests: mptcp: test userspace pm out of transfer")
Signed-off-by: Geliang Tang <geliang.tang@suse.com>
---
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 07b2c4bfa183..2269dc986d78 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -3448,7 +3448,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
@@ -3472,7 +3472,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
--
2.35.3
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH mptcp-next v17 2/9] selftests: mptcp: fix wait_rm_addr/sf parameters
2023-10-17 3:00 [PATCH mptcp-next v17 0/9] userspace pm remove id 0 subflow & address Geliang Tang
2023-10-17 3:00 ` [PATCH mptcp-next v17 1/9] selftests: mptcp: run userspace pm tests slower Geliang Tang
@ 2023-10-17 3:00 ` Geliang Tang
2023-10-17 3:00 ` [PATCH mptcp-next v17 3/9] Squash to "selftests: mptcp: userspace pm create id 0 subflow" Geliang Tang
` (7 subsequent siblings)
9 siblings, 0 replies; 13+ messages in thread
From: Geliang Tang @ 2023-10-17 3:00 UTC (permalink / raw)
To: mptcp; +Cc: Geliang Tang
From: Geliang Tang <geliang.tang@suse.com>
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 failures.
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")
Signed-off-by: Geliang Tang <geliang.tang@suse.com>
---
tools/testing/selftests/net/mptcp/mptcp_join.sh | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
index 2269dc986d78..186f5933a096 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -3324,12 +3324,14 @@ userspace_pm_rm_addr()
{
local evts=$evts_ns1
local tk
+ local cnt
[ "$1" == "$ns2" ] && evts=$evts_ns2
tk=$(mptcp_lib_evts_get_info token "$evts")
+ cnt=$(rm_addr_count ${1})
ip netns exec $1 ./pm_nl_ctl rem token $tk id $2
- wait_rm_addr $1 1
+ wait_rm_addr $1 "${cnt}"
}
# $1: ns ; $2: addr ; $3: id
@@ -3355,6 +3357,7 @@ userspace_pm_rm_sf()
local t=${3:-1}
local ip=4
local tk da dp sp
+ local cnt
[ "$1" == "$ns2" ] && evts=$evts_ns2
if is_v6 $2; then ip=6; fi
@@ -3363,9 +3366,10 @@ userspace_pm_rm_sf()
dp=$(mptcp_lib_evts_get_info dport "$evts" $t)
sp=$(mptcp_lib_evts_get_info sport "$evts" $t)
+ cnt=$(rm_sf_count ${1})
ip netns exec $1 ./pm_nl_ctl dsf lip $2 lport $sp \
rip $da rport $dp token $tk
- wait_rm_sf $1 1
+ wait_rm_sf $1 "${cnt}"
}
userspace_tests()
--
2.35.3
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH mptcp-next v17 3/9] Squash to "selftests: mptcp: userspace pm create id 0 subflow"
2023-10-17 3:00 [PATCH mptcp-next v17 0/9] userspace pm remove id 0 subflow & address Geliang Tang
2023-10-17 3:00 ` [PATCH mptcp-next v17 1/9] selftests: mptcp: run userspace pm tests slower Geliang Tang
2023-10-17 3:00 ` [PATCH mptcp-next v17 2/9] selftests: mptcp: fix wait_rm_addr/sf parameters Geliang Tang
@ 2023-10-17 3:00 ` Geliang Tang
2023-10-17 3:00 ` [PATCH mptcp-next v17 4/9] Squash to "mptcp: add mptcpi_subflows_total counter" Geliang Tang
` (6 subsequent siblings)
9 siblings, 0 replies; 13+ messages in thread
From: Geliang Tang @ 2023-10-17 3:00 UTC (permalink / raw)
To: mptcp; +Cc: Geliang Tang
From: Geliang Tang <geliang.tang@suse.com>
Change speed to 5 too.
Signed-off-by: Geliang Tang <geliang.tang@suse.com>
---
tools/testing/selftests/net/mptcp/mptcp_join.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
index 186f5933a096..c5e30f4bfcda 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -3498,7 +3498,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
--
2.35.3
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH mptcp-next v17 4/9] Squash to "mptcp: add mptcpi_subflows_total counter"
2023-10-17 3:00 [PATCH mptcp-next v17 0/9] userspace pm remove id 0 subflow & address Geliang Tang
` (2 preceding siblings ...)
2023-10-17 3:00 ` [PATCH mptcp-next v17 3/9] Squash to "selftests: mptcp: userspace pm create id 0 subflow" Geliang Tang
@ 2023-10-17 3:00 ` Geliang Tang
2023-10-17 3:00 ` [PATCH mptcp-next v17 5/9] Squash to "selftests: mptcp: add chk_subflows_total helper" Geliang Tang
` (5 subsequent siblings)
9 siblings, 0 replies; 13+ messages in thread
From: Geliang Tang @ 2023-10-17 3:00 UTC (permalink / raw)
To: mptcp; +Cc: Geliang Tang
From: Geliang Tang <geliang.tang@suse.com>
Update __mptcp_has_initial_subflow().
Signed-off-by: Geliang Tang <geliang.tang@suse.com>
---
net/mptcp/protocol.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
index 6508179e94a6..8529b3ae55e9 100644
--- a/net/mptcp/protocol.h
+++ b/net/mptcp/protocol.h
@@ -1081,7 +1081,9 @@ static inline bool __mptcp_has_initial_subflow(const struct mptcp_sock *msk)
{
struct sock *ssk = READ_ONCE(msk->first);
- return ssk && inet_sk_state_load(ssk) != TCP_CLOSE;
+ return ssk && ((1 << inet_sk_state_load(ssk)) &
+ (TCPF_ESTABLISHED | TCPF_SYN_SENT |
+ TCPF_SYN_RECV | TCPF_LISTEN));
}
static inline void mptcp_do_fallback(struct sock *ssk)
--
2.35.3
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH mptcp-next v17 5/9] Squash to "selftests: mptcp: add chk_subflows_total helper"
2023-10-17 3:00 [PATCH mptcp-next v17 0/9] userspace pm remove id 0 subflow & address Geliang Tang
` (3 preceding siblings ...)
2023-10-17 3:00 ` [PATCH mptcp-next v17 4/9] Squash to "mptcp: add mptcpi_subflows_total counter" Geliang Tang
@ 2023-10-17 3:00 ` Geliang Tang
2023-10-17 3:00 ` [PATCH mptcp-next v17 6/9] selftests: mptcp: userspace pm remove initial subflow Geliang Tang
` (4 subsequent siblings)
9 siblings, 0 replies; 13+ messages in thread
From: Geliang Tang @ 2023-10-17 3:00 UTC (permalink / raw)
To: mptcp; +Cc: Geliang Tang
From: Geliang Tang <geliang.tang@suse.com>
Please update the commit log too:
'''
ss -ti | grep -c tcp-ulp-mptcp.
'''
->
'''
ss -ti state state established state syn-sent state syn-recv
| grep -c tcp-ulp-mptcp.
'''
Signed-off-by: Geliang Tang <geliang.tang@suse.com>
---
tools/testing/selftests/net/mptcp/mptcp_join.sh | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
index c5e30f4bfcda..6c2c47ce11ad 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -1905,8 +1905,10 @@ chk_subflows_total()
print_check "$info $1:$2"
# if not, count the TCP connections that are in fact MPTCP subflows
- cnt1=$(ss -N $ns1 -ti | grep -c tcp-ulp-mptcp)
- cnt2=$(ss -N $ns2 -ti | grep -c tcp-ulp-mptcp)
+ cnt1=$(ss -N $ns1 -ti state established state syn-sent state syn-recv |
+ grep -c tcp-ulp-mptcp)
+ cnt2=$(ss -N $ns2 -ti state established state syn-sent state syn-recv |
+ grep -c tcp-ulp-mptcp)
if [ "$1" != "$cnt1" ] || [ "$2" != "$cnt2" ]; then
fail_test "got subflows $cnt1:$cnt2 expected $1:$2"
--
2.35.3
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH mptcp-next v17 6/9] selftests: mptcp: userspace pm remove initial subflow
2023-10-17 3:00 [PATCH mptcp-next v17 0/9] userspace pm remove id 0 subflow & address Geliang Tang
` (4 preceding siblings ...)
2023-10-17 3:00 ` [PATCH mptcp-next v17 5/9] Squash to "selftests: mptcp: add chk_subflows_total helper" Geliang Tang
@ 2023-10-17 3:00 ` Geliang Tang
2023-10-17 3:00 ` [PATCH mptcp-next v17 7/9] mptcp: userspace pm send RM_ADDR for ID 0 Geliang Tang
` (3 subsequent siblings)
9 siblings, 0 replies; 13+ messages in thread
From: Geliang Tang @ 2023-10-17 3:00 UTC (permalink / raw)
To: mptcp; +Cc: Geliang Tang
From: Geliang Tang <geliang.tang@suse.com>
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 | 24 +++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
index 6c2c47ce11ad..68fb7aa12fef 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -3513,6 +3513,30 @@ 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=5 \
+ 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
+ # we don't look at the counter linked to the RM_ADDR but
+ # to the one linked to the subflows that have been removed
+ chk_rm_nr 0 1
+ 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()
--
2.35.3
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH mptcp-next v17 7/9] mptcp: userspace pm send RM_ADDR for ID 0
2023-10-17 3:00 [PATCH mptcp-next v17 0/9] userspace pm remove id 0 subflow & address Geliang Tang
` (5 preceding siblings ...)
2023-10-17 3:00 ` [PATCH mptcp-next v17 6/9] selftests: mptcp: userspace pm remove initial subflow Geliang Tang
@ 2023-10-17 3:00 ` Geliang Tang
2023-10-17 3:00 ` [PATCH mptcp-next v17 8/9] mptcp: userspace pm rename remove_err to out Geliang Tang
` (2 subsequent siblings)
9 siblings, 0 replies; 13+ messages in thread
From: Geliang Tang @ 2023-10-17 3:00 UTC (permalink / raw)
To: mptcp; +Cc: Geliang Tang
From: Geliang Tang <geliang.tang@suse.com>
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")
Signed-off-by: Geliang Tang <geliang.tang@suse.com>
---
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 6b8083650bc1..ea50e694125d 100644
--- a/net/mptcp/pm_userspace.c
+++ b/net/mptcp/pm_userspace.c
@@ -211,6 +211,40 @@ int mptcp_pm_nl_announce_doit(struct sk_buff *skb, struct genl_info *info)
return err;
}
+static int mptcp_userspace_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];
@@ -245,6 +279,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_remove_id_zero_address(msk, info);
+ goto remove_err;
+ }
+
lock_sock(sk);
list_for_each_entry(entry, &msk->pm.userspace_pm_local_addr_list, list) {
--
2.35.3
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH mptcp-next v17 8/9] mptcp: userspace pm rename remove_err to out
2023-10-17 3:00 [PATCH mptcp-next v17 0/9] userspace pm remove id 0 subflow & address Geliang Tang
` (6 preceding siblings ...)
2023-10-17 3:00 ` [PATCH mptcp-next v17 7/9] mptcp: userspace pm send RM_ADDR for ID 0 Geliang Tang
@ 2023-10-17 3:00 ` Geliang Tang
2023-10-17 3:00 ` [PATCH mptcp-next v17 9/9] selftests: mptcp: userspace pm send RM_ADDR for ID 0 Geliang Tang
2023-10-22 23:06 ` [PATCH mptcp-next v17 0/9] userspace pm remove id 0 subflow & address Matthieu Baerts
9 siblings, 0 replies; 13+ messages in thread
From: Geliang Tang @ 2023-10-17 3:00 UTC (permalink / raw)
To: mptcp; +Cc: Geliang Tang, Matthieu Baerts
From: Geliang Tang <geliang.tang@suse.com>
The value of 'err' will be not only '-EINVAL', but alse '0' most of the
time. So it's better to rename the lable 'remove_err' to 'out'.
Suggested-by: Matthieu Baerts <matttbe@kernel.org>
Signed-off-by: Geliang Tang <geliang.tang@suse.com>
---
net/mptcp/pm_userspace.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/net/mptcp/pm_userspace.c b/net/mptcp/pm_userspace.c
index ea50e694125d..cdff3e631d2d 100644
--- a/net/mptcp/pm_userspace.c
+++ b/net/mptcp/pm_userspace.c
@@ -276,12 +276,12 @@ int mptcp_pm_nl_remove_doit(struct sk_buff *skb, struct genl_info *info)
if (!mptcp_pm_is_userspace(msk)) {
GENL_SET_ERR_MSG(info, "invalid request; userspace PM not selected");
- goto remove_err;
+ goto out;
}
if (id_val == 0) {
err = mptcp_userspace_remove_id_zero_address(msk, info);
- goto remove_err;
+ goto out;
}
lock_sock(sk);
@@ -296,7 +296,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(sk);
- goto remove_err;
+ goto out;
}
list_move(&match->list, &free_list);
@@ -310,7 +310,7 @@ int mptcp_pm_nl_remove_doit(struct sk_buff *skb, struct genl_info *info)
}
err = 0;
- remove_err:
+out:
sock_put(sk);
return err;
}
--
2.35.3
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH mptcp-next v17 9/9] selftests: mptcp: userspace pm send RM_ADDR for ID 0
2023-10-17 3:00 [PATCH mptcp-next v17 0/9] userspace pm remove id 0 subflow & address Geliang Tang
` (7 preceding siblings ...)
2023-10-17 3:00 ` [PATCH mptcp-next v17 8/9] mptcp: userspace pm rename remove_err to out Geliang Tang
@ 2023-10-17 3:00 ` Geliang Tang
2023-10-17 4:08 ` selftests: mptcp: userspace pm send RM_ADDR for ID 0: Tests Results MPTCP CI
2023-10-22 23:06 ` [PATCH mptcp-next v17 0/9] userspace pm remove id 0 subflow & address Matthieu Baerts
9 siblings, 1 reply; 13+ messages in thread
From: Geliang Tang @ 2023-10-17 3:00 UTC (permalink / raw)
To: mptcp; +Cc: Geliang Tang
From: Geliang Tang <geliang.tang@suse.com>
This patch adds a selftest for userpsace PM to remove id 0 address.
Use userspace_pm_add_addr() helper to add a id 10 address, then use
userspace_pm_rm_addr() helper to remove id 0 address.
Signed-off-by: Geliang Tang <geliang.tang@suse.com>
---
.../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()
--
2.35.3
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: selftests: mptcp: userspace pm send RM_ADDR for ID 0: Tests Results
2023-10-17 3:00 ` [PATCH mptcp-next v17 9/9] selftests: mptcp: userspace pm send RM_ADDR for ID 0 Geliang Tang
@ 2023-10-17 4:08 ` MPTCP CI
0 siblings, 0 replies; 13+ messages in thread
From: MPTCP CI @ 2023-10-17 4:08 UTC (permalink / raw)
To: Geliang Tang; +Cc: mptcp
Hi Geliang,
Thank you for your modifications, that's great!
Our CI did some validations and here is its report:
- KVM Validation: normal (except selftest_mptcp_join):
- Success! ✅:
- Task: https://cirrus-ci.com/task/6363765940158464
- Summary: https://api.cirrus-ci.com/v1/artifact/task/6363765940158464/summary/summary.txt
- KVM Validation: normal (only selftest_mptcp_join):
- Success! ✅:
- Task: https://cirrus-ci.com/task/4956391056605184
- Summary: https://api.cirrus-ci.com/v1/artifact/task/4956391056605184/summary/summary.txt
- KVM Validation: debug (only selftest_mptcp_join):
- Success! ✅:
- Task: https://cirrus-ci.com/task/5519341010026496
- Summary: https://api.cirrus-ci.com/v1/artifact/task/5519341010026496/summary/summary.txt
- KVM Validation: debug (except selftest_mptcp_join):
- Success! ✅:
- Task: https://cirrus-ci.com/task/6082290963447808
- Summary: https://api.cirrus-ci.com/v1/artifact/task/6082290963447808/summary/summary.txt
Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/32eeb039f540
If there are some issues, you can reproduce them using the same environment as
the one used by the CI thanks to a docker image, e.g.:
$ cd [kernel source code]
$ docker run -v "${PWD}:${PWD}:rw" -w "${PWD}" --privileged --rm -it \
--pull always mptcp/mptcp-upstream-virtme-docker:latest \
auto-debug
For more details:
https://github.com/multipath-tcp/mptcp-upstream-virtme-docker
Please note that despite all the efforts that have been already done to have a
stable tests suite when executed on a public CI like here, it is possible some
reported issues are not due to your modifications. Still, do not hesitate to
help us improve that ;-)
Cheers,
MPTCP GH Action bot
Bot operated by Matthieu Baerts (Tessares)
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH mptcp-next v17 0/9] userspace pm remove id 0 subflow & address
2023-10-17 3:00 [PATCH mptcp-next v17 0/9] userspace pm remove id 0 subflow & address Geliang Tang
` (8 preceding siblings ...)
2023-10-17 3:00 ` [PATCH mptcp-next v17 9/9] selftests: mptcp: userspace pm send RM_ADDR for ID 0 Geliang Tang
@ 2023-10-22 23:06 ` Matthieu Baerts
2023-10-22 23:16 ` Matthieu Baerts
9 siblings, 1 reply; 13+ messages in thread
From: Matthieu Baerts @ 2023-10-22 23:06 UTC (permalink / raw)
To: Geliang Tang, mptcp; +Cc: Geliang Tang
Hi Geliang,
On 17/10/2023 05:00, Geliang Tang wrote:
> From: Geliang Tang <geliang.tang@suse.com>
>
> v17:
> - include "fix userspace pm CI failures" series.
> - update __mptcp_has_initial_subflow as Paolo suggested.
> - update chk_subflows_total.
> - update selftests.
Thank you for the new version, it looks good to me!
Reviewed-by: Matthieu Baerts <matttbe@kernel.org>
Now in our tree: a part in 'fixes for -net' and the rest in 'features
for net-next' and this has caused conflicts, please see below:
New patches for t/upstream-net and t/upstream:
- 20c92e1b1473: selftests: mptcp: run userspace pm tests slower
- 54b8c59e976f: selftests: mptcp: fix wait_rm_addr/sf parameters
- a9f72db763e0: mptcp: userspace pm send RM_ADDR for ID 0
- Note that I renamed the new helper to keep the 'mptcp_userspace_pm_'
prefix we can find in other helpers in this file.
- Results: 9a34fc4dbad6..a1d8e0942055 (export-net)
Conflicts:
- 9f7653e25504: conflict in
t/net-mptcp-rename-netlink-handlers-to-mptcp_pm_nl_-blah-_-doit-dumpit
- 1dae6c24941f: conflict in t/mptcp-define-more-local-variables-sk
- bff6a9fde262: conflict in
t/selftests-mptcp-update-userspace-pm-test-helpers
- Results: 65682b5b41eb..554ef3499597 (export)
Squash-to patches:
- 964ed0906f76: "squashed" patch 3/9 in "selftests: mptcp: userspace pm
create id 0 subflow"
- 6a9ab12adf72: "squashed" patch 4/9 in "mptcp: add
mptcpi_subflows_total counter"
- a65a15f44388: "squashed" patch 5/9 in "selftests: mptcp: add
chk_subflows_total helper"
- e5424462cd82: tg:msg: update after the recent squash-to patch
- Results: 554ef3499597..7592debc8c8b (export)
New patches for t/upstream:
- 492717f096ae: mptcp: userspace pm rename remove_err to out
- 702694cb477d: selftests: mptcp: userspace pm send RM_ADDR for ID 0
- Results: 7592debc8c8b..1b6c8d99ae9c (export)
Tests are now in progress:
https://cirrus-ci.com/github/multipath-tcp/mptcp_net-next/export-net/20231022T222301
https://cirrus-ci.com/github/multipath-tcp/mptcp_net-next/export/20231022T230418
Cheers,
Mat
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH mptcp-next v17 0/9] userspace pm remove id 0 subflow & address
2023-10-22 23:06 ` [PATCH mptcp-next v17 0/9] userspace pm remove id 0 subflow & address Matthieu Baerts
@ 2023-10-22 23:16 ` Matthieu Baerts
0 siblings, 0 replies; 13+ messages in thread
From: Matthieu Baerts @ 2023-10-22 23:16 UTC (permalink / raw)
To: Geliang Tang, mptcp; +Cc: Geliang Tang
Hi Geliang,
On 23/10/2023 01:06, Matthieu Baerts wrote:
> Hi Geliang,
>
> On 17/10/2023 05:00, Geliang Tang wrote:
>> From: Geliang Tang <geliang.tang@suse.com>
>>
>> v17:
>> - include "fix userspace pm CI failures" series.
>> - update __mptcp_has_initial_subflow as Paolo suggested.
>> - update chk_subflows_total.
>> - update selftests.
>
> Thank you for the new version, it looks good to me!
>
> Reviewed-by: Matthieu Baerts <matttbe@kernel.org>
>
> Now in our tree: a part in 'fixes for -net' and the rest in 'features
> for net-next' and this has caused conflicts, please see below:
>
> New patches for t/upstream-net and t/upstream:
> - 20c92e1b1473: selftests: mptcp: run userspace pm tests slower
> - 54b8c59e976f: selftests: mptcp: fix wait_rm_addr/sf parameters
> - a9f72db763e0: mptcp: userspace pm send RM_ADDR for ID 0
> - Note that I renamed the new helper to keep the 'mptcp_userspace_pm_'
> prefix we can find in other helpers in this file.
> - Results: 9a34fc4dbad6..a1d8e0942055 (export-net)
>
> Conflicts:
> - 9f7653e25504: conflict in
> t/net-mptcp-rename-netlink-handlers-to-mptcp_pm_nl_-blah-_-doit-dumpit
> - 1dae6c24941f: conflict in t/mptcp-define-more-local-variables-sk
> - bff6a9fde262: conflict in
> t/selftests-mptcp-update-userspace-pm-test-helpers
> - Results: 65682b5b41eb..554ef3499597 (export)
>
> Squash-to patches:
> - 964ed0906f76: "squashed" patch 3/9 in "selftests: mptcp: userspace pm
> create id 0 subflow"
> - 6a9ab12adf72: "squashed" patch 4/9 in "mptcp: add
> mptcpi_subflows_total counter"
> - a65a15f44388: "squashed" patch 5/9 in "selftests: mptcp: add
> chk_subflows_total helper"
> - e5424462cd82: tg:msg: update after the recent squash-to patch
> - Results: 554ef3499597..7592debc8c8b (export)
>
> New patches for t/upstream:
> - 492717f096ae: mptcp: userspace pm rename remove_err to out
> - 702694cb477d: selftests: mptcp: userspace pm send RM_ADDR for ID 0
Oops, I forgot patch 6/9. Just added before "selftests: mptcp: userspace
pm send RM_ADDR for ID 0":
New patches for t/upstream:
- 4118c35872b6: selftests: mptcp: userspace pm remove initial subflow
- ee73a6e81efa: conflict in
t/selftests-mptcp-userspace-pm-send-RM_ADDR-for-ID-0
- Results: 1b6c8d99ae9c..368681114ab6 (export)
Tests are now in progress:
https://cirrus-ci.com/github/multipath-tcp/mptcp_net-next/export/20231022T231456
Cheers,
Matt
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2023-10-22 23:16 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-17 3:00 [PATCH mptcp-next v17 0/9] userspace pm remove id 0 subflow & address Geliang Tang
2023-10-17 3:00 ` [PATCH mptcp-next v17 1/9] selftests: mptcp: run userspace pm tests slower Geliang Tang
2023-10-17 3:00 ` [PATCH mptcp-next v17 2/9] selftests: mptcp: fix wait_rm_addr/sf parameters Geliang Tang
2023-10-17 3:00 ` [PATCH mptcp-next v17 3/9] Squash to "selftests: mptcp: userspace pm create id 0 subflow" Geliang Tang
2023-10-17 3:00 ` [PATCH mptcp-next v17 4/9] Squash to "mptcp: add mptcpi_subflows_total counter" Geliang Tang
2023-10-17 3:00 ` [PATCH mptcp-next v17 5/9] Squash to "selftests: mptcp: add chk_subflows_total helper" Geliang Tang
2023-10-17 3:00 ` [PATCH mptcp-next v17 6/9] selftests: mptcp: userspace pm remove initial subflow Geliang Tang
2023-10-17 3:00 ` [PATCH mptcp-next v17 7/9] mptcp: userspace pm send RM_ADDR for ID 0 Geliang Tang
2023-10-17 3:00 ` [PATCH mptcp-next v17 8/9] mptcp: userspace pm rename remove_err to out Geliang Tang
2023-10-17 3:00 ` [PATCH mptcp-next v17 9/9] selftests: mptcp: userspace pm send RM_ADDR for ID 0 Geliang Tang
2023-10-17 4:08 ` selftests: mptcp: userspace pm send RM_ADDR for ID 0: Tests Results MPTCP CI
2023-10-22 23:06 ` [PATCH mptcp-next v17 0/9] userspace pm remove id 0 subflow & address Matthieu Baerts
2023-10-22 23:16 ` Matthieu Baerts
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.