MPTCP Linux Development
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: Matthieu Baerts <matttbe@kernel.org>, mptcp@lists.linux.dev
Cc: dcaratti@redhat.com
Subject: Re: [PATCH mptcp-net] mptcp: clear scheduled subflows on retransmit
Date: Mon, 24 Nov 2025 22:06:35 +0100	[thread overview]
Message-ID: <0c7e9f23-ea1a-48dd-957a-956dfb3d6dc4@redhat.com> (raw)
In-Reply-To: <fbd12dc4-ad95-46df-965b-43bf9de430ab@kernel.org>

On 11/24/25 7:18 PM, Matthieu Baerts wrote:
> On 20/11/2025 23:16, Paolo Abeni wrote:
>> When __mptcp_retrans() kicks-in, it schedules one or more subflow for
>> retransmission, but such subflows could be actually left alone if there
>> is no more data to retransmit and/or in case of concurrent fallback.
>>
>> Scheduled subflows could be processed much later in time, i.e. when new
>> data will be transmitted, leading to bad subflow selection.
>>
>> Explicitly clear all scheduled subflows before leaving the retransmission
>> function.
>>
>> Fixes: ee2708aedad0 ("mptcp: use get_retrans wrapper")
>> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
>> ---
>>  net/mptcp/protocol.c | 13 +++++++++++--
>>  1 file changed, 11 insertions(+), 2 deletions(-)
>>
>> diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
>> index 6f4220c8b5bb..3b327e9ccb78 100644
>> --- a/net/mptcp/protocol.c
>> +++ b/net/mptcp/protocol.c
>> @@ -2763,7 +2763,7 @@ static void __mptcp_retrans(struct sock *sk)
>>  		}
>>  
>>  		if (!mptcp_send_head(sk))
>> -			return;
>> +			goto clear_scheduled;
>>  
>>  		goto reset_timer;
>>  	}
>> @@ -2794,7 +2794,7 @@ static void __mptcp_retrans(struct sock *sk)
>>  			if (__mptcp_check_fallback(msk)) {
>>  				spin_unlock_bh(&msk->fallback_lock);
>>  				release_sock(ssk);
>> -				return;
>> +				goto clear_scheduled;
>>  			}
>>  
>>  			while (info.sent < info.limit) {
>> @@ -2826,6 +2826,15 @@ static void __mptcp_retrans(struct sock *sk)
>>  
>>  	if (!mptcp_rtx_timer_pending(sk))
>>  		mptcp_reset_rtx_timer(sk);
>> +
>> +clear_scheduled:
>> +	/* If no rtx data was available or in case of fallback, there
> 
> When reading this comment, it sounds like a "return" could be added
> before this new label (clear_scheduled). Is it always needed to clear
> this flag or only in these two cases?

No, we can't add a return before 'clear_scheduled:'. At least the 'goto
reset_timer;' under the 'if (!dfrag) {' conditional above could reach
there with one or more subflows scheduled.

Cheers,

Paolo


      reply	other threads:[~2025-11-24 21:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-20 22:16 [PATCH mptcp-net] mptcp: clear scheduled subflows on retransmit Paolo Abeni
2025-11-20 23:15 ` MPTCP CI
2025-11-21  8:45 ` Paolo Abeni
2025-11-22 12:59 ` Geliang Tang
2025-11-24  8:26   ` Paolo Abeni
2025-11-24 18:10 ` Matthieu Baerts
2025-11-24 18:24   ` Matthieu Baerts
2025-11-24 18:18 ` Matthieu Baerts
2025-11-24 21:06   ` Paolo Abeni [this message]

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=0c7e9f23-ea1a-48dd-957a-956dfb3d6dc4@redhat.com \
    --to=pabeni@redhat.com \
    --cc=dcaratti@redhat.com \
    --cc=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