mptcp: disable add_addr retrans
Subsystems (4)
Geliang Tang
reviewerv2 cover mptcp: disable add_addr retrans
From: Geliang Tang <[email protected]>
v2:
- move "remove duplicate sk_reset_timer call" into this set.
- check add_addr timeout value in mptcp_pm_alloc_anno_list() too.
This series enhances MPTCP's ADD_ADDR retransmission mechanism by:
1. Adding support for disabling retransmissions when add_addr_timeout is set to 0
2. Modifying the self-tests to leverage this new capability
The first patch implements the core functionality change in the MPTCP subsystem, while the second patch updates the selftests to use this feature for stabilizing a specific test case.
These changes provide more control over ADD_ADDR behavior and improve test reliability by eliminating race conditions caused by unexpected retransmissions.
Patch 1: Remove duplicate sk_reset_timer call
Patch 2: When add_addr_timeout is 0, skip retransmission entirely Patch 3: Disable retransmissions in "delete re-add signal" test
Geliang Tang (3):
mptcp: remove duplicate sk_reset_timer call
mptcp: disable add_addr retransmission when timeout is 0
selftests: mptcp: disable add_addr retrans in endpoint_tests
Documentation/networking/mptcp-sysctl.rst | 2 ++ net/mptcp/pm.c | 18 ++++++++++++------ .../testing/selftests/net/mptcp/mptcp_join.sh | 1 + 3 files changed, 15 insertions(+), 6 deletions(-)
Signature · 1 line
2.48.1
Geliang Tang
reviewerPATCH v2 1/3 mptcp: remove duplicate sk_reset_timer call
From: Geliang Tang <[email protected]>
sk_reset_timer() was called twice in mptcp_pm_alloc_anno_list. Simplify the code by using a 'goto' statement to eliminate the duplication.
--- net/mptcp/pm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
net/mptcp/pm.c +2 -3
@@ -353,9 +353,7 @@ bool mptcp_pm_alloc_anno_list(struct mptcp_sock *msk,if (WARN_ON_ONCE (mptcp_pm_is_kernel (msk)))return false; -sk_reset_timer (sk, &add_entry->add_timer, - jiffies +mptcp_get_add_addr_timeout (net)); -return true; + goto reset_timer; } add_entry =kmalloc (sizeof (*add_entry),GFP_ATOMIC );
@@ -369,6 +367,7 @@ bool mptcp_pm_alloc_anno_list(struct mptcp_sock *msk, add_entry->retrans_times =0 ;timer_setup (&add_entry->add_timer, mptcp_pm_add_timer,0 ); +reset_timer:sk_reset_timer (sk, &add_entry->add_timer, jiffies +mptcp_get_add_addr_timeout (net));
Signature · 1 line
2.48.1
Geliang Tang
reviewerPATCH v2 2/3 mptcp: disable add_addr retransmission when timeout is 0
In reply to Geliang TangFrom: Geliang Tang <[email protected]>
When add_addr_timeout was set to 0, this caused the ADD_ADDR to be retransmitted immediately, which looks like a buggy behaviour. Instead, interpret 0 as "no retransmissions needed".
The documentation is updated to explicitly state that setting the timeout to 0 disables retransmission.
--- Documentation/networking/mptcp-sysctl.rst | 2 ++ net/mptcp/pm.c | 13 ++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-)
Documentation/networking/mptcp-sysctl.rst +2 -0
@@ -12,6 +12,8 @@ add_addr_timeout - INTEGER (seconds) resent to an MPTCP peer that has not acknowledged a previous ADD_ADDR message. + Do not retransmit if set to 0. + The default value matches TCP_RTO_MAX. This is a per-namespace sysctl.
net/mptcp/pm.c +10 -3
@@ -274,6 +274,7 @@ static void mptcp_pm_add_timer(struct timer_list *timer) add_timer);struct mptcp_sock *msk = entry->sock;struct sock *sk = (struct sock *)msk; +unsigned int timeout;pr_debug ("msk=%p\n" , msk);
@@ -291,6 +292,10 @@ static void mptcp_pm_add_timer(struct timer_list *timer) goto out; } + timeout =mptcp_get_add_addr_timeout (sock_net (sk)); +if (!timeout) + goto out; +spin_lock_bh (&msk->pm.lock);if (!mptcp_pm_should_add_signal_addr (msk)) {
@@ -302,7 +307,7 @@ static void mptcp_pm_add_timer(struct timer_list *timer)if (entry->retrans_times <ADD_ADDR_RETRANS_MAX )sk_reset_timer (sk, timer, - jiffies +mptcp_get_add_addr_timeout (sock_net (sk))); + jiffies + timeout);spin_unlock_bh (&msk->pm.lock);
@@ -344,6 +349,7 @@ bool mptcp_pm_alloc_anno_list(struct mptcp_sock *msk,struct mptcp_pm_add_entry *add_entry =NULL ;struct sock *sk = (struct sock *)msk;struct net *net =sock_net (sk); +unsigned int timeout;lockdep_assert_held (&msk->pm.lock);
@@ -368,8 +374,9 @@ bool mptcp_pm_alloc_anno_list(struct mptcp_sock *msk,timer_setup (&add_entry->add_timer, mptcp_pm_add_timer,0 ); reset_timer: -sk_reset_timer (sk, &add_entry->add_timer, - jiffies +mptcp_get_add_addr_timeout (net)); + timeout =mptcp_get_add_addr_timeout (net); +if (timeout) +sk_reset_timer (sk, &add_entry->add_timer, jiffies + timeout);return true; }
Signature · 1 line
2.48.1
Geliang Tang
reviewerPATCH v2 3/3 selftests: mptcp: disable add_addr retrans in endpoint_tests
In reply to Geliang TangFrom: Geliang Tang <[email protected]>
To prevent test instability in the "delete re-add signal" test caused by ADD_ADDR retransmissions, disable retransmissions for this test by setting net.mptcp.add_addr_timeout to 0.
--- tools/testing/selftests/net/mptcp/mptcp_join.sh | 1 + 1 file changed, 1 insertion(+)
tools/testing/selftests/net/mptcp/mptcp_join.sh +1 -0
@@ -3842,6 +3842,7 @@ endpoint_tests() # remove and re-add if reset_with_events "delete re-add signal" && mptcp_lib_kallsyms_has "subflow_rebuild_header$"; then + ip netns exec $ns1 sysctl -q net.mptcp.add_addr_timeout=0 pm_nl_set_limits $ns1 0 3 pm_nl_set_limits $ns2 3 3 pm_nl_add_endpoint $ns1 10.0.2.1 id 1 flags signal
Signature · 1 line
2.48.1
Hi Geliang,
Thank you for your modifications, that's great!
Our CI did some validations and here is its report:
- KVM Validation: normal: Success! ✅
- KVM Validation: debug: Success! ✅
- KVM Validation: btf-normal (only bpftest_all): Success! ✅
- KVM Validation: btf-debug (only bpftest_all): Success! ✅
- Task: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/16794019654
Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/399555cff786
Patchwork: https://patchwork.kernel.org/project/mptcp/list/?series=988945
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-normalFor 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 (NGI0 Core)
Hi Geliang,
Quoted 16 lines · Geliang Tang
From: Geliang Tang <[email protected]>
v2:
- move "remove duplicatesk_reset_timercall" into this set.
- checkadd_addrtimeout value inmptcp_pm_alloc_anno_list()too.This series enhances MPTCP's
ADD_ADDRretransmission mechanism by:1. Adding support for disabling retransmissions when
add_addr_timeoutis set to 0
2. Modifying the self-tests to leverage this new capabilityThe first patch implements the core functionality change in the MPTCP subsystem, while the second patch updates the selftests to use this feature for stabilizing a specific test case.
Quoted 7 lines
These changes provide more control over
ADD_ADDRbehavior and improve test reliability by eliminating race conditions caused by unexpected retransmissions.Patch 1: Remove duplicate
sk_reset_timercall
Patch 2: Whenadd_addr_timeoutis 0, skip retransmission entirely Patch 3: Disable retransmissions in "delete re-add signal" test
Thank you for the new version. It looks good to me:
I will just check with Mat if we consider this as a fix or not. I think it is, but the behaviour is slightly changed, even if it is to avoid a buggy one. I will then apply these patches after the next bi-weekly meeting.
Cheers,
Matt
Signature · 1 line
Sponsored by the NGI0 Core fund.
Hi Geliang,
Quoted 27 lines · Matthieu Baerts
Hi Geliang,
Quoted 16 lines · Geliang Tang
From: Geliang Tang <[email protected]>
v2:
- move "remove duplicatesk_reset_timercall" into this set.
- checkadd_addrtimeout value inmptcp_pm_alloc_anno_list()too.This series enhances MPTCP's
ADD_ADDRretransmission mechanism by:1. Adding support for disabling retransmissions when
add_addr_timeoutis set to 0
2. Modifying the self-tests to leverage this new capabilityThe first patch implements the core functionality change in the MPTCP subsystem, while the second patch updates the selftests to use this feature for stabilizing a specific test case.
Quoted 7 lines
These changes provide more control over
ADD_ADDRbehavior and improve test reliability by eliminating race conditions caused by unexpected retransmissions.Patch 1: Remove duplicate
sk_reset_timercall
Patch 2: Whenadd_addr_timeoutis 0, skip retransmission entirely Patch 3: Disable retransmissions in "delete re-add signal" test
Quoted 7 lines
Thank you for the new version. It looks good to me:
Reviewed-by Matthieu Baerts (NGI0) <[email protected]>I will just check with Mat if we consider this as a fix or not. I think it is, but the behaviour is slightly changed, even if it is to avoid a buggy one. I will then apply these patches after the next bi-weekly meeting.
Applied to our tree (fixes for -net):
New patches for t/upstream-net and t/upstream:
- 144959b26e16: mptcp: remove duplicate sk_reset_timer call
- 5ca4045882f9: mptcp: disable add_addr retransmission when timeout is 0
- 230c29e8aa90: selftests: mptcp: disable add_addr retrans in endpoint_tests
- Results: 3f23a1fbaa6a..077ce244fe7b (export-net)
- Results: 7c14230bb733..186cac2c4d81 (export)
Tests are now in progress:
- export-net:
https://github.com/multipath-tcp/mptcp_net-next/commit/097661ebac60d8cf1b143a91f6f11c71ef9fc5f5/checks
- export:
https://github.com/multipath-tcp/mptcp_net-next/commit/576e85a3c313b3b1ea09f8369458e2c31784b99b/checks
Cheers,
Matt
Signature · 1 line
Sponsored by the NGI0 Core fund.