* [PATCH net-next 00/15] mptcp: misc. features for v6.20/7.0
@ 2026-02-03 18:41 Matthieu Baerts (NGI0)
2026-02-03 18:41 ` [PATCH net-next 01/15] mptcp: do not account for OoO in mptcp_rcvbuf_grow() Matthieu Baerts (NGI0)
` (15 more replies)
0 siblings, 16 replies; 20+ messages in thread
From: Matthieu Baerts (NGI0) @ 2026-02-03 18:41 UTC (permalink / raw)
To: Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Simon Horman, Shuah Khan
Cc: netdev, mptcp, linux-kernel, linux-kselftest,
Matthieu Baerts (NGI0), Steven Rostedt, Masami Hiramatsu,
Mathieu Desnoyers, linux-trace-kernel, David Laight, Gang Yan,
Thomas Weißschuh, Geliang Tang
This series contains a few independent new features, and small fixes for
net-next:
- Patches 1-2: two small fixes linked to the MPTCP receive buffer that
are not urgent, requiring code that has been recently changed, and is
needed for the next patch. Because we are at the end of the cycle, it
seems easier to send them to net-next, instead of dealing with
conflicts between net and net-next.
- Patch 3: a refactoring to simplify the code around MPTCP DRS.
- Patch 4: a new trace event for MPTCP to help debugging receive buffer
auto-tuning issues.
- Patch 5: align internal MPTCP PM structure with NL specs, just to
manipulate the same thing.
- Patch 6: convert some min_t(int, ...) to min(): cleaner, and to avoid
future warnings.
- Patch 7: prepare future extensions replacing sk_write_space().
- Patch 8: sort all #include in MPTCP Diag tool in the selftests to
prevent future potential conflicts and ease the reading.
- Patches 9-11: improve the MPTCP Join selftest by waiting for an event
instead of a "random" sleep.
- Patches 12-14: some small cleanups in the selftests, seen while
working on the previous patches.
- Patch 15: avoid marking subtests as skipped while still validating
most checks when executing the last MPTCP selftests on older kernels.
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
David Laight (1):
mptcp: Change some dubious min_t(int, ...) to min()
Geliang Tang (1):
mptcp: allow overridden write_space to be invoked
Matthieu Baerts (NGI0) (9):
mptcp: pm: align endpoint flags size with the NL specs
selftests: mptcp: diag: sort all #include
selftests: mptcp: join: wait for estab event instead of MPJ
selftests: mptcp: join: fix wait_mpj helper
selftests: mptcp: join: userspace: wait for new events
selftests: mptcp: join chk_stale_nr: avoid dup stats
selftests: mptcp: join: avoid declaring i if not used
selftests: mptcp: connect cleanup TFO setup
selftests: mptcp: join: no SKIP mark for group checks
Paolo Abeni (4):
mptcp: do not account for OoO in mptcp_rcvbuf_grow()
mptcp: fix receive space timestamp initialization
mptcp: consolidate rcv space init
trace: mptcp: add mptcp_rcvbuf_grow tracepoint
include/trace/events/mptcp.h | 80 ++++++++++++++++
net/mptcp/protocol.c | 56 ++++++-----
net/mptcp/protocol.h | 12 ++-
net/mptcp/subflow.c | 2 -
tools/testing/selftests/net/mptcp/mptcp_connect.c | 17 ++--
tools/testing/selftests/net/mptcp/mptcp_diag.c | 29 +++---
tools/testing/selftests/net/mptcp/mptcp_join.sh | 107 +++++++++++-----------
7 files changed, 189 insertions(+), 114 deletions(-)
---
base-commit: fae1c659d7bd5640012be21b5b5d6490b83c0df8
change-id: 20260128-net-next-mptcp-misc-feat-6-20-0eb96b13bc4a
Best regards,
--
Matthieu Baerts (NGI0) <matttbe@kernel.org>
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH net-next 01/15] mptcp: do not account for OoO in mptcp_rcvbuf_grow()
2026-02-03 18:41 [PATCH net-next 00/15] mptcp: misc. features for v6.20/7.0 Matthieu Baerts (NGI0)
@ 2026-02-03 18:41 ` Matthieu Baerts (NGI0)
2026-02-03 18:41 ` [PATCH net-next 02/15] mptcp: fix receive space timestamp initialization Matthieu Baerts (NGI0)
` (14 subsequent siblings)
15 siblings, 0 replies; 20+ messages in thread
From: Matthieu Baerts (NGI0) @ 2026-02-03 18:41 UTC (permalink / raw)
To: Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Simon Horman, Shuah Khan
Cc: netdev, mptcp, linux-kernel, linux-kselftest,
Matthieu Baerts (NGI0)
From: Paolo Abeni <pabeni@redhat.com>
MPTCP-level OoOs are physiological when multiple subflows are active
concurrently and will not cause retransmissions nor are caused by
drops.
Accounting for them in mptcp_rcvbuf_grow() causes the rcvbuf slowly
drifting towards tcp_rmem[2].
Remove such accounting. Note that subflows will still account for TCP-level
OoO when the MPTCP-level rcvbuf is propagated.
This also closes a subtle and very unlikely race condition with rcvspace
init; active sockets with user-space holding the msk-level socket lock,
could complete such initialization in the receive callback, after that the
first OoO data reaches the rcvbuf and potentially triggering a divide by
zero Oops.
Fixes: e118cdc34dd1 ("mptcp: rcvbuf auto-tuning improvement")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
net/mptcp/protocol.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 9b8c51937eb2..758a6dcb1d7b 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -224,9 +224,6 @@ static bool mptcp_rcvbuf_grow(struct sock *sk, u32 newval)
do_div(grow, oldval);
rcvwin += grow << 1;
- if (!RB_EMPTY_ROOT(&msk->out_of_order_queue))
- rcvwin += MPTCP_SKB_CB(msk->ooo_last_skb)->end_seq - msk->ack_seq;
-
cap = READ_ONCE(net->ipv4.sysctl_tcp_rmem[2]);
rcvbuf = min_t(u32, mptcp_space_from_win(sk, rcvwin), cap);
@@ -350,9 +347,6 @@ static void mptcp_data_queue_ofo(struct mptcp_sock *msk, struct sk_buff *skb)
end:
skb_condense(skb);
skb_set_owner_r(skb, sk);
- /* do not grow rcvbuf for not-yet-accepted or orphaned sockets. */
- if (sk->sk_socket)
- mptcp_rcvbuf_grow(sk, msk->rcvq_space.space);
}
static void mptcp_init_skb(struct sock *ssk, struct sk_buff *skb, int offset,
--
2.51.0
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH net-next 02/15] mptcp: fix receive space timestamp initialization
2026-02-03 18:41 [PATCH net-next 00/15] mptcp: misc. features for v6.20/7.0 Matthieu Baerts (NGI0)
2026-02-03 18:41 ` [PATCH net-next 01/15] mptcp: do not account for OoO in mptcp_rcvbuf_grow() Matthieu Baerts (NGI0)
@ 2026-02-03 18:41 ` Matthieu Baerts (NGI0)
2026-02-03 18:41 ` [PATCH net-next 03/15] mptcp: consolidate rcv space init Matthieu Baerts (NGI0)
` (13 subsequent siblings)
15 siblings, 0 replies; 20+ messages in thread
From: Matthieu Baerts (NGI0) @ 2026-02-03 18:41 UTC (permalink / raw)
To: Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Simon Horman, Shuah Khan
Cc: netdev, mptcp, linux-kernel, linux-kselftest,
Matthieu Baerts (NGI0)
From: Paolo Abeni <pabeni@redhat.com>
MPTCP initialize the receive buffer stamp in mptcp_rcv_space_init(),
using the provided subflow stamp. Such helper is invoked in several
places; for passive sockets, space init happened at clone time.
In such scenario, MPTCP ends-up accesses the subflow stamp before
its initialization, leading to quite randomic timing for the first
receive buffer auto-tune event, as the timestamp for newly created
subflow is not refreshed there.
Fix the issue moving the stamp initialization out of the mentioned helper,
at the data transfer start, and always using a fresh timestamp.
Fixes: 013e3179dbd2 ("mptcp: fix rcv space initialization")
Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
net/mptcp/protocol.c | 8 ++++----
net/mptcp/protocol.h | 5 +++++
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 758a6dcb1d7b..8d16ed00fcb4 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -2087,8 +2087,8 @@ static void mptcp_rcv_space_adjust(struct mptcp_sock *msk, int copied)
msk->rcvq_space.copied += copied;
- mstamp = div_u64(tcp_clock_ns(), NSEC_PER_USEC);
- time = tcp_stamp_us_delta(mstamp, msk->rcvq_space.time);
+ mstamp = mptcp_stamp();
+ time = tcp_stamp_us_delta(mstamp, READ_ONCE(msk->rcvq_space.time));
rtt_us = msk->rcvq_space.rtt_us;
if (rtt_us && time < (rtt_us >> 3))
@@ -3548,6 +3548,7 @@ struct sock *mptcp_sk_clone_init(const struct sock *sk,
__mptcp_propagate_sndbuf(nsk, ssk);
mptcp_rcv_space_init(msk, ssk);
+ msk->rcvq_space.time = mptcp_stamp();
if (mp_opt->suboptions & OPTION_MPTCP_MPC_ACK)
__mptcp_subflow_fully_established(msk, subflow, mp_opt);
@@ -3565,8 +3566,6 @@ void mptcp_rcv_space_init(struct mptcp_sock *msk, const struct sock *ssk)
msk->rcvq_space.copied = 0;
msk->rcvq_space.rtt_us = 0;
- msk->rcvq_space.time = tp->tcp_mstamp;
-
/* initial rcv_space offering made to peer */
msk->rcvq_space.space = min_t(u32, tp->rcv_wnd,
TCP_INIT_CWND * tp->advmss);
@@ -3762,6 +3761,7 @@ void mptcp_finish_connect(struct sock *ssk)
* accessing the field below
*/
WRITE_ONCE(msk->local_key, subflow->local_key);
+ WRITE_ONCE(msk->rcvq_space.time, mptcp_stamp());
mptcp_pm_new_connection(msk, ssk, 0);
}
diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
index 66e973500791..39afd44e072f 100644
--- a/net/mptcp/protocol.h
+++ b/net/mptcp/protocol.h
@@ -915,6 +915,11 @@ static inline bool mptcp_is_fully_established(struct sock *sk)
READ_ONCE(mptcp_sk(sk)->fully_established);
}
+static inline u64 mptcp_stamp(void)
+{
+ return div_u64(tcp_clock_ns(), NSEC_PER_USEC);
+}
+
void mptcp_rcv_space_init(struct mptcp_sock *msk, const struct sock *ssk);
void mptcp_data_ready(struct sock *sk, struct sock *ssk);
bool mptcp_finish_join(struct sock *sk);
--
2.51.0
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH net-next 03/15] mptcp: consolidate rcv space init
2026-02-03 18:41 [PATCH net-next 00/15] mptcp: misc. features for v6.20/7.0 Matthieu Baerts (NGI0)
2026-02-03 18:41 ` [PATCH net-next 01/15] mptcp: do not account for OoO in mptcp_rcvbuf_grow() Matthieu Baerts (NGI0)
2026-02-03 18:41 ` [PATCH net-next 02/15] mptcp: fix receive space timestamp initialization Matthieu Baerts (NGI0)
@ 2026-02-03 18:41 ` Matthieu Baerts (NGI0)
2026-02-03 18:41 ` [PATCH net-next 04/15] trace: mptcp: add mptcp_rcvbuf_grow tracepoint Matthieu Baerts (NGI0)
` (12 subsequent siblings)
15 siblings, 0 replies; 20+ messages in thread
From: Matthieu Baerts (NGI0) @ 2026-02-03 18:41 UTC (permalink / raw)
To: Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Simon Horman, Shuah Khan
Cc: netdev, mptcp, linux-kernel, linux-kselftest,
Matthieu Baerts (NGI0)
From: Paolo Abeni <pabeni@redhat.com>
MPTCP uses several calls of the mptcp_rcv_space_init() helper to
initialize the receive space, with a catch-up call in
mptcp_rcv_space_adjust().
Drop all the other strictly not needed invocations and move constant
fields initialization at socket init/reset time.
This removes a bit of complexity from mptcp DRS code. No functional
changes intended.
Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
net/mptcp/protocol.c | 30 +++++++++++++++---------------
net/mptcp/protocol.h | 1 -
net/mptcp/subflow.c | 2 --
3 files changed, 15 insertions(+), 18 deletions(-)
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 8d16ed00fcb4..514272179714 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -2065,6 +2065,21 @@ static int __mptcp_recvmsg_mskq(struct sock *sk, struct msghdr *msg,
return copied;
}
+static void mptcp_rcv_space_init(struct mptcp_sock *msk, const struct sock *ssk)
+{
+ const struct tcp_sock *tp = tcp_sk(ssk);
+
+ msk->rcvspace_init = 1;
+ msk->rcvq_space.copied = 0;
+ msk->rcvq_space.rtt_us = 0;
+
+ /* initial rcv_space offering made to peer */
+ msk->rcvq_space.space = min_t(u32, tp->rcv_wnd,
+ TCP_INIT_CWND * tp->advmss);
+ if (msk->rcvq_space.space == 0)
+ msk->rcvq_space.space = TCP_INIT_CWND * TCP_MSS_DEFAULT;
+}
+
/* receive buffer autotuning. See tcp_rcv_space_adjust for more information.
*
* Only difference: Use highest rtt estimate of the subflows in use.
@@ -3558,21 +3573,6 @@ struct sock *mptcp_sk_clone_init(const struct sock *sk,
return nsk;
}
-void mptcp_rcv_space_init(struct mptcp_sock *msk, const struct sock *ssk)
-{
- const struct tcp_sock *tp = tcp_sk(ssk);
-
- msk->rcvspace_init = 1;
- msk->rcvq_space.copied = 0;
- msk->rcvq_space.rtt_us = 0;
-
- /* initial rcv_space offering made to peer */
- msk->rcvq_space.space = min_t(u32, tp->rcv_wnd,
- TCP_INIT_CWND * tp->advmss);
- if (msk->rcvq_space.space == 0)
- msk->rcvq_space.space = TCP_INIT_CWND * TCP_MSS_DEFAULT;
-}
-
static void mptcp_destroy(struct sock *sk)
{
struct mptcp_sock *msk = mptcp_sk(sk);
diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
index 39afd44e072f..66a30409f217 100644
--- a/net/mptcp/protocol.h
+++ b/net/mptcp/protocol.h
@@ -920,7 +920,6 @@ static inline u64 mptcp_stamp(void)
return div_u64(tcp_clock_ns(), NSEC_PER_USEC);
}
-void mptcp_rcv_space_init(struct mptcp_sock *msk, const struct sock *ssk);
void mptcp_data_ready(struct sock *sk, struct sock *ssk);
bool mptcp_finish_join(struct sock *sk);
bool mptcp_schedule_work(struct sock *sk);
diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c
index 96d54cb2cd93..f66129f1e649 100644
--- a/net/mptcp/subflow.c
+++ b/net/mptcp/subflow.c
@@ -462,8 +462,6 @@ void __mptcp_sync_state(struct sock *sk, int state)
subflow = mptcp_subflow_ctx(ssk);
__mptcp_propagate_sndbuf(sk, ssk);
- if (!msk->rcvspace_init)
- mptcp_rcv_space_init(msk, ssk);
if (sk->sk_state == TCP_SYN_SENT) {
/* subflow->idsn is always available is TCP_SYN_SENT state,
--
2.51.0
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH net-next 04/15] trace: mptcp: add mptcp_rcvbuf_grow tracepoint
2026-02-03 18:41 [PATCH net-next 00/15] mptcp: misc. features for v6.20/7.0 Matthieu Baerts (NGI0)
` (2 preceding siblings ...)
2026-02-03 18:41 ` [PATCH net-next 03/15] mptcp: consolidate rcv space init Matthieu Baerts (NGI0)
@ 2026-02-03 18:41 ` Matthieu Baerts (NGI0)
2026-02-03 18:41 ` [PATCH net-next 05/15] mptcp: pm: align endpoint flags size with the NL specs Matthieu Baerts (NGI0)
` (11 subsequent siblings)
15 siblings, 0 replies; 20+ messages in thread
From: Matthieu Baerts (NGI0) @ 2026-02-03 18:41 UTC (permalink / raw)
To: Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Simon Horman, Shuah Khan
Cc: netdev, mptcp, linux-kernel, linux-kselftest,
Matthieu Baerts (NGI0), Steven Rostedt, Masami Hiramatsu,
Mathieu Desnoyers, linux-trace-kernel
From: Paolo Abeni <pabeni@redhat.com>
Similar to tcp, provide a new tracepoint to better understand
mptcp_rcv_space_adjust() behavior, which presents many artifacts.
Note that the used format string is so long that I preferred
wrap it, contrary to guidance for quoted strings.
Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
To: Steven Rostedt <rostedt@goodmis.org>
To: Masami Hiramatsu <mhiramat@kernel.org>
To: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: linux-trace-kernel@vger.kernel.org
---
include/trace/events/mptcp.h | 80 ++++++++++++++++++++++++++++++++++++++++++++
net/mptcp/protocol.c | 3 ++
2 files changed, 83 insertions(+)
diff --git a/include/trace/events/mptcp.h b/include/trace/events/mptcp.h
index 085b749cdd97..269d949b2025 100644
--- a/include/trace/events/mptcp.h
+++ b/include/trace/events/mptcp.h
@@ -5,7 +5,13 @@
#if !defined(_TRACE_MPTCP_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_MPTCP_H
+#include <linux/ipv6.h>
+#include <linux/tcp.h>
#include <linux/tracepoint.h>
+#include <net/ipv6.h>
+#include <net/tcp.h>
+#include <linux/sock_diag.h>
+#include <net/rstreason.h>
#define show_mapping_status(status) \
__print_symbolic(status, \
@@ -178,6 +184,80 @@ TRACE_EVENT(subflow_check_data_avail,
__entry->skb)
);
+#include <trace/events/net_probe_common.h>
+
+TRACE_EVENT(mptcp_rcvbuf_grow,
+
+ TP_PROTO(struct sock *sk, int time),
+
+ TP_ARGS(sk, time),
+
+ TP_STRUCT__entry(
+ __field(int, time)
+ __field(__u32, rtt_us)
+ __field(__u32, copied)
+ __field(__u32, inq)
+ __field(__u32, space)
+ __field(__u32, ooo_space)
+ __field(__u32, rcvbuf)
+ __field(__u32, rcv_wnd)
+ __field(__u8, scaling_ratio)
+ __field(__u16, sport)
+ __field(__u16, dport)
+ __field(__u16, family)
+ __array(__u8, saddr, 4)
+ __array(__u8, daddr, 4)
+ __array(__u8, saddr_v6, 16)
+ __array(__u8, daddr_v6, 16)
+ __field(const void *, skaddr)
+ ),
+
+ TP_fast_assign(
+ struct mptcp_sock *msk = mptcp_sk(sk);
+ struct inet_sock *inet = inet_sk(sk);
+ bool ofo_empty;
+ __be32 *p32;
+
+ __entry->time = time;
+ __entry->rtt_us = msk->rcvq_space.rtt_us >> 3;
+ __entry->copied = msk->rcvq_space.copied;
+ __entry->inq = mptcp_inq_hint(sk);
+ __entry->space = msk->rcvq_space.space;
+ ofo_empty = RB_EMPTY_ROOT(&msk->out_of_order_queue);
+ __entry->ooo_space = ofo_empty ? 0 :
+ MPTCP_SKB_CB(msk->ooo_last_skb)->end_seq -
+ msk->ack_seq;
+
+ __entry->rcvbuf = sk->sk_rcvbuf;
+ __entry->rcv_wnd = atomic64_read(&msk->rcv_wnd_sent) -
+ msk->ack_seq;
+ __entry->scaling_ratio = msk->scaling_ratio;
+ __entry->sport = ntohs(inet->inet_sport);
+ __entry->dport = ntohs(inet->inet_dport);
+ __entry->family = sk->sk_family;
+
+ p32 = (__be32 *)__entry->saddr;
+ *p32 = inet->inet_saddr;
+
+ p32 = (__be32 *)__entry->daddr;
+ *p32 = inet->inet_daddr;
+
+ TP_STORE_ADDRS(__entry, inet->inet_saddr, inet->inet_daddr,
+ sk->sk_v6_rcv_saddr, sk->sk_v6_daddr);
+
+ __entry->skaddr = sk;
+ ),
+
+ TP_printk("time=%u rtt_us=%u copied=%u inq=%u space=%u ooo=%u scaling_ratio=%u "
+ "rcvbuf=%u rcv_wnd=%u family=%d sport=%hu dport=%hu saddr=%pI4 "
+ "daddr=%pI4 saddrv6=%pI6c daddrv6=%pI6c skaddr=%p",
+ __entry->time, __entry->rtt_us, __entry->copied,
+ __entry->inq, __entry->space, __entry->ooo_space,
+ __entry->scaling_ratio, __entry->rcvbuf, __entry->rcv_wnd,
+ __entry->family, __entry->sport, __entry->dport,
+ __entry->saddr, __entry->daddr, __entry->saddr_v6,
+ __entry->daddr_v6, __entry->skaddr)
+);
#endif /* _TRACE_MPTCP_H */
/* This part must be outside protection */
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 514272179714..197ee169c0bc 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -28,6 +28,8 @@
#include "protocol.h"
#include "mib.h"
+static unsigned int mptcp_inq_hint(const struct sock *sk);
+
#define CREATE_TRACE_POINTS
#include <trace/events/mptcp.h>
@@ -2133,6 +2135,7 @@ static void mptcp_rcv_space_adjust(struct mptcp_sock *msk, int copied)
if (msk->rcvq_space.copied <= msk->rcvq_space.space)
goto new_measure;
+ trace_mptcp_rcvbuf_grow(sk, time);
if (mptcp_rcvbuf_grow(sk, msk->rcvq_space.copied)) {
/* Make subflows follow along. If we do not do this, we
* get drops at subflow level if skbs can't be moved to
--
2.51.0
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH net-next 05/15] mptcp: pm: align endpoint flags size with the NL specs
2026-02-03 18:41 [PATCH net-next 00/15] mptcp: misc. features for v6.20/7.0 Matthieu Baerts (NGI0)
` (3 preceding siblings ...)
2026-02-03 18:41 ` [PATCH net-next 04/15] trace: mptcp: add mptcp_rcvbuf_grow tracepoint Matthieu Baerts (NGI0)
@ 2026-02-03 18:41 ` Matthieu Baerts (NGI0)
2026-02-03 18:41 ` [PATCH net-next 06/15] mptcp: Change some dubious min_t(int, ...) to min() Matthieu Baerts (NGI0)
` (10 subsequent siblings)
15 siblings, 0 replies; 20+ messages in thread
From: Matthieu Baerts (NGI0) @ 2026-02-03 18:41 UTC (permalink / raw)
To: Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Simon Horman, Shuah Khan
Cc: netdev, mptcp, linux-kernel, linux-kselftest,
Matthieu Baerts (NGI0)
The MPTCP Netlink specs describe the 'flags' as a u32 type. Internally,
a u8 type was used.
Using a u8 is currently fine, because only the 5 first bits are used.
But there is also no reason not to be aligns with the specs, and
to stick to a u8. Especially because there is a whole of 3 bytes after
in both mptcp_pm_local and mptcp_pm_addr_entry structures.
Also, setting it to a u32 will allow future flags, just in case.
Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
net/mptcp/protocol.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
index 66a30409f217..f4bfe91ca7f9 100644
--- a/net/mptcp/protocol.h
+++ b/net/mptcp/protocol.h
@@ -246,14 +246,14 @@ struct mptcp_pm_data {
struct mptcp_pm_local {
struct mptcp_addr_info addr;
- u8 flags;
+ u32 flags;
int ifindex;
};
struct mptcp_pm_addr_entry {
struct list_head list;
struct mptcp_addr_info addr;
- u8 flags;
+ u32 flags;
int ifindex;
struct socket *lsk;
};
--
2.51.0
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH net-next 06/15] mptcp: Change some dubious min_t(int, ...) to min()
2026-02-03 18:41 [PATCH net-next 00/15] mptcp: misc. features for v6.20/7.0 Matthieu Baerts (NGI0)
` (4 preceding siblings ...)
2026-02-03 18:41 ` [PATCH net-next 05/15] mptcp: pm: align endpoint flags size with the NL specs Matthieu Baerts (NGI0)
@ 2026-02-03 18:41 ` Matthieu Baerts (NGI0)
2026-02-03 18:41 ` [PATCH net-next 07/15] mptcp: allow overridden write_space to be invoked Matthieu Baerts (NGI0)
` (9 subsequent siblings)
15 siblings, 0 replies; 20+ messages in thread
From: Matthieu Baerts (NGI0) @ 2026-02-03 18:41 UTC (permalink / raw)
To: Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Simon Horman, Shuah Khan
Cc: netdev, mptcp, linux-kernel, linux-kselftest,
Matthieu Baerts (NGI0), David Laight
From: David Laight <david.laight.linux@gmail.com>
There are two:
min_t(int, xxx, mptcp_wnd_end(msk) - msk->snd_nxt);
Both mptcp_wnd_end(msk) and msk->snd_nxt are u64, their difference
(aka the window size) might be limited to 32 bits - but that isn't
knowable from this code.
So checks being added to min_t() detect the potential discard of
significant bits.
Provided the 'avail_size' and return of mptcp_check_allowed_size()
are changed to an unsigned type (size_t matches the type the caller
uses) both min_t() can be changed to min().
Signed-off-by: David Laight <david.laight.linux@gmail.com>
Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
[ wrapped too long lines when declaring mptcp_check_allowed_size() ]
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
net/mptcp/protocol.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 197ee169c0bc..e0b4745bbaa9 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -1160,8 +1160,9 @@ struct mptcp_sendmsg_info {
bool data_lock_held;
};
-static int mptcp_check_allowed_size(const struct mptcp_sock *msk, struct sock *ssk,
- u64 data_seq, int avail_size)
+static size_t mptcp_check_allowed_size(const struct mptcp_sock *msk,
+ struct sock *ssk, u64 data_seq,
+ size_t avail_size)
{
u64 window_end = mptcp_wnd_end(msk);
u64 mptcp_snd_wnd;
@@ -1170,7 +1171,7 @@ static int mptcp_check_allowed_size(const struct mptcp_sock *msk, struct sock *s
return avail_size;
mptcp_snd_wnd = window_end - data_seq;
- avail_size = min_t(unsigned int, mptcp_snd_wnd, avail_size);
+ avail_size = min(mptcp_snd_wnd, avail_size);
if (unlikely(tcp_sk(ssk)->snd_wnd < mptcp_snd_wnd)) {
tcp_sk(ssk)->snd_wnd = min_t(u64, U32_MAX, mptcp_snd_wnd);
@@ -1514,7 +1515,7 @@ struct sock *mptcp_subflow_get_send(struct mptcp_sock *msk)
if (!ssk || !sk_stream_memory_free(ssk))
return NULL;
- burst = min_t(int, MPTCP_SEND_BURST_SIZE, mptcp_wnd_end(msk) - msk->snd_nxt);
+ burst = min(MPTCP_SEND_BURST_SIZE, mptcp_wnd_end(msk) - msk->snd_nxt);
wmem = READ_ONCE(ssk->sk_wmem_queued);
if (!burst)
return ssk;
--
2.51.0
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH net-next 07/15] mptcp: allow overridden write_space to be invoked
2026-02-03 18:41 [PATCH net-next 00/15] mptcp: misc. features for v6.20/7.0 Matthieu Baerts (NGI0)
` (5 preceding siblings ...)
2026-02-03 18:41 ` [PATCH net-next 06/15] mptcp: Change some dubious min_t(int, ...) to min() Matthieu Baerts (NGI0)
@ 2026-02-03 18:41 ` Matthieu Baerts (NGI0)
2026-02-04 10:47 ` Matthieu Baerts
2026-02-03 18:41 ` [PATCH net-next 08/15] selftests: mptcp: diag: sort all #include Matthieu Baerts (NGI0)
` (8 subsequent siblings)
15 siblings, 1 reply; 20+ messages in thread
From: Matthieu Baerts (NGI0) @ 2026-02-03 18:41 UTC (permalink / raw)
To: Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Simon Horman, Shuah Khan
Cc: netdev, mptcp, linux-kernel, linux-kselftest,
Matthieu Baerts (NGI0), Gang Yan, Geliang Tang
From: Geliang Tang <tanggeliang@kylinos.cn>
Future extensions with psock will override their own sk->sk_write_space
callback. This patch ensures that the overridden sk_write_space can be
invoked by MPTCP.
INDIRECT_CALL is used to keep the default path optimised.
This patch is shared early to ease discussions around future RFC and
avoid confusions with this "fix" that is needed for different future
extensions.
Suggested-by: Paolo Abeni <pabeni@redhat.com>
Co-developed-by: Gang Yan <yangang@kylinos.cn>
Signed-off-by: Gang Yan <yangang@kylinos.cn>
Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
net/mptcp/protocol.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
index f4bfe91ca7f9..0bd1ee860316 100644
--- a/net/mptcp/protocol.h
+++ b/net/mptcp/protocol.h
@@ -975,7 +975,7 @@ static inline void mptcp_write_space(struct sock *sk)
/* pairs with memory barrier in mptcp_poll */
smp_mb();
if (mptcp_stream_memory_free(sk, 1))
- sk_stream_write_space(sk);
+ INDIRECT_CALL_1(sk->sk_write_space, sk_stream_write_space, sk);
}
static inline void __mptcp_sync_sndbuf(struct sock *sk)
--
2.51.0
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH net-next 08/15] selftests: mptcp: diag: sort all #include
2026-02-03 18:41 [PATCH net-next 00/15] mptcp: misc. features for v6.20/7.0 Matthieu Baerts (NGI0)
` (6 preceding siblings ...)
2026-02-03 18:41 ` [PATCH net-next 07/15] mptcp: allow overridden write_space to be invoked Matthieu Baerts (NGI0)
@ 2026-02-03 18:41 ` Matthieu Baerts (NGI0)
2026-02-03 18:41 ` [PATCH net-next 09/15] selftests: mptcp: join: wait for estab event instead of MPJ Matthieu Baerts (NGI0)
` (7 subsequent siblings)
15 siblings, 0 replies; 20+ messages in thread
From: Matthieu Baerts (NGI0) @ 2026-02-03 18:41 UTC (permalink / raw)
To: Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Simon Horman, Shuah Khan
Cc: netdev, mptcp, linux-kernel, linux-kselftest,
Matthieu Baerts (NGI0), Thomas Weißschuh
This file is the only one from this directory not to have all these
header inclusions sorted by type and alphabetical order.
Adapt them, to ease the reading, prevent conflicts during potential
future backport modifying these lines, and also to avoid having UAPI
header inclusions before libc ones, see [1].
Link: https://lore.kernel.org/20260120-uapi-sockaddr-v2-1-63c319111cf6@linutronix.de
Reviewed-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Reviewed-by: Geliang Tang <geliang@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
tools/testing/selftests/net/mptcp/mptcp_diag.c | 29 ++++++++++++++------------
1 file changed, 16 insertions(+), 13 deletions(-)
diff --git a/tools/testing/selftests/net/mptcp/mptcp_diag.c b/tools/testing/selftests/net/mptcp/mptcp_diag.c
index 8e0b1b8d84b6..5e222ba977e4 100644
--- a/tools/testing/selftests/net/mptcp/mptcp_diag.c
+++ b/tools/testing/selftests/net/mptcp/mptcp_diag.c
@@ -1,21 +1,24 @@
// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2025, Kylin Software */
-#include <linux/sock_diag.h>
-#include <linux/rtnetlink.h>
-#include <linux/inet_diag.h>
-#include <linux/netlink.h>
-#include <linux/compiler.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <linux/tcp.h>
-#include <arpa/inet.h>
-
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
#include <errno.h>
#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <sys/socket.h>
+
+#include <arpa/inet.h>
+
+#include <netinet/in.h>
+
+#include <linux/compiler.h>
+#include <linux/inet_diag.h>
+#include <linux/netlink.h>
+#include <linux/rtnetlink.h>
+#include <linux/sock_diag.h>
+#include <linux/tcp.h>
#ifndef IPPROTO_MPTCP
#define IPPROTO_MPTCP 262
--
2.51.0
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH net-next 09/15] selftests: mptcp: join: wait for estab event instead of MPJ
2026-02-03 18:41 [PATCH net-next 00/15] mptcp: misc. features for v6.20/7.0 Matthieu Baerts (NGI0)
` (7 preceding siblings ...)
2026-02-03 18:41 ` [PATCH net-next 08/15] selftests: mptcp: diag: sort all #include Matthieu Baerts (NGI0)
@ 2026-02-03 18:41 ` Matthieu Baerts (NGI0)
2026-02-03 18:41 ` [PATCH net-next 10/15] selftests: mptcp: join: fix wait_mpj helper Matthieu Baerts (NGI0)
` (6 subsequent siblings)
15 siblings, 0 replies; 20+ messages in thread
From: Matthieu Baerts (NGI0) @ 2026-02-03 18:41 UTC (permalink / raw)
To: Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Simon Horman, Shuah Khan
Cc: netdev, mptcp, linux-kernel, linux-kselftest,
Matthieu Baerts (NGI0)
'wait_mpj' was used just after having created a background connection,
but before creating new subflows. So no MPJ were sent. The intention was
to wait for the connection to be established, which was the same as
doing a simple sleep with a "random" value.
Instead, wait for an "established" event. With this, the tests can
finish quicker.
Reviewed-by: Geliang Tang <geliang@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
tools/testing/selftests/net/mptcp/mptcp_join.sh | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
index e70d3420954f..ff20d86ed399 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -3999,7 +3999,7 @@ userspace_tests()
{ timeout_test=120 test_linkfail=128 speed=5 \
run_tests $ns1 $ns2 10.0.1.1 & } 2>/dev/null
local tests_pid=$!
- wait_mpj $ns1
+ wait_event ns1 MPTCP_LIB_EVENT_ESTABLISHED 1
userspace_pm_add_addr $ns1 10.0.2.1 10
userspace_pm_add_addr $ns1 10.0.3.1 20
chk_join_nr 2 2 2
@@ -4032,7 +4032,7 @@ userspace_tests()
{ timeout_test=120 test_linkfail=128 speed=5 \
run_tests $ns1 $ns2 10.0.1.1 & } 2>/dev/null
local tests_pid=$!
- wait_mpj $ns2
+ wait_event ns2 MPTCP_LIB_EVENT_ESTABLISHED 1
userspace_pm_add_sf $ns2 10.0.3.2 20
chk_join_nr 1 1 1
chk_mptcp_info subflows 1 subflows 1
@@ -4060,7 +4060,7 @@ userspace_tests()
{ timeout_test=120 test_linkfail=128 speed=5 \
run_tests $ns1 $ns2 10.0.1.1 & } 2>/dev/null
local tests_pid=$!
- wait_mpj $ns2
+ wait_event ns2 MPTCP_LIB_EVENT_ESTABLISHED 1
chk_mptcp_info subflows 0 subflows 0
chk_subflows_total 1 1
userspace_pm_add_sf $ns2 10.0.3.2 0
@@ -4081,7 +4081,7 @@ userspace_tests()
{ timeout_test=120 test_linkfail=128 speed=5 \
run_tests $ns1 $ns2 10.0.1.1 & } 2>/dev/null
local tests_pid=$!
- wait_mpj $ns2
+ wait_event ns2 MPTCP_LIB_EVENT_ESTABLISHED 1
userspace_pm_add_sf $ns2 10.0.3.2 20
chk_join_nr 1 1 1
chk_mptcp_info subflows 1 subflows 1
@@ -4105,7 +4105,7 @@ userspace_tests()
{ timeout_test=120 test_linkfail=128 speed=5 \
run_tests $ns1 $ns2 10.0.1.1 & } 2>/dev/null
local tests_pid=$!
- wait_mpj $ns1
+ wait_event ns1 MPTCP_LIB_EVENT_ESTABLISHED 1
userspace_pm_add_addr $ns1 10.0.2.1 10
chk_join_nr 1 1 1
chk_add_nr 1 1
@@ -4158,7 +4158,7 @@ endpoint_tests()
{
# subflow_rebuild_header is needed to support the implicit flag
# userspace pm type prevents add_addr
- if reset "implicit EP" &&
+ if reset_with_events "implicit EP" &&
continue_if mptcp_lib_kallsyms_has "subflow_rebuild_header$"; then
pm_nl_set_limits $ns1 2 2
pm_nl_set_limits $ns2 2 2
@@ -4167,7 +4167,7 @@ endpoint_tests()
run_tests $ns1 $ns2 10.0.1.1 & } 2>/dev/null
local tests_pid=$!
- wait_mpj $ns1
+ wait_event ns2 MPTCP_LIB_EVENT_ESTABLISHED 1
pm_nl_check_endpoint "creation" \
$ns2 10.0.2.2 id 1 flags implicit
chk_mptcp_info subflows 1 subflows 1
@@ -4181,6 +4181,7 @@ endpoint_tests()
pm_nl_check_endpoint "modif is allowed" \
$ns2 10.0.2.2 id 1 flags signal
mptcp_lib_kill_group_wait $tests_pid
+ kill_events_pids
fi
if reset_with_tcp_filter "delete and re-add" ns2 10.0.3.2 REJECT OUTPUT &&
@@ -4194,7 +4195,7 @@ endpoint_tests()
run_tests $ns1 $ns2 10.0.1.1 & } 2>/dev/null
local tests_pid=$!
- wait_mpj $ns2
+ wait_event ns2 MPTCP_LIB_EVENT_ESTABLISHED 1
pm_nl_check_endpoint "creation" \
$ns2 10.0.2.2 id 2 flags subflow dev ns2eth2
chk_subflow_nr "before delete id 2" 2
@@ -4272,7 +4273,7 @@ endpoint_tests()
run_tests $ns1 $ns2 10.0.1.1 & } 2>/dev/null
local tests_pid=$!
- wait_mpj $ns2
+ wait_event ns2 MPTCP_LIB_EVENT_ESTABLISHED 1
pm_nl_check_endpoint "creation" \
$ns1 10.0.2.1 id 1 flags signal
chk_subflow_nr "before delete" 2
--
2.51.0
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH net-next 10/15] selftests: mptcp: join: fix wait_mpj helper
2026-02-03 18:41 [PATCH net-next 00/15] mptcp: misc. features for v6.20/7.0 Matthieu Baerts (NGI0)
` (8 preceding siblings ...)
2026-02-03 18:41 ` [PATCH net-next 09/15] selftests: mptcp: join: wait for estab event instead of MPJ Matthieu Baerts (NGI0)
@ 2026-02-03 18:41 ` Matthieu Baerts (NGI0)
2026-02-03 18:41 ` [PATCH net-next 11/15] selftests: mptcp: join: userspace: wait for new events Matthieu Baerts (NGI0)
` (5 subsequent siblings)
15 siblings, 0 replies; 20+ messages in thread
From: Matthieu Baerts (NGI0) @ 2026-02-03 18:41 UTC (permalink / raw)
To: Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Simon Horman, Shuah Khan
Cc: netdev, mptcp, linux-kernel, linux-kselftest,
Matthieu Baerts (NGI0)
It looks like most of the time, this helper was simply waiting a bit
more than one second: the previous MPJoin counter was often already at
the expected value. So at the end, it was just checking 10 times for
the MPJoin counter to change, but it was not happening. For the tests,
that was time, it was just waiting longer for nothing.
Instead, use 'wait_mpj' with the expected counter: in the tests, the MPJ
counter can easily be predicted. While at it, stop passing the netns as
argument: here the received MPJoin ACK is checked, which happens on the
server side. If later on, this needs to be checked on the client side,
the helper can be adapted for this case, but better avoid confusions now
if it is not needed.
While at it, stop using 'i' for the variable if it is not used.
With this, the tests can finish quicker.
Reviewed-by: Geliang Tang <geliang@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
tools/testing/selftests/net/mptcp/mptcp_join.sh | 30 ++++++++++++-------------
1 file changed, 14 insertions(+), 16 deletions(-)
diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
index ff20d86ed399..6ab568d6b856 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -631,17 +631,15 @@ wait_rm_sf()
done
}
+# $1: expected MPJ ACK Rx counter in $ns1
wait_mpj()
{
- local ns="${1}"
- local cnt old_cnt
+ local exp_cnt="${1}"
+ local cnt
- old_cnt=$(mptcp_lib_get_counter ${ns} "MPTcpExtMPJoinAckRx")
-
- local i
- for i in $(seq 10); do
- cnt=$(mptcp_lib_get_counter ${ns} "MPTcpExtMPJoinAckRx")
- [ "$cnt" = "${old_cnt}" ] || break
+ for _ in $(seq 10); do
+ cnt=$(mptcp_lib_get_counter ${ns1} "MPTcpExtMPJoinAckRx")
+ [ "${cnt}" = "${exp_cnt}" ] && break
sleep 0.1
done
}
@@ -4207,7 +4205,7 @@ endpoint_tests()
chk_mptcp_info subflows 0 subflows 0
pm_nl_add_endpoint $ns2 10.0.2.2 id 2 dev ns2eth2 flags subflow
- wait_mpj $ns2
+ wait_mpj 2
chk_subflow_nr "after re-add id 2" 2
chk_mptcp_info subflows 1 subflows 1
@@ -4219,7 +4217,7 @@ endpoint_tests()
ip netns exec "${ns2}" ${iptables} -D OUTPUT -s "10.0.3.2" -p tcp -j REJECT
pm_nl_del_endpoint $ns2 3 10.0.3.2
pm_nl_add_endpoint $ns2 10.0.3.2 id 3 flags subflow
- wait_mpj $ns2
+ wait_mpj 3
chk_subflow_nr "after no reject" 3
chk_mptcp_info subflows 2 subflows 2
@@ -4231,7 +4229,7 @@ endpoint_tests()
chk_mptcp_info subflows 2 subflows 2 # only decr for additional sf
pm_nl_add_endpoint $ns2 10.0.1.2 id 1 dev ns2eth1 flags subflow
- wait_mpj $ns2
+ wait_mpj $((3 + i))
chk_subflow_nr "after re-add id 0 ($i)" 3
chk_mptcp_info subflows 3 subflows 3
done
@@ -4289,7 +4287,7 @@ endpoint_tests()
pm_nl_add_endpoint $ns1 10.0.2.1 id 1 flags signal
pm_nl_add_endpoint $ns1 10.0.3.1 id 2 flags signal
- wait_mpj $ns2
+ wait_mpj 3
chk_subflow_nr "after re-add" 3
chk_mptcp_info subflows 2 subflows 2
chk_mptcp_info add_addr_signal 2 add_addr_accepted 2
@@ -4301,7 +4299,7 @@ endpoint_tests()
chk_mptcp_info add_addr_signal 2 add_addr_accepted 2
pm_nl_add_endpoint $ns1 10.0.1.1 id 99 flags signal
- wait_mpj $ns2
+ wait_mpj 4
chk_subflow_nr "after re-add ID 0" 3
chk_mptcp_info subflows 3 subflows 3
chk_mptcp_info add_addr_signal 3 add_addr_accepted 2
@@ -4313,7 +4311,7 @@ endpoint_tests()
chk_mptcp_info add_addr_signal 2 add_addr_accepted 2
pm_nl_add_endpoint $ns1 10.0.1.1 id 88 flags signal
- wait_mpj $ns2
+ wait_mpj 5
chk_subflow_nr "after re-re-add ID 0" 3
chk_mptcp_info subflows 3 subflows 3
chk_mptcp_info add_addr_signal 3 add_addr_accepted 2
@@ -4362,9 +4360,9 @@ endpoint_tests()
wait_rm_addr $ns2 0
ip netns exec "${ns2}" ${iptables} -D OUTPUT -s "10.0.3.2" -p tcp -j REJECT
pm_nl_add_endpoint $ns2 10.0.3.2 id 3 flags subflow
- wait_mpj $ns2
+ wait_mpj 1
pm_nl_add_endpoint $ns1 10.0.3.1 id 2 flags signal
- wait_mpj $ns2
+ wait_mpj 2
mptcp_lib_kill_group_wait $tests_pid
join_syn_tx=3 join_connect_err=1 \
--
2.51.0
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH net-next 11/15] selftests: mptcp: join: userspace: wait for new events
2026-02-03 18:41 [PATCH net-next 00/15] mptcp: misc. features for v6.20/7.0 Matthieu Baerts (NGI0)
` (9 preceding siblings ...)
2026-02-03 18:41 ` [PATCH net-next 10/15] selftests: mptcp: join: fix wait_mpj helper Matthieu Baerts (NGI0)
@ 2026-02-03 18:41 ` Matthieu Baerts (NGI0)
2026-02-03 18:41 ` [PATCH net-next 12/15] selftests: mptcp: join chk_stale_nr: avoid dup stats Matthieu Baerts (NGI0)
` (4 subsequent siblings)
15 siblings, 0 replies; 20+ messages in thread
From: Matthieu Baerts (NGI0) @ 2026-02-03 18:41 UTC (permalink / raw)
To: Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Simon Horman, Shuah Khan
Cc: netdev, mptcp, linux-kernel, linux-kselftest,
Matthieu Baerts (NGI0)
Instead of waiting for a random amount of time (1 second), wait for an
event to be received on the other side.
To do that, when an address is announced (userspace_pm_add_addr), the
ANNOUNCED is expected. When a new subflow is created
(userspace_pm_add_sf), the SUB_ESTABLISHED event is expected.
With this, the tests can finish quicker.
Reviewed-by: Geliang Tang <geliang@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
tools/testing/selftests/net/mptcp/mptcp_join.sh | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
index 6ab568d6b856..4977e6ff17b4 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -3716,7 +3716,6 @@ userspace_pm_add_addr()
tk=$(mptcp_lib_evts_get_info token "$evts")
ip netns exec $1 ./pm_nl_ctl ann $2 token $tk id $3
- sleep 1
}
# $1: ns ; $2: id
@@ -3747,7 +3746,6 @@ userspace_pm_add_sf()
ip netns exec $1 ./pm_nl_ctl csf lip $2 lid $3 \
rip $da rport $dp token $tk
- sleep 1
}
# $1: ns ; $2: addr $3: event type
@@ -3999,7 +3997,9 @@ userspace_tests()
local tests_pid=$!
wait_event ns1 MPTCP_LIB_EVENT_ESTABLISHED 1
userspace_pm_add_addr $ns1 10.0.2.1 10
+ wait_event ns2 MPTCP_LIB_EVENT_ANNOUNCED 1
userspace_pm_add_addr $ns1 10.0.3.1 20
+ wait_event ns2 MPTCP_LIB_EVENT_ANNOUNCED 2
chk_join_nr 2 2 2
chk_add_nr 2 2
chk_mptcp_info subflows 2 subflows 2
@@ -4032,6 +4032,7 @@ userspace_tests()
local tests_pid=$!
wait_event ns2 MPTCP_LIB_EVENT_ESTABLISHED 1
userspace_pm_add_sf $ns2 10.0.3.2 20
+ wait_event ns2 MPTCP_LIB_EVENT_SUB_ESTABLISHED 1
chk_join_nr 1 1 1
chk_mptcp_info subflows 1 subflows 1
chk_subflows_total 2 2
@@ -4062,6 +4063,7 @@ userspace_tests()
chk_mptcp_info subflows 0 subflows 0
chk_subflows_total 1 1
userspace_pm_add_sf $ns2 10.0.3.2 0
+ wait_event ns2 MPTCP_LIB_EVENT_SUB_ESTABLISHED 1
userspace_pm_chk_dump_addr "${ns2}" \
"id 0 flags subflow 10.0.3.2" "id 0 subflow"
chk_join_nr 1 1 1
@@ -4081,6 +4083,7 @@ userspace_tests()
local tests_pid=$!
wait_event ns2 MPTCP_LIB_EVENT_ESTABLISHED 1
userspace_pm_add_sf $ns2 10.0.3.2 20
+ wait_event ns2 MPTCP_LIB_EVENT_SUB_ESTABLISHED 1
chk_join_nr 1 1 1
chk_mptcp_info subflows 1 subflows 1
chk_subflows_total 2 2
@@ -4105,6 +4108,7 @@ userspace_tests()
local tests_pid=$!
wait_event ns1 MPTCP_LIB_EVENT_ESTABLISHED 1
userspace_pm_add_addr $ns1 10.0.2.1 10
+ wait_event ns2 MPTCP_LIB_EVENT_ANNOUNCED 1
chk_join_nr 1 1 1
chk_add_nr 1 1
chk_mptcp_info subflows 1 subflows 1
@@ -4131,6 +4135,7 @@ userspace_tests()
local tests_pid=$!
wait_event ns2 MPTCP_LIB_EVENT_ESTABLISHED 1
userspace_pm_add_sf $ns2 10.0.3.2 20
+ wait_event ns2 MPTCP_LIB_EVENT_SUB_ESTABLISHED 1
chk_mptcp_info subflows 1 subflows 1
chk_subflows_total 2 2
--
2.51.0
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH net-next 12/15] selftests: mptcp: join chk_stale_nr: avoid dup stats
2026-02-03 18:41 [PATCH net-next 00/15] mptcp: misc. features for v6.20/7.0 Matthieu Baerts (NGI0)
` (10 preceding siblings ...)
2026-02-03 18:41 ` [PATCH net-next 11/15] selftests: mptcp: join: userspace: wait for new events Matthieu Baerts (NGI0)
@ 2026-02-03 18:41 ` Matthieu Baerts (NGI0)
2026-02-03 18:41 ` [PATCH net-next 13/15] selftests: mptcp: join: avoid declaring i if not used Matthieu Baerts (NGI0)
` (3 subsequent siblings)
15 siblings, 0 replies; 20+ messages in thread
From: Matthieu Baerts (NGI0) @ 2026-02-03 18:41 UTC (permalink / raw)
To: Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Simon Horman, Shuah Khan
Cc: netdev, mptcp, linux-kernel, linux-kselftest,
Matthieu Baerts (NGI0)
nstat outputs are already printed when calling 'fail_test', no need to
do it again.
While at it, no need to use the dump_stats variable, print the extra
stats directly. And use 'ip -n $ns' instead of 'ip netns exec $ns',
shorter and clearer.
Reviewed-by: Geliang Tang <geliang@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
tools/testing/selftests/net/mptcp/mptcp_join.sh | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
index 4977e6ff17b4..a8b9782a85df 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -1648,7 +1648,6 @@ chk_stale_nr()
local stale_min=$2
local stale_max=$3
local stale_delta=$4
- local dump_stats
local stale_nr
local recover_nr
@@ -1664,16 +1663,11 @@ chk_stale_nr()
fail_test "got $stale_nr stale[s] $recover_nr recover[s], " \
" expected stale in range [$stale_min..$stale_max]," \
" stale-recover delta $stale_delta"
- dump_stats=1
+ echo $ns stats
+ ip -n $ns -s link show
else
print_ok
fi
-
- if [ "${dump_stats}" = 1 ]; then
- echo $ns stats
- ip netns exec $ns ip -s link show
- ip netns exec $ns nstat -as | grep MPTcp
- fi
}
chk_add_nr()
--
2.51.0
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH net-next 13/15] selftests: mptcp: join: avoid declaring i if not used
2026-02-03 18:41 [PATCH net-next 00/15] mptcp: misc. features for v6.20/7.0 Matthieu Baerts (NGI0)
` (11 preceding siblings ...)
2026-02-03 18:41 ` [PATCH net-next 12/15] selftests: mptcp: join chk_stale_nr: avoid dup stats Matthieu Baerts (NGI0)
@ 2026-02-03 18:41 ` Matthieu Baerts (NGI0)
2026-02-03 18:41 ` [PATCH net-next 14/15] selftests: mptcp: connect cleanup TFO setup Matthieu Baerts (NGI0)
` (2 subsequent siblings)
15 siblings, 0 replies; 20+ messages in thread
From: Matthieu Baerts (NGI0) @ 2026-02-03 18:41 UTC (permalink / raw)
To: Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Simon Horman, Shuah Khan
Cc: netdev, mptcp, linux-kernel, linux-kselftest,
Matthieu Baerts (NGI0)
A few loops were declaring 'i', but this variable was not used.
To avoid confusions, use '_' instead: it is more explicit to mark that
this variable is not needed.
Reviewed-by: Geliang Tang <geliang@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
tools/testing/selftests/net/mptcp/mptcp_join.sh | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
index a8b9782a85df..0f9253d607c3 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -603,8 +603,7 @@ wait_rm_addr()
local old_cnt="${2}"
local cnt
- local i
- for i in $(seq 10); do
+ for _ in $(seq 10); do
cnt=$(rm_addr_count ${ns})
[ "$cnt" = "${old_cnt}" ] || break
sleep 0.1
@@ -623,8 +622,7 @@ wait_rm_sf()
local old_cnt="${2}"
local cnt
- local i
- for i in $(seq 10); do
+ for _ in $(seq 10); do
cnt=$(rm_sf_count ${ns})
[ "$cnt" = "${old_cnt}" ] || break
sleep 0.1
@@ -648,8 +646,7 @@ wait_ll_ready()
{
local ns="${1}"
- local i
- for i in $(seq 50); do
+ for _ in $(seq 50); do
ip -n "${ns}" -6 addr show scope link | grep "inet6 fe80" |
grep -qw "tentative" || break
sleep 0.1
--
2.51.0
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH net-next 14/15] selftests: mptcp: connect cleanup TFO setup
2026-02-03 18:41 [PATCH net-next 00/15] mptcp: misc. features for v6.20/7.0 Matthieu Baerts (NGI0)
` (12 preceding siblings ...)
2026-02-03 18:41 ` [PATCH net-next 13/15] selftests: mptcp: join: avoid declaring i if not used Matthieu Baerts (NGI0)
@ 2026-02-03 18:41 ` Matthieu Baerts (NGI0)
2026-02-03 18:41 ` [PATCH net-next 15/15] selftests: mptcp: join: no SKIP mark for group checks Matthieu Baerts (NGI0)
2026-02-05 2:50 ` [PATCH net-next 00/15] mptcp: misc. features for v6.20/7.0 patchwork-bot+netdevbpf
15 siblings, 0 replies; 20+ messages in thread
From: Matthieu Baerts (NGI0) @ 2026-02-03 18:41 UTC (permalink / raw)
To: Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Simon Horman, Shuah Khan
Cc: netdev, mptcp, linux-kernel, linux-kselftest,
Matthieu Baerts (NGI0)
To the TFO, only the file descriptor is needed, the family is not.
Also, the error can be handled the same way when 'sendto()' or
'connect()' are used. Only the printed error message is different.
This avoids a bit of confusions.
Reviewed-by: Geliang Tang <geliang@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
tools/testing/selftests/net/mptcp/mptcp_connect.c | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/tools/testing/selftests/net/mptcp/mptcp_connect.c b/tools/testing/selftests/net/mptcp/mptcp_connect.c
index a74b13e42ecd..1e87757a6894 100644
--- a/tools/testing/selftests/net/mptcp/mptcp_connect.c
+++ b/tools/testing/selftests/net/mptcp/mptcp_connect.c
@@ -259,7 +259,7 @@ static void set_transparent(int fd, int pf)
}
}
-static void set_mptfo(int fd, int pf)
+static void set_mptfo(int fd)
{
int qlen = 25;
@@ -336,7 +336,7 @@ static int sock_listen_mptcp(const char * const listenaddr,
set_transparent(sock, pf);
if (cfg_sockopt_types.mptfo)
- set_mptfo(sock, pf);
+ set_mptfo(sock);
if (bind(sock, a->ai_addr, a->ai_addrlen) == 0)
break; /* success */
@@ -407,21 +407,18 @@ static int sock_connect_mptcp(const char * const remoteaddr,
*peer = a;
break; /* success */
}
+ perror("sendto()");
} else {
if (connect(sock, a->ai_addr, a->ai_addrlen) == 0) {
*peer = a;
break; /* success */
}
- }
- if (cfg_sockopt_types.mptfo) {
- perror("sendto()");
- close(sock);
- sock = -1;
- } else {
perror("connect()");
- close(sock);
- sock = -1;
}
+
+ /* error */
+ close(sock);
+ sock = -1;
}
freeaddrinfo(addr);
--
2.51.0
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH net-next 15/15] selftests: mptcp: join: no SKIP mark for group checks
2026-02-03 18:41 [PATCH net-next 00/15] mptcp: misc. features for v6.20/7.0 Matthieu Baerts (NGI0)
` (13 preceding siblings ...)
2026-02-03 18:41 ` [PATCH net-next 14/15] selftests: mptcp: connect cleanup TFO setup Matthieu Baerts (NGI0)
@ 2026-02-03 18:41 ` Matthieu Baerts (NGI0)
2026-02-05 2:50 ` [PATCH net-next 00/15] mptcp: misc. features for v6.20/7.0 patchwork-bot+netdevbpf
15 siblings, 0 replies; 20+ messages in thread
From: Matthieu Baerts (NGI0) @ 2026-02-03 18:41 UTC (permalink / raw)
To: Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Simon Horman, Shuah Khan
Cc: netdev, mptcp, linux-kernel, linux-kselftest,
Matthieu Baerts (NGI0)
When executing the last MPTCP selftests on older kernels, this output is
printed:
# 001 no JOIN
# join Rx [SKIP]
# join Tx [SKIP]
# fallback [SKIP]
In fact, behind each line, a few counters are checked, and likely not
all of them have been skipped because the they are not available on
these kernels. Instead, "new" and unsupported counters for these groups
are now ignored, and [ OK ] will be printed instead of [SKIP].
Note that on the MPTCP CI, when validating the dev versions, any
unsupported counter will cause the tests to fail. So this is safe not to
print 'SKIP' for these group checks.
Reviewed-by: Geliang Tang <geliang@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
tools/testing/selftests/net/mptcp/mptcp_join.sh | 30 ++++++++++++-------------
1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
index 0f9253d607c3..dc1f200aaa81 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -1402,7 +1402,7 @@ chk_join_tx_nr()
count=$(mptcp_lib_get_counter ${ns2} "MPTcpExtMPJoinSynTxCreatSkErr")
if [ -z "$count" ]; then
- rc=${KSFT_SKIP}
+ : # ignore skip
elif [ "$count" != "$create" ]; then
rc=${KSFT_FAIL}
print_check "syn tx create socket error"
@@ -1411,7 +1411,7 @@ chk_join_tx_nr()
count=$(mptcp_lib_get_counter ${ns2} "MPTcpExtMPJoinSynTxBindErr")
if [ -z "$count" ]; then
- rc=${KSFT_SKIP}
+ : # ignore skip
elif [ "$count" != "$bind" ]; then
rc=${KSFT_FAIL}
print_check "syn tx bind error"
@@ -1420,7 +1420,7 @@ chk_join_tx_nr()
count=$(mptcp_lib_get_counter ${ns2} "MPTcpExtMPJoinSynTxConnectErr")
if [ -z "$count" ]; then
- rc=${KSFT_SKIP}
+ : # ignore skip
elif [ "$count" != "$connect" ]; then
rc=${KSFT_FAIL}
print_check "syn tx connect error"
@@ -1446,7 +1446,7 @@ chk_fallback_nr()
count=$(mptcp_lib_get_counter ${!ns} "MPTcpExtInfiniteMapTx")
if [ -z "$count" ]; then
- rc=${KSFT_SKIP}
+ : # ignore skip
elif [ "$count" != "$infinite_map_tx" ]; then
rc=${KSFT_FAIL}
print_check "$ns infinite map tx fallback"
@@ -1455,7 +1455,7 @@ chk_fallback_nr()
count=$(mptcp_lib_get_counter ${!ns} "MPTcpExtDSSCorruptionFallback")
if [ -z "$count" ]; then
- rc=${KSFT_SKIP}
+ : # ignore skip
elif [ "$count" != "$dss_corruption" ]; then
rc=${KSFT_FAIL}
print_check "$ns dss corruption fallback"
@@ -1464,7 +1464,7 @@ chk_fallback_nr()
count=$(mptcp_lib_get_counter ${!ns} "MPTcpExtSimultConnectFallback")
if [ -z "$count" ]; then
- rc=${KSFT_SKIP}
+ : # ignore skip
elif [ "$count" != "$simult_conn" ]; then
rc=${KSFT_FAIL}
print_check "$ns simult conn fallback"
@@ -1473,7 +1473,7 @@ chk_fallback_nr()
count=$(mptcp_lib_get_counter ${!ns} "MPTcpExtMPCapableFallbackACK")
if [ -z "$count" ]; then
- rc=${KSFT_SKIP}
+ : # ignore skip
elif [ "$count" != "$mpc_passive" ]; then
rc=${KSFT_FAIL}
print_check "$ns mpc passive fallback"
@@ -1482,7 +1482,7 @@ chk_fallback_nr()
count=$(mptcp_lib_get_counter ${!ns} "MPTcpExtMPCapableFallbackSYNACK")
if [ -z "$count" ]; then
- rc=${KSFT_SKIP}
+ : # ignore skip
elif [ "$count" != "$mpc_active" ]; then
rc=${KSFT_FAIL}
print_check "$ns mpc active fallback"
@@ -1491,7 +1491,7 @@ chk_fallback_nr()
count=$(mptcp_lib_get_counter ${!ns} "MPTcpExtMPCapableDataFallback")
if [ -z "$count" ]; then
- rc=${KSFT_SKIP}
+ : # ignore skip
elif [ "$count" != "$mpc_data" ]; then
rc=${KSFT_FAIL}
print_check "$ns mpc data fallback"
@@ -1500,7 +1500,7 @@ chk_fallback_nr()
count=$(mptcp_lib_get_counter ${!ns} "MPTcpExtMD5SigFallback")
if [ -z "$count" ]; then
- rc=${KSFT_SKIP}
+ : # ignore skip
elif [ "$count" != "$md5_sig" ]; then
rc=${KSFT_FAIL}
print_check "$ns MD5 Sig fallback"
@@ -1509,7 +1509,7 @@ chk_fallback_nr()
count=$(mptcp_lib_get_counter ${!ns} "MPTcpExtDssFallback")
if [ -z "$count" ]; then
- rc=${KSFT_SKIP}
+ : # ignore skip
elif [ "$count" != "$dss" ]; then
rc=${KSFT_FAIL}
print_check "$ns dss fallback"
@@ -1585,7 +1585,7 @@ chk_join_nr()
count=$(mptcp_lib_get_counter ${ns2} "MPTcpExtMPJoinSynAckHMacFailure")
if [ -z "$count" ]; then
- rc=${KSFT_SKIP}
+ : # ignore skip
elif [ "$count" != "0" ]; then
rc=${KSFT_FAIL}
print_check "synack HMAC"
@@ -1594,7 +1594,7 @@ chk_join_nr()
count=$(mptcp_lib_get_counter ${ns1} "MPTcpExtMPJoinAckRx")
if [ -z "$count" ]; then
- rc=${KSFT_SKIP}
+ : # ignore skip
elif [ "$count" != "$ack_nr" ]; then
rc=${KSFT_FAIL}
print_check "ack rx"
@@ -1603,7 +1603,7 @@ chk_join_nr()
count=$(mptcp_lib_get_counter ${ns1} "MPTcpExtMPJoinAckHMacFailure")
if [ -z "$count" ]; then
- rc=${KSFT_SKIP}
+ : # ignore skip
elif [ "$count" != "0" ]; then
rc=${KSFT_FAIL}
print_check "ack HMAC"
@@ -1612,7 +1612,7 @@ chk_join_nr()
count=$(mptcp_lib_get_counter ${ns1} "MPTcpExtMPJoinRejected")
if [ -z "$count" ]; then
- rc=${KSFT_SKIP}
+ : # ignore skip
elif [ "$count" != "$syn_rej" ]; then
rc=${KSFT_FAIL}
print_check "syn rejected"
--
2.51.0
^ permalink raw reply related [flat|nested] 20+ messages in thread
* Re: [PATCH net-next 07/15] mptcp: allow overridden write_space to be invoked
2026-02-03 18:41 ` [PATCH net-next 07/15] mptcp: allow overridden write_space to be invoked Matthieu Baerts (NGI0)
@ 2026-02-04 10:47 ` Matthieu Baerts
2026-02-05 2:44 ` Jakub Kicinski
0 siblings, 1 reply; 20+ messages in thread
From: Matthieu Baerts @ 2026-02-04 10:47 UTC (permalink / raw)
To: Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Simon Horman, Shuah Khan
Cc: netdev, mptcp, linux-kernel, linux-kselftest, Gang Yan
Hello,
On 03/02/2026 19:41, Matthieu Baerts (NGI0) wrote:
> From: Geliang Tang <tanggeliang@kylinos.cn>
>
> Future extensions with psock will override their own sk->sk_write_space
> callback. This patch ensures that the overridden sk_write_space can be
> invoked by MPTCP.
>
> INDIRECT_CALL is used to keep the default path optimised.
>
> This patch is shared early to ease discussions around future RFC and
> avoid confusions with this "fix" that is needed for different future
> extensions.
>
> Suggested-by: Paolo Abeni <pabeni@redhat.com>
> Co-developed-by: Gang Yan <yangang@kylinos.cn>
> Signed-off-by: Gang Yan <yangang@kylinos.cn>
> Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
> Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
> ---
> net/mptcp/protocol.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
> index f4bfe91ca7f9..0bd1ee860316 100644
> --- a/net/mptcp/protocol.h
> +++ b/net/mptcp/protocol.h
> @@ -975,7 +975,7 @@ static inline void mptcp_write_space(struct sock *sk)
> /* pairs with memory barrier in mptcp_poll */
> smp_mb();
> if (mptcp_stream_memory_free(sk, 1))
> - sk_stream_write_space(sk);
> + INDIRECT_CALL_1(sk->sk_write_space, sk_stream_write_space, sk);
Is it possible to drop only this patch from this series? It is
independent of the rest, and the AI review tool spotted that
sk->sk_write_space is not sk_stream_write_space by default.
I can send a v2 without this patch if preferred.
> }
>
> static inline void __mptcp_sync_sndbuf(struct sock *sk)
>
Cheers,
Matt
--
Sponsored by the NGI0 Core fund.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH net-next 07/15] mptcp: allow overridden write_space to be invoked
2026-02-04 10:47 ` Matthieu Baerts
@ 2026-02-05 2:44 ` Jakub Kicinski
2026-02-05 8:23 ` Matthieu Baerts
0 siblings, 1 reply; 20+ messages in thread
From: Jakub Kicinski @ 2026-02-05 2:44 UTC (permalink / raw)
To: Matthieu Baerts
Cc: Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
Paolo Abeni, Simon Horman, Shuah Khan, netdev, mptcp,
linux-kernel, linux-kselftest, Gang Yan
On Wed, 4 Feb 2026 11:47:13 +0100 Matthieu Baerts wrote:
> > diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
> > index f4bfe91ca7f9..0bd1ee860316 100644
> > --- a/net/mptcp/protocol.h
> > +++ b/net/mptcp/protocol.h
> > @@ -975,7 +975,7 @@ static inline void mptcp_write_space(struct sock *sk)
> > /* pairs with memory barrier in mptcp_poll */
> > smp_mb();
> > if (mptcp_stream_memory_free(sk, 1))
> > - sk_stream_write_space(sk);
> > + INDIRECT_CALL_1(sk->sk_write_space, sk_stream_write_space, sk);
>
> Is it possible to drop only this patch from this series? It is
> independent of the rest, and the AI review tool spotted that
> sk->sk_write_space is not sk_stream_write_space by default.
>
> I can send a v2 without this patch if preferred.
Ack, looks like this is the last patch in terms of real code
so can do. BTW I've been offering other sub-maintainers to
run the AI stuff on their patchwork instances. Looks like
there's a mptcp instance in k.org patchwork.
LMK if you want me to hook it up (..when time allows).
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH net-next 00/15] mptcp: misc. features for v6.20/7.0
2026-02-03 18:41 [PATCH net-next 00/15] mptcp: misc. features for v6.20/7.0 Matthieu Baerts (NGI0)
` (14 preceding siblings ...)
2026-02-03 18:41 ` [PATCH net-next 15/15] selftests: mptcp: join: no SKIP mark for group checks Matthieu Baerts (NGI0)
@ 2026-02-05 2:50 ` patchwork-bot+netdevbpf
15 siblings, 0 replies; 20+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-02-05 2:50 UTC (permalink / raw)
To: Matthieu Baerts
Cc: martineau, geliang, davem, edumazet, kuba, pabeni, horms, shuah,
netdev, mptcp, linux-kernel, linux-kselftest, rostedt, mhiramat,
mathieu.desnoyers, linux-trace-kernel, david.laight.linux,
yangang, thomas.weissschuh
Hello:
This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Tue, 03 Feb 2026 19:41:16 +0100 you wrote:
> This series contains a few independent new features, and small fixes for
> net-next:
>
> - Patches 1-2: two small fixes linked to the MPTCP receive buffer that
> are not urgent, requiring code that has been recently changed, and is
> needed for the next patch. Because we are at the end of the cycle, it
> seems easier to send them to net-next, instead of dealing with
> conflicts between net and net-next.
>
> [...]
Here is the summary with links:
- [net-next,01/15] mptcp: do not account for OoO in mptcp_rcvbuf_grow()
https://git.kernel.org/netdev/net-next/c/6b329393502e
- [net-next,02/15] mptcp: fix receive space timestamp initialization
https://git.kernel.org/netdev/net-next/c/70274765fef5
- [net-next,03/15] mptcp: consolidate rcv space init
https://git.kernel.org/netdev/net-next/c/5c4dcc52c68a
- [net-next,04/15] trace: mptcp: add mptcp_rcvbuf_grow tracepoint
https://git.kernel.org/netdev/net-next/c/2002286e68c9
- [net-next,05/15] mptcp: pm: align endpoint flags size with the NL specs
https://git.kernel.org/netdev/net-next/c/d7e712b66f9b
- [net-next,06/15] mptcp: Change some dubious min_t(int, ...) to min()
https://git.kernel.org/netdev/net-next/c/b582090005d5
- [net-next,07/15] mptcp: allow overridden write_space to be invoked
(no matching commit)
- [net-next,08/15] selftests: mptcp: diag: sort all #include
https://git.kernel.org/netdev/net-next/c/f7f4e8e9448c
- [net-next,09/15] selftests: mptcp: join: wait for estab event instead of MPJ
https://git.kernel.org/netdev/net-next/c/32207bed0547
- [net-next,10/15] selftests: mptcp: join: fix wait_mpj helper
https://git.kernel.org/netdev/net-next/c/ab8b64ca3af3
- [net-next,11/15] selftests: mptcp: join: userspace: wait for new events
https://git.kernel.org/netdev/net-next/c/62c0774f0f18
- [net-next,12/15] selftests: mptcp: join chk_stale_nr: avoid dup stats
https://git.kernel.org/netdev/net-next/c/91453a62e5ec
- [net-next,13/15] selftests: mptcp: join: avoid declaring i if not used
https://git.kernel.org/netdev/net-next/c/79d5069cfbec
- [net-next,14/15] selftests: mptcp: connect cleanup TFO setup
https://git.kernel.org/netdev/net-next/c/ae68da495ae9
- [net-next,15/15] selftests: mptcp: join: no SKIP mark for group checks
https://git.kernel.org/netdev/net-next/c/4dca8d0030c7
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH net-next 07/15] mptcp: allow overridden write_space to be invoked
2026-02-05 2:44 ` Jakub Kicinski
@ 2026-02-05 8:23 ` Matthieu Baerts
0 siblings, 0 replies; 20+ messages in thread
From: Matthieu Baerts @ 2026-02-05 8:23 UTC (permalink / raw)
To: Jakub Kicinski
Cc: Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
Paolo Abeni, Simon Horman, Shuah Khan, netdev, mptcp,
linux-kernel, linux-kselftest, Gang Yan
Hi Jakub,
On 05/02/2026 03:44, Jakub Kicinski wrote:
> On Wed, 4 Feb 2026 11:47:13 +0100 Matthieu Baerts wrote:
>>> diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
>>> index f4bfe91ca7f9..0bd1ee860316 100644
>>> --- a/net/mptcp/protocol.h
>>> +++ b/net/mptcp/protocol.h
>>> @@ -975,7 +975,7 @@ static inline void mptcp_write_space(struct sock *sk)
>>> /* pairs with memory barrier in mptcp_poll */
>>> smp_mb();
>>> if (mptcp_stream_memory_free(sk, 1))
>>> - sk_stream_write_space(sk);
>>> + INDIRECT_CALL_1(sk->sk_write_space, sk_stream_write_space, sk);
>>
>> Is it possible to drop only this patch from this series? It is
>> independent of the rest, and the AI review tool spotted that
>> sk->sk_write_space is not sk_stream_write_space by default.
>>
>> I can send a v2 without this patch if preferred.
>
> Ack, looks like this is the last patch in terms of real code
> so can do.
Thank you for having applied this series without this patch!
> BTW I've been offering other sub-maintainers to
> run the AI stuff on their patchwork instances. Looks like
> there's a mptcp instance in k.org patchwork.
>
> LMK if you want me to hook it up (..when time allows).
That would be great to catch issues early, and avoid multiple versions.
So, yes please, but take your time, that's not urgent. Thank you!
Cheers,
Matt
--
Sponsored by the NGI0 Core fund.
^ permalink raw reply [flat|nested] 20+ messages in thread
end of thread, other threads:[~2026-02-05 8:23 UTC | newest]
Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-03 18:41 [PATCH net-next 00/15] mptcp: misc. features for v6.20/7.0 Matthieu Baerts (NGI0)
2026-02-03 18:41 ` [PATCH net-next 01/15] mptcp: do not account for OoO in mptcp_rcvbuf_grow() Matthieu Baerts (NGI0)
2026-02-03 18:41 ` [PATCH net-next 02/15] mptcp: fix receive space timestamp initialization Matthieu Baerts (NGI0)
2026-02-03 18:41 ` [PATCH net-next 03/15] mptcp: consolidate rcv space init Matthieu Baerts (NGI0)
2026-02-03 18:41 ` [PATCH net-next 04/15] trace: mptcp: add mptcp_rcvbuf_grow tracepoint Matthieu Baerts (NGI0)
2026-02-03 18:41 ` [PATCH net-next 05/15] mptcp: pm: align endpoint flags size with the NL specs Matthieu Baerts (NGI0)
2026-02-03 18:41 ` [PATCH net-next 06/15] mptcp: Change some dubious min_t(int, ...) to min() Matthieu Baerts (NGI0)
2026-02-03 18:41 ` [PATCH net-next 07/15] mptcp: allow overridden write_space to be invoked Matthieu Baerts (NGI0)
2026-02-04 10:47 ` Matthieu Baerts
2026-02-05 2:44 ` Jakub Kicinski
2026-02-05 8:23 ` Matthieu Baerts
2026-02-03 18:41 ` [PATCH net-next 08/15] selftests: mptcp: diag: sort all #include Matthieu Baerts (NGI0)
2026-02-03 18:41 ` [PATCH net-next 09/15] selftests: mptcp: join: wait for estab event instead of MPJ Matthieu Baerts (NGI0)
2026-02-03 18:41 ` [PATCH net-next 10/15] selftests: mptcp: join: fix wait_mpj helper Matthieu Baerts (NGI0)
2026-02-03 18:41 ` [PATCH net-next 11/15] selftests: mptcp: join: userspace: wait for new events Matthieu Baerts (NGI0)
2026-02-03 18:41 ` [PATCH net-next 12/15] selftests: mptcp: join chk_stale_nr: avoid dup stats Matthieu Baerts (NGI0)
2026-02-03 18:41 ` [PATCH net-next 13/15] selftests: mptcp: join: avoid declaring i if not used Matthieu Baerts (NGI0)
2026-02-03 18:41 ` [PATCH net-next 14/15] selftests: mptcp: connect cleanup TFO setup Matthieu Baerts (NGI0)
2026-02-03 18:41 ` [PATCH net-next 15/15] selftests: mptcp: join: no SKIP mark for group checks Matthieu Baerts (NGI0)
2026-02-05 2:50 ` [PATCH net-next 00/15] mptcp: misc. features for v6.20/7.0 patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox