From: Geliang Tang <geliang@kernel.org>
To: Paolo Abeni <pabeni@redhat.com>, mptcp@lists.linux.dev
Cc: dcaratti@redhat.com
Subject: Re: [PATCH mptcp-net] mptcp: clear scheduled subflows on retransmit
Date: Sat, 22 Nov 2025 20:59:27 +0800 [thread overview]
Message-ID: <f53b9be4a701bf2696a96fb316f538aca2566bdf.camel@kernel.org> (raw)
In-Reply-To: <30e5325f37026b870cd0d0765d5d47c8a68fced9.1763676964.git.pabeni@redhat.com>
Hi Paolo,
On Thu, 2025-11-20 at 23:16 +0100, 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
> + * could be left-over scheduled subflows; clear them all
> + * or later xmit could use bad ones
> + */
> + mptcp_for_each_subflow(msk, subflow)
> + if (READ_ONCE(subflow->scheduled))
> + mptcp_subflow_set_scheduled(subflow, false);
> }
If this __mptcp_retrans() needs to clear scheduled subflows, then
shouldn't similar this clear_scheduled operations also be added at the
end of both the __mptcp_push_pending() and
__mptcp_subflow_push_pending()?
Thanks,
-Geliang
>
> /* schedule the timeout timer for the relevant event: either close
> timeout
next prev parent reply other threads:[~2025-11-22 12:59 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 [this message]
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
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=f53b9be4a701bf2696a96fb316f538aca2566bdf.camel@kernel.org \
--to=geliang@kernel.org \
--cc=dcaratti@redhat.com \
--cc=mptcp@lists.linux.dev \
--cc=pabeni@redhat.com \
/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