* [PATCH iproute2-next 2/2] mptcp: limits: add subflow_retries
2026-11-19 18:45 [PATCH iproute2-next 0/2] mptcp: limits: add subflow_retries Anil Kaushik
2026-11-19 18:45 ` [PATCH iproute2-next 1/2] uapi: mptcp: add MPTCP_PM_ATTR_SUBFLOW_RETRIES Anil Kaushik
@ 2026-11-19 18:45 ` Anil Kaushik
2026-11-19 18:54 ` [PATCH iproute2-next 0/2] " Matthieu Baerts
2 siblings, 0 replies; 4+ messages in thread
From: Anil Kaushik @ 2026-11-19 18:45 UTC (permalink / raw)
To: mptcp; +Cc: anilkaushikwireless
The in-kernel path manager can create again a subflow closed after a
retransmission or keepalive timeout. The new subflow-retries limit sets
the number of SYN retries of such subflow, like the TCP_SYNCNT socket
option: 127 by default, also the maximum, and 0 to not re-create it.
Add it to "ip mptcp limits set" and show it in "ip mptcp limits show"
when the kernel reports it:
# ip mptcp limits set subflow_retries 5
# ip mptcp limits show
add_addr_accepted 0 subflows 2 subflow_retries 5
Signed-off-by: Anil Kaushik <anilkaushikwireless@gmail.com>
---
ip/ipmptcp.c | 21 ++++++++++++++++++++-
man/man8/ip-mptcp.8 | 10 ++++++++++
2 files changed, 30 insertions(+), 1 deletion(-)
diff --git a/ip/ipmptcp.c b/ip/ipmptcp.c
index 54976c08..92425a5f 100644
--- a/ip/ipmptcp.c
+++ b/ip/ipmptcp.c
@@ -30,6 +30,7 @@ static void usage(void)
" ip mptcp endpoint show [ id ID ]\n"
" ip mptcp endpoint flush\n"
" ip mptcp limits set [ subflows NR ] [ add_addr_accepted NR ]\n"
+ " [ subflow_retries NR ]\n"
" ip mptcp limits show\n"
" ip mptcp monitor\n"
"FLAG-LIST := [ FLAG-LIST ] FLAG\n"
@@ -362,9 +363,11 @@ static int mptcp_addr_flush(int argc, char **argv)
static int mptcp_parse_limit(int argc, char **argv, struct nlmsghdr *n)
{
bool set_rcv_add_addrs = false;
+ bool set_retries = false;
bool set_subflows = false;
__u32 rcv_add_addrs = 0;
__u32 subflows = 0;
+ __u32 retries = 0;
while (argc > 0) {
if (matches(*argv, "subflows") == 0) {
@@ -379,6 +382,12 @@ static int mptcp_parse_limit(int argc, char **argv, struct nlmsghdr *n)
if (get_u32(&rcv_add_addrs, *argv, 0))
invarg("invalid add_addr_accepted\n", *argv);
set_rcv_add_addrs = true;
+ } else if (matches(*argv, "subflow_retries") == 0) {
+ NEXT_ARG();
+
+ if (get_u32(&retries, *argv, 0))
+ invarg("invalid subflow_retries\n", *argv);
+ set_retries = true;
} else {
invarg("unknown limit", *argv);
}
@@ -390,7 +399,10 @@ static int mptcp_parse_limit(int argc, char **argv, struct nlmsghdr *n)
rcv_add_addrs);
if (set_subflows)
addattr32(n, MPTCP_BUFLEN, MPTCP_PM_ATTR_SUBFLOWS, subflows);
- return set_rcv_add_addrs || set_subflows;
+ if (set_retries)
+ addattr32(n, MPTCP_BUFLEN, MPTCP_PM_ATTR_SUBFLOW_RETRIES,
+ retries);
+ return set_rcv_add_addrs || set_subflows || set_retries;
}
static int print_mptcp_limit(struct nlmsghdr *n, void *arg)
@@ -424,6 +436,13 @@ static int print_mptcp_limit(struct nlmsghdr *n, void *arg)
print_uint(PRINT_ANY, "subflows", "subflows %d ", val);
}
+ if (tb[MPTCP_PM_ATTR_SUBFLOW_RETRIES]) {
+ val = rta_getattr_u32(tb[MPTCP_PM_ATTR_SUBFLOW_RETRIES]);
+
+ print_uint(PRINT_ANY, "subflow_retries", "subflow_retries %d ",
+ val);
+ }
+
print_nl();
close_json_object();
diff --git a/man/man8/ip-mptcp.8 b/man/man8/ip-mptcp.8
index c03935dd..cacee416 100644
--- a/man/man8/ip-mptcp.8
+++ b/man/man8/ip-mptcp.8
@@ -92,6 +92,9 @@ ip-mptcp \- MPTCP path manager configuration
.RB "[ "
.B add_addr_accepted
.IR ADD_ADDR_ACCEPTED_NR " ]"
+.RB "[ "
+.B subflow_retries
+.IR SUBFLOW_RETRIES_NR " ]"
.ti -8
.BR "ip mptcp limits show"
@@ -268,6 +271,13 @@ In both cases the
.IR SUBFLOW_NR
limit is enforced.
+.TP
+.IR SUBFLOW_RETRIES_NR
+specifies the number of SYN retries used when the in-kernel path manager
+creates again a subflow closed after a retransmission or keepalive timeout,
+like the TCP_SYNCNT socket option. The default and maximum value is 127,
+about 4 hours with the default RTO settings. 0 disables the re-creation.
+
.sp
.PP
.B monitor
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH iproute2-next 0/2] mptcp: limits: add subflow_retries
2026-11-19 18:45 [PATCH iproute2-next 0/2] mptcp: limits: add subflow_retries Anil Kaushik
2026-11-19 18:45 ` [PATCH iproute2-next 1/2] uapi: mptcp: add MPTCP_PM_ATTR_SUBFLOW_RETRIES Anil Kaushik
2026-11-19 18:45 ` [PATCH iproute2-next 2/2] mptcp: limits: add subflow_retries Anil Kaushik
@ 2026-11-19 18:54 ` Matthieu Baerts
2 siblings, 0 replies; 4+ messages in thread
From: Matthieu Baerts @ 2026-11-19 18:54 UTC (permalink / raw)
To: Anil Kaushik; +Cc: mptcp
Hi Anil,
On 19/11/2026 19:45, Anil Kaushik wrote:
> This adds the new subflow-retries limit of the in-kernel path manager to
> "ip mptcp limits", as Matt suggested on the kernel series:
>
> https://lore.kernel.org/mptcp/20261103085244.23064-1-anilkaushikwireless@gmail.com/
>
> Patch 1 adds the new attribute to the copied uapi header. It is only
> needed until the iproute2 maintainers update the headers, once the
> kernel part is merged.
>
> Patch 2 adds "subflow_retries" to "ip mptcp limits set" and "show", and
> to the man page.
I didn't review this in details, but I'm just thinking that you might
also want to expose the new limit_subflow_retries counter in ss.
Just note that ss.c is probably going to be split, see:
https://lore.kernel.org/20261119024049.3109143-1-stephen@networkplumber.org
(if you send a v2, please use [iproute2-mptcp] prefix, just not to
confuse with the ones that will be sent upstream)
> With this ip, "pm_netlink.sh -i" from the v15 kernel series fails the
> "set limits" check, because ip now shows the new limit. I have a fix for
> the selftest, which also runs the subflow-retries checks with ip. I can
> squash it in the pm_netlink.sh patch of the next version of the series.
Ah yes, good point. Yes, we will need it. I didn't review v15 yet, it
can wait or feel free to send a v16 if you already have it.
Note that the selftests ideally need to support older kernel version (so
without recent features) and older tools, e.g. IPRoute2 without your
patch. (except if thing get unreadable)
Cheers,
Matt
--
Sponsored by the NGI0 Core fund.
^ permalink raw reply [flat|nested] 4+ messages in thread