public inbox for mptcp@lists.linux.dev
 help / color / mirror / Atom feed
From: Matthieu Baerts <matttbe@kernel.org>
To: MPTCP Linux <mptcp@lists.linux.dev>
Subject: Re: [PATCH mptcp-next 05/16] mptcp: pm: retrans ADD_ADDR: skip inactive subflows
Date: Fri, 10 Apr 2026 11:12:54 +0200	[thread overview]
Message-ID: <a42212ec-b8f6-450d-877b-3b05b0fc550d@kernel.org> (raw)
In-Reply-To: <20260409-mptcp-inc-limits-v1-5-0e45fa30d914@kernel.org>

Hello

On 09/04/2026 22:51, Matthieu Baerts (NGI0) wrote:
> When looking at the maximum RTO amongst the subflows, inactive subflows
> were taken into account: that includes stale ones, and the initial one
> if it has been already been closed.
> 
> Unusable subflows are now simply skipped. Stale ones are used as an
> alternative: if there are only stale ones, to take their maximum RTO and
> avoid to eventually fallback to net.mptcp.add_addr_timeout, which is set
> to 2 minutes by default.
> 
> Fixes: 30549eebc4d8 ("mptcp: make ADD_ADDR retransmission timeout adaptive")
> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
> ---
>  net/mptcp/pm.c | 17 ++++++++++++-----
>  1 file changed, 12 insertions(+), 5 deletions(-)
> 
> diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c
> index 78a2ad71700b..e954dc46e6bc 100644
> --- a/net/mptcp/pm.c
> +++ b/net/mptcp/pm.c
> @@ -305,20 +305,27 @@ static unsigned int mptcp_adjust_add_addr_timeout(struct mptcp_sock *msk)
>  	const struct net *net = sock_net((struct sock *)msk);
>  	unsigned int rto = mptcp_get_add_addr_timeout(net);
>  	struct mptcp_subflow_context *subflow;
> -	unsigned int max = 0;
> +	unsigned int max = 0, max_stale = 0;
>  
>  	mptcp_for_each_subflow(msk, subflow) {
>  		struct sock *ssk = mptcp_subflow_tcp_sock(subflow);
>  		struct inet_connection_sock *icsk = inet_csk(ssk);
>  
> -		if (icsk->icsk_rto > max)
> +		if (!__mptcp_subflow_active(subflow))
> +			continue;
> +
> +		if (unlikely(subflow->stale)) {
> +			if (icsk->icsk_rto > max_stale)
> +				max_stale = icsk->icsk_rto;
> +		} else {

I accidentally removed the condition here, it should be:

  } else if (icsk->icsk_rto > max) {

>  			max = icsk->icsk_rto;
> +		}
>  	}
>  
> -	if (max && max < rto)
> -		rto = max;
> +	if (max)
> +		return max < rto ? max : rto;
>  
> -	return rto;
> +	return max_stale && max_stale < rto ? max_stale : rto;
>  }
>  
>  static void mptcp_pm_add_timer(struct timer_list *timer)
> 

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.


  reply	other threads:[~2026-04-10  9:12 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-09 20:51 [PATCH mptcp-next 00/16] mptcp: pm: increase limits, and related fixes and cleanup Matthieu Baerts (NGI0)
2026-04-09 20:51 ` [PATCH mptcp-next 01/16] mptcp: pm: resched blocked ADD_ADDR quicker Matthieu Baerts (NGI0)
2026-04-09 20:51 ` [PATCH mptcp-next 02/16] mptcp: pm: allow retransmitting ADD_ADDR with ID 0 Matthieu Baerts (NGI0)
2026-04-09 20:51 ` [PATCH mptcp-next 03/16] mptcp: pm: retrans ADD_ADDR: free sk if last Matthieu Baerts (NGI0)
2026-04-09 20:51 ` [PATCH mptcp-next 04/16] mptcp: pm: retrans ADD_ADDR: always decrease sk refcount Matthieu Baerts (NGI0)
2026-04-09 20:51 ` [PATCH mptcp-next 05/16] mptcp: pm: retrans ADD_ADDR: skip inactive subflows Matthieu Baerts (NGI0)
2026-04-10  9:12   ` Matthieu Baerts [this message]
2026-04-09 20:51 ` [PATCH mptcp-next 06/16] mptcp: pm: retrans ADD_ADDR: return early if no retrans Matthieu Baerts (NGI0)
2026-04-09 20:51 ` [PATCH mptcp-next 07/16] mptcp: pm: prio: skip closed subflows Matthieu Baerts (NGI0)
2026-04-09 20:51 ` [PATCH mptcp-next 08/16] selftests: mptcp: pm: restrict 'unknown' check to pm_nl_ctl Matthieu Baerts (NGI0)
2026-04-09 20:51 ` [PATCH mptcp-next 09/16] mptcp: pm: in-kernel: explicitly limit batches to array size Matthieu Baerts (NGI0)
2026-04-09 20:51 ` [PATCH mptcp-next 10/16] mptcp: pm: in-kernel: increase all limits to 64 Matthieu Baerts (NGI0)
2026-04-09 20:51 ` [PATCH mptcp-next 11/16] mptcp: pm: in-kernel: increase endpoints limit Matthieu Baerts (NGI0)
2026-04-09 20:51 ` [PATCH mptcp-next 12/16] selftests: mptcp: join: allow changing ifaces nr per test Matthieu Baerts (NGI0)
2026-04-09 20:51 ` [PATCH mptcp-next 13/16] selftests: mptcp: join: validate 8x8 subflows Matthieu Baerts (NGI0)
2026-04-09 20:51 ` [PATCH mptcp-next 14/16] selftests: mptcp: pm: validate new limits Matthieu Baerts (NGI0)
2026-04-09 20:51 ` [PATCH mptcp-next 15/16] selftests: mptcp: pm: use simpler send/recv forms Matthieu Baerts (NGI0)
2026-04-09 20:51 ` [PATCH mptcp-next 16/16] mptcp: pm: clearer ADD_ADDR related helpers names Matthieu Baerts (NGI0)
2026-04-09 22:10 ` [PATCH mptcp-next 00/16] mptcp: pm: increase limits, and related fixes and cleanup MPTCP CI

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a42212ec-b8f6-450d-877b-3b05b0fc550d@kernel.org \
    --to=matttbe@kernel.org \
    --cc=mptcp@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox