* [PATCH net-next 00/11] mptcp: pm: drop TCP TS with ADD_ADDRv6 + port
@ 2026-06-01 5:22 Matthieu Baerts (NGI0)
2026-06-01 5:22 ` [PATCH net-next 04/11] mptcp: introduce add_addr_v6_port_drop_ts sysctl knob Matthieu Baerts (NGI0)
0 siblings, 1 reply; 4+ messages in thread
From: Matthieu Baerts (NGI0) @ 2026-06-01 5:22 UTC (permalink / raw)
To: Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Simon Horman
Cc: netdev, mptcp, linux-kernel, Matthieu Baerts (NGI0),
Jonathan Corbet, Shuah Khan, linux-doc, linux-kselftest,
Neal Cardwell, Kuniyuki Iwashima, Shuah Khan
Up to this series, it was possible to add a "signal" MPTCP endpoint with
an IPv6 address and a port, or to directly request to send an ADD_ADDR
with a v6 address and a port, but the expected ADD_ADDR wasn't sent when
TCP timestamps was used for the connection.
In fact, such signalling option cannot be sent when TCP timestamps is
used due to a lack of option space: the limit is at 40 bytes, and, with
padding, TCP timestamps is taking 12 bytes, while an ADD_ADDR IPv6 +
port is taking 30 bytes. The selected solution here is to simply drop
the TCP timestamps option when such ADD_ADDR of 30 bytes needs to be
sent.
- Patches 1-3: small cleanups to avoid computing ADD/RM_ADDR twice.
- Patches 4-7: the new feature, controlled by a new sysctl knob.
- Patch 8: extra checks in the MPTCP Join selftests.
- Patches 9-11: small pcap-related improvements in the selftests.
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
Matthieu Baerts (NGI0) (11):
mptcp: options: suboptions sizes can be negative
mptcp: pm: avoid computing rm_addr size twice
mptcp: pm: avoid computing add_addr size twice
mptcp: introduce add_addr_v6_port_drop_ts sysctl knob
tcp: allow mptcp to drop TS for some packets
mptcp: pm: drop TCP TS with ADD_ADDRv6 + port
selftests: mptcp: validate ADD_ADDRv6 + TS + port
selftests: mptcp: always check sent/dropped ADD_ADDRs
selftests: mptcp: connect: test name in pcap file
selftests: mptcp: simult_flow: test name in pcap file
selftests: mptcp: pcap: drop most of the payload
Documentation/networking/mptcp-sysctl.rst | 13 ++++
include/net/mptcp.h | 3 +-
net/ipv4/tcp_output.c | 6 +-
net/mptcp/ctrl.c | 18 ++++-
net/mptcp/options.c | 64 ++++++----------
net/mptcp/pm.c | 49 +++++++++++--
net/mptcp/protocol.h | 30 +-------
tools/testing/selftests/net/mptcp/mptcp_connect.sh | 8 +-
tools/testing/selftests/net/mptcp/mptcp_join.sh | 85 ++++++++++------------
tools/testing/selftests/net/mptcp/simult_flows.sh | 11 ++-
10 files changed, 159 insertions(+), 128 deletions(-)
---
base-commit: 8415598365503ced2e3d019491b0a2756c85c494
change-id: 20260601-net-next-mptcp-add-addr6-port-ts-40d8d74d8e20
Best regards,
--
Matthieu Baerts (NGI0) <matttbe@kernel.org>
^ permalink raw reply [flat|nested] 4+ messages in thread* [PATCH net-next 04/11] mptcp: introduce add_addr_v6_port_drop_ts sysctl knob 2026-06-01 5:22 [PATCH net-next 00/11] mptcp: pm: drop TCP TS with ADD_ADDRv6 + port Matthieu Baerts (NGI0) @ 2026-06-01 5:22 ` Matthieu Baerts (NGI0) 2026-06-01 5:44 ` Eric Dumazet 0 siblings, 1 reply; 4+ messages in thread From: Matthieu Baerts (NGI0) @ 2026-06-01 5:22 UTC (permalink / raw) To: Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman Cc: netdev, mptcp, linux-kernel, Matthieu Baerts (NGI0), Jonathan Corbet, Shuah Khan, linux-doc, linux-kselftest This sysctl is going to be used in the next commits to drop TCP timestamps option, to be able to send an ADD_ADDR with a v6 IP address and a port number. It is enabled by default. This knob is explicitly disabled in the MPTCP Join selftest, with the "signal addr list progresses after tx drop" subtest, to continue verifying the previous behaviour where the ADD_ADDR is not sent due to a lack of space. While at it, move syn_retrans_before_tcp_fallback down from struct mptcp_pernet, to avoid creating another 3 bytes hole. Reviewed-by: Mat Martineau <martineau@kernel.org> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> --- To: Jonathan Corbet <corbet@lwn.net> To: Shuah Khan <skhan@linuxfoundation.org> Cc: linux-doc@vger.kernel.org Cc: linux-kselftest@vger.kernel.org --- Documentation/networking/mptcp-sysctl.rst | 13 +++++++++++++ net/mptcp/ctrl.c | 18 +++++++++++++++++- net/mptcp/protocol.h | 1 + tools/testing/selftests/net/mptcp/mptcp_join.sh | 1 + 4 files changed, 32 insertions(+), 1 deletion(-) diff --git a/Documentation/networking/mptcp-sysctl.rst b/Documentation/networking/mptcp-sysctl.rst index 1eb6af26b4a7..b9b5f58e0625 100644 --- a/Documentation/networking/mptcp-sysctl.rst +++ b/Documentation/networking/mptcp-sysctl.rst @@ -21,6 +21,19 @@ add_addr_timeout - INTEGER (seconds) Default: 120 +add_addr_v6_port_drop_ts - BOOLEAN + Control whether preparing an ADD_ADDR with an IPv6 address and a port + should drop the TCP timestamps option to have enough option space to + send the signal. + + If there is not enough option space, and the TCP timestamps option + cannot be dropped, the signal cannot be sent. Note that dropping the TCP + timestamps option for one packet of the connection could disrupt some + middleboxes: even if it should be unlikely, they could drop the packet + or block the connection. This is a per-namespace sysctl. + + Default: 1 (enabled) + allow_join_initial_addr_port - BOOLEAN Allow peers to send join requests to the IP address and port number used by the initial subflow if the value is 1. This controls a flag that is diff --git a/net/mptcp/ctrl.c b/net/mptcp/ctrl.c index d96130e49942..c94a192f4118 100644 --- a/net/mptcp/ctrl.c +++ b/net/mptcp/ctrl.c @@ -32,12 +32,13 @@ struct mptcp_pernet { unsigned int close_timeout; unsigned int stale_loss_cnt; atomic_t active_disable_times; - u8 syn_retrans_before_tcp_fallback; unsigned long active_disable_stamp; + u8 syn_retrans_before_tcp_fallback; u8 mptcp_enabled; u8 checksum_enabled; u8 allow_join_initial_addr_port; u8 pm_type; + u8 add_addr_v6_port_drop_ts; char scheduler[MPTCP_SCHED_NAME_MAX]; char path_manager[MPTCP_PM_NAME_MAX]; }; @@ -94,6 +95,11 @@ const char *mptcp_get_scheduler(const struct net *net) return mptcp_get_pernet(net)->scheduler; } +unsigned int mptcp_add_addr_v6_port_drop_ts(const struct net *net) +{ + return mptcp_get_pernet(net)->add_addr_v6_port_drop_ts; +} + static void mptcp_pernet_set_defaults(struct mptcp_pernet *pernet) { pernet->mptcp_enabled = 1; @@ -108,6 +114,7 @@ static void mptcp_pernet_set_defaults(struct mptcp_pernet *pernet) pernet->pm_type = MPTCP_PM_TYPE_KERNEL; strscpy(pernet->scheduler, "default", sizeof(pernet->scheduler)); strscpy(pernet->path_manager, "kernel", sizeof(pernet->path_manager)); + pernet->add_addr_v6_port_drop_ts = 1; } #ifdef CONFIG_SYSCTL @@ -362,6 +369,14 @@ static struct ctl_table mptcp_sysctl_table[] = { .mode = 0444, .proc_handler = proc_available_path_managers, }, + { + .procname = "add_addr_v6_port_drop_ts", + .maxlen = sizeof(u8), + .mode = 0644, + .proc_handler = proc_dou8vec_minmax, + .extra1 = SYSCTL_ZERO, + .extra2 = SYSCTL_ONE + }, }; static int mptcp_pernet_new_table(struct net *net, struct mptcp_pernet *pernet) @@ -389,6 +404,7 @@ static int mptcp_pernet_new_table(struct net *net, struct mptcp_pernet *pernet) table[10].data = &pernet->syn_retrans_before_tcp_fallback; table[11].data = &pernet->path_manager; /* table[12] is for available_path_managers which is read-only info */ + table[13].data = &pernet->add_addr_v6_port_drop_ts; hdr = register_net_sysctl_sz(net, MPTCP_SYSCTL_PATH, table, ARRAY_SIZE(mptcp_sysctl_table)); diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h index e0ffebaa6795..f4276980d78a 100644 --- a/net/mptcp/protocol.h +++ b/net/mptcp/protocol.h @@ -798,6 +798,7 @@ unsigned int mptcp_close_timeout(const struct sock *sk); int mptcp_get_pm_type(const struct net *net); const char *mptcp_get_path_manager(const struct net *net); const char *mptcp_get_scheduler(const struct net *net); +unsigned int mptcp_add_addr_v6_port_drop_ts(const struct net *net); void mptcp_active_disable(struct sock *sk); bool mptcp_active_should_disable(struct sock *ssk); diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index 5d4d0f127f79..23b17957686a 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -3313,6 +3313,7 @@ add_addr_ports_tests() if reset "signal addr list progresses after tx drop"; then pm_nl_set_limits $ns1 0 2 pm_nl_set_limits $ns2 1 0 + ip netns exec $ns1 sysctl -q net.mptcp.add_addr_v6_port_drop_ts=0 2>/dev/null || true ip netns exec $ns1 sysctl -q net.ipv4.tcp_timestamps=1 ip netns exec $ns2 sysctl -q net.ipv4.tcp_timestamps=1 -- 2.53.0 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net-next 04/11] mptcp: introduce add_addr_v6_port_drop_ts sysctl knob 2026-06-01 5:22 ` [PATCH net-next 04/11] mptcp: introduce add_addr_v6_port_drop_ts sysctl knob Matthieu Baerts (NGI0) @ 2026-06-01 5:44 ` Eric Dumazet 2026-06-01 6:04 ` Matthieu Baerts 0 siblings, 1 reply; 4+ messages in thread From: Eric Dumazet @ 2026-06-01 5:44 UTC (permalink / raw) To: Matthieu Baerts (NGI0) Cc: Mat Martineau, Geliang Tang, David S. Miller, Jakub Kicinski, Paolo Abeni, Simon Horman, netdev, mptcp, linux-kernel, Jonathan Corbet, Shuah Khan, linux-doc, linux-kselftest On Sun, May 31, 2026 at 10:24 PM Matthieu Baerts (NGI0) <matttbe@kernel.org> wrote: > > This sysctl is going to be used in the next commits to drop TCP > timestamps option, to be able to send an ADD_ADDR with a v6 IP address > and a port number. It is enabled by default. > > This knob is explicitly disabled in the MPTCP Join selftest, with the > "signal addr list progresses after tx drop" subtest, to continue > verifying the previous behaviour where the ADD_ADDR is not sent due to a > lack of space. > > While at it, move syn_retrans_before_tcp_fallback down from struct > mptcp_pernet, to avoid creating another 3 bytes hole. > > Reviewed-by: Mat Martineau <martineau@kernel.org> > Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> ... > }; > @@ -94,6 +95,11 @@ const char *mptcp_get_scheduler(const struct net *net) > return mptcp_get_pernet(net)->scheduler; > } > > +unsigned int mptcp_add_addr_v6_port_drop_ts(const struct net *net) > +{ > + return mptcp_get_pernet(net)->add_addr_v6_port_drop_ts; > +} Please use READ_ONCE() over sysctls. This will avoid future patches from KCSAN bots. ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next 04/11] mptcp: introduce add_addr_v6_port_drop_ts sysctl knob 2026-06-01 5:44 ` Eric Dumazet @ 2026-06-01 6:04 ` Matthieu Baerts 0 siblings, 0 replies; 4+ messages in thread From: Matthieu Baerts @ 2026-06-01 6:04 UTC (permalink / raw) To: Eric Dumazet Cc: Mat Martineau, Geliang Tang, David S. Miller, Jakub Kicinski, Paolo Abeni, Simon Horman, netdev, mptcp, linux-kernel, Jonathan Corbet, Shuah Khan, linux-doc, linux-kselftest Hi Eric, On 01/06/2026 15:44, Eric Dumazet wrote: > On Sun, May 31, 2026 at 10:24 PM Matthieu Baerts (NGI0) > <matttbe@kernel.org> wrote: >> >> This sysctl is going to be used in the next commits to drop TCP >> timestamps option, to be able to send an ADD_ADDR with a v6 IP address >> and a port number. It is enabled by default. >> >> This knob is explicitly disabled in the MPTCP Join selftest, with the >> "signal addr list progresses after tx drop" subtest, to continue >> verifying the previous behaviour where the ADD_ADDR is not sent due to a >> lack of space. >> >> While at it, move syn_retrans_before_tcp_fallback down from struct >> mptcp_pernet, to avoid creating another 3 bytes hole. >> >> Reviewed-by: Mat Martineau <martineau@kernel.org> >> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> > > ... > >> }; >> @@ -94,6 +95,11 @@ const char *mptcp_get_scheduler(const struct net *net) >> return mptcp_get_pernet(net)->scheduler; >> } >> >> +unsigned int mptcp_add_addr_v6_port_drop_ts(const struct net *net) >> +{ >> + return mptcp_get_pernet(net)->add_addr_v6_port_drop_ts; >> +} > > Please use READ_ONCE() over sysctls. > This will avoid future patches from KCSAN bots. Good point, I will do that. I see READ_ONCE() should be used over all other MPTCP sysctls. I can send fixes to net for those. Cheers, Matt -- Sponsored by the NGI0 Core fund. ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-06-01 6:04 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-06-01 5:22 [PATCH net-next 00/11] mptcp: pm: drop TCP TS with ADD_ADDRv6 + port Matthieu Baerts (NGI0) 2026-06-01 5:22 ` [PATCH net-next 04/11] mptcp: introduce add_addr_v6_port_drop_ts sysctl knob Matthieu Baerts (NGI0) 2026-06-01 5:44 ` Eric Dumazet 2026-06-01 6:04 ` Matthieu Baerts
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox