From: Mat Martineau <martineau@kernel.org> Date: 2023-10-25 23:37:15
This series includes three initial patches that we had queued in our
mptcp-net branch, but given the likely timing of net/net-next syncs this
week, the need to avoid introducing branch conflicts, and another batch
of net-next patches pending in the mptcp tree, the most practical route
is to send everything for net-next.
Patches 1 & 2 fix some intermittent selftest failures by adjusting timing.
Patch 3 removes an unneccessary userspace path manager restriction on
the removal of subflows with subflow ID 0.
The remainder of the patches are all cleanup or selftest changes:
Patches 4-8 clean up kernel code by removing unused parameters, making
more consistent use of existing helper functions, and reducing extra
casting of socket pointers.
Patch 9 removes an unused variable in a selftest script.
Patch 10 adds a little more detail to some mptcp_join test output.
Signed-off-by: Mat Martineau <martineau@kernel.org>
---
Geliang Tang (10):
selftests: mptcp: run userspace pm tests slower
selftests: mptcp: fix wait_rm_addr/sf parameters
mptcp: userspace pm send RM_ADDR for ID 0
mptcp: drop useless ssk in pm_subflow_check_next
mptcp: use mptcp_check_fallback helper
mptcp: use mptcp_get_ext helper
mptcp: move sk assignment statement ahead
mptcp: define more local variables sk
selftests: mptcp: sockopt: drop mptcp_connect var
selftests: mptcp: display simult in extra_msg
net/mptcp/pm.c | 2 +-
net/mptcp/pm_userspace.c | 81 +++++++++++++++++-----
net/mptcp/protocol.c | 6 +-
net/mptcp/protocol.h | 4 +-
net/mptcp/sockopt.c | 2 +-
tools/testing/selftests/net/mptcp/mptcp_join.sh | 23 ++++--
tools/testing/selftests/net/mptcp/mptcp_sockopt.sh | 1 -
7 files changed, 88 insertions(+), 31 deletions(-)
---
base-commit: 8846f9a04b10b7f61214425409838d764df7080d
change-id: 20231025-send-net-next-20231025-6bd0ee2d8d7d
Best regards,
--
Mat Martineau [off-list ref]
@@ -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: Mat Martineau <martineau@kernel.org> Date: 2023-10-25 23:37:14
From: Geliang Tang <redacted>
'(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 <matttbe@kernel.org>
Signed-off-by: Geliang Tang <redacted>
Signed-off-by: Mat Martineau <martineau@kernel.org>
---
net/mptcp/pm_userspace.c | 31 ++++++++++++++++++++-----------
1 file changed, 20 insertions(+), 11 deletions(-)
@@ -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((structsock*)msk);+release_sock(sk);gotoremove_err;}
From: Mat Martineau <martineau@kernel.org> Date: 2023-10-25 23:37:14
From: Geliang Tang <redacted>
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 <matttbe@kernel.org>
Signed-off-by: Geliang Tang <redacted>
Signed-off-by: Mat Martineau <martineau@kernel.org>
---
net/mptcp/pm_userspace.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
From: Mat Martineau <martineau@kernel.org> Date: 2023-10-25 23:37:14
From: Geliang Tang <redacted>
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 <matttbe@kernel.org>
Signed-off-by: Geliang Tang <redacted>
Signed-off-by: Mat Martineau <martineau@kernel.org>
---
tools/testing/selftests/net/mptcp/mptcp_sockopt.sh | 1 -
1 file changed, 1 deletion(-)
From: Mat Martineau <martineau@kernel.org> Date: 2023-10-25 23:37:14
From: Geliang Tang <redacted>
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 <matttbe@kernel.org>
Signed-off-by: Geliang Tang <redacted>
Signed-off-by: Mat Martineau <martineau@kernel.org>
---
tools/testing/selftests/net/mptcp/mptcp_join.sh | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
@@ -1770,7 +1770,10 @@ chk_rm_nr()# in case of simult flush, the subflow removal count on each side is# unreliablecount=$((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"+fiif[$count-ge"$rm_subflow_nr"]&&\["$count"-le"$((rm_subflow_nr*2))"];thenprint_ok"$suffix"
From: Mat Martineau <martineau@kernel.org> Date: 2023-10-25 23:37:16
From: Geliang Tang <redacted>
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 <matttbe@kernel.org>
Reviewed-by: Matthieu Baerts <matttbe@kernel.org>
Signed-off-by: Geliang Tang <redacted>
Signed-off-by: Mat Martineau <martineau@kernel.org>
---
tools/testing/selftests/net/mptcp/mptcp_join.sh | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
From: Mat Martineau <martineau@kernel.org> Date: 2023-10-25 23:37:17
From: Geliang Tang <redacted>
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 <matttbe@kernel.org>
Signed-off-by: Geliang Tang <redacted>
Signed-off-by: Mat Martineau <martineau@kernel.org>
---
net/mptcp/pm_userspace.c | 39 +++++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)
@@ -208,6 +208,40 @@ int mptcp_pm_nl_announce_doit(struct sk_buff *skb, struct genl_info *info)returnerr;}+staticintmptcp_userspace_pm_remove_id_zero_address(structmptcp_sock*msk,+structgenl_info*info)+{+structmptcp_rm_listlist={.nr=0};+structmptcp_subflow_context*subflow;+structsock*sk=(structsock*)msk;+boolhas_id_0=false;+interr=-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");+gotoremove_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);+returnerr;+}+intmptcp_pm_nl_remove_doit(structsk_buff*skb,structgenl_info*info){structnlattr*token=info->attrs[MPTCP_PM_ATTR_TOKEN];
From: Mat Martineau <martineau@kernel.org> Date: 2023-10-25 23:37:17
From: Geliang Tang <redacted>
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 <matttbe@kernel.org>
Signed-off-by: Geliang Tang <redacted>
Signed-off-by: Mat Martineau <martineau@kernel.org>
---
tools/testing/selftests/net/mptcp/mptcp_join.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
CC: stable@ + net-next really doesn't make sense.
Either it's important or it's not. Which one do you pick?
Hi Jakub -
This is what I was attempting to explain in the cover letter:
This series includes three initial patches that we had queued in our
mptcp-net branch, but given the likely timing of net/net-next syncs this
week, the need to avoid introducing branch conflicts, and another batch
of net-next patches pending in the mptcp tree, the most practical route
is to send everything for net-next.
So, that's the reasoning, but I'll send v2 without the cc's.
- Mat
From: Jakub Kicinski <kuba@kernel.org> Date: 2023-10-27 15:43:27
On Fri, 27 Oct 2023 08:34:27 -0700 (PDT) Mat Martineau wrote:
quoted
This series includes three initial patches that we had queued in our
mptcp-net branch, but given the likely timing of net/net-next syncs this
week, the need to avoid introducing branch conflicts, and another batch
of net-next patches pending in the mptcp tree, the most practical route
is to send everything for net-next.
So, that's the reasoning, but I'll send v2 without the cc's.
From: Mat Martineau <martineau@kernel.org> Date: 2023-10-27 15:45:54
On Fri, 27 Oct 2023, Jakub Kicinski wrote:
On Fri, 27 Oct 2023 08:34:27 -0700 (PDT) Mat Martineau wrote:
quoted
quoted
This series includes three initial patches that we had queued in our
mptcp-net branch, but given the likely timing of net/net-next syncs this
week, the need to avoid introducing branch conflicts, and another batch
of net-next patches pending in the mptcp tree, the most practical route
is to send everything for net-next.
So, that's the reasoning, but I'll send v2 without the cc's.
From: Jakub Kicinski <kuba@kernel.org> Date: 2023-10-27 15:53:25
On Fri, 27 Oct 2023 08:45:53 -0700 (PDT) Mat Martineau wrote:
quoted
No need, I can strip when applying.
Thanks Jakub, appreciate this!
What's the reset of the stuff you have for 6.7, tho?
The net-next PR comes out today, unless it's really trivial cleanups
and/or selftest changes it's probably already too late :(
Assuming MW doesn't get postponed.
Hello:
This series was applied to netdev/net-next.git (main)
by Jakub Kicinski [off-list ref]:
On Wed, 25 Oct 2023 16:37:01 -0700 you wrote:
This series includes three initial patches that we had queued in our
mptcp-net branch, but given the likely timing of net/net-next syncs this
week, the need to avoid introducing branch conflicts, and another batch
of net-next patches pending in the mptcp tree, the most practical route
is to send everything for net-next.
Patches 1 & 2 fix some intermittent selftest failures by adjusting timing.
[...]