From: sashiko-bot@kernel.org
To: "Geliang Tang" <geliang@kernel.org>, mptcp@lists.linux.dev
Subject: Re: [PATCH mptcp-next v4 4/5] mptcp: track app-limited state in mptcp_sendmsg
Date: Mon, 02 Nov 2026 03:13:54 +0000 [thread overview]
Message-ID: <sashiko-outbox-192855@kernel.org> (raw)
In-Reply-To: <b3d85544ac84b3c83617f72a5cfc893bac2a6304.1793588257.git.tanggeliang@kylinos.cn>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] mptcp: mptcp_rate_check_app_limited() bails out when data is in flight
- [Medium] mptcp: unlocked msk->snd_una read in mptcp_rate_check_app_limited()
--
commit 6075a59b5fc2bd09596bbf554a3f811da115a224
Author: Geliang Tang <geliang@kernel.org>
mptcp: track app-limited state in mptcp_sendmsg
This commit adds mptcp_rate_check_app_limited() to run
tcp_rate_check_app_limited() across all subflows from mptcp_sendmsg_locked()
when no unsent data is queued at the MPTCP level.
> diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
> index 7ccb1c7506a37..ab7de11a448ce 100644
> --- a/net/mptcp/protocol.c
> +++ b/net/mptcp/protocol.c
> @@ -2038,6 +2038,25 @@ static void mptcp_rps_record_subflows(const struct mptcp_sock *msk)
> }
> }
>
> +static void mptcp_rate_check_app_limited(struct sock *sk)
> +{
> + struct mptcp_sock *msk = mptcp_sk(sk);
> + struct mptcp_subflow_context *subflow;
> +
> + if (msk->write_seq != msk->snd_nxt ||
> + mptcp_send_head(sk) || mptcp_rtx_head(sk))
> + return;
[Severity: Medium]
Does checking mptcp_rtx_head(sk) here prevent subflows from being marked
application-limited whenever any sent data is still in flight?
Every sent mptcp_data_frag stays on msk->rtx_queue until a DATA_ACK advances
msk->snd_una past it and __mptcp_clean_una() removes it, so mptcp_rtx_head()
returns non-NULL whenever msk->snd_una != msk->snd_nxt:
net/mptcp/protocol.h:mptcp_rtx_head() {
struct mptcp_sock *msk = mptcp_sk(sk);
if (msk->snd_una == msk->snd_nxt)
return NULL;
return list_first_entry_or_null(&msk->rtx_queue, struct mptcp_data_frag, list);
}
In contrast, tcp_rate_check_app_limited() is designed to run while packets are
in flight below cwnd (tcp_packets_in_flight(tp) < tcp_snd_cwnd(tp)) and
already checks tp->lost_out <= tp->retrans_out on each subflow, while
MPTCP-level reinjection in __mptcp_retransmit_pending_data() resets
msk->first_pending (which is covered by mptcp_send_head(sk)). With the
mptcp_rtx_head(sk) check in place, won't mptcp_rate_check_app_limited() bail
out whenever any unacknowledged data is in flight on the connection?
[Severity: Medium]
Additionally, is it safe to call mptcp_rtx_head(sk) from
mptcp_sendmsg_locked() -> mptcp_rate_check_app_limited() without holding
mptcp_data_lock(sk)?
mptcp_rtx_head() performs a plain 64-bit read of msk->snd_una, whereas
incoming DATA_ACK processing in softirq context updates msk->snd_una under
mptcp_data_lock(sk) even while the user owns the msk socket lock:
mptcp_incoming_options()
ack_update_msk()
mptcp_data_lock(sk)
__mptcp_snd_una_update()
WRITE_ONCE(msk->snd_una, new_snd_una);
Other callers of mptcp_rtx_head() (__mptcp_clean_una(),
__mptcp_retransmit_pending_data(), and __mptcp_retrans()) hold
mptcp_data_lock(sk), and helpers that read msk->snd_una under only the msk
socket lock use READ_ONCE(msk->snd_una). Can this cause a data race or 64-bit
load tearing on 32-bit architectures?
--
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1793588257.git.tanggeliang@kylinos.cn?part=4
next prev parent reply other threads:[~2026-11-02 3:13 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-02 2:58 [PATCH mptcp-next v4 0/5] prepare interfaces for kTLS and sockmap support Geliang Tang
2026-11-02 2:58 ` [PATCH mptcp-next v4 1/5] mptcp: update mptcp_check_readable Geliang Tang
2026-11-02 2:58 ` [PATCH mptcp-next v4 2/5] mptcp: implement peek_len for proto_ops Geliang Tang
2026-11-02 3:19 ` sashiko-bot
2026-11-03 16:32 ` netdev-bot+sashiko
2026-11-02 2:58 ` [PATCH mptcp-next v4 3/5] mptcp: add sendmsg_locked to proto_ops Geliang Tang
2026-11-03 16:32 ` netdev-bot+sashiko
2026-11-02 2:58 ` [PATCH mptcp-next v4 4/5] mptcp: track app-limited state in mptcp_sendmsg Geliang Tang
2026-11-02 3:13 ` sashiko-bot [this message]
2026-11-03 16:32 ` netdev-bot+sashiko
2026-11-02 2:58 ` [PATCH mptcp-next v4 5/5] selftests: mptcp: sockopt: check app_limited Geliang Tang
2026-11-02 5:03 ` [PATCH mptcp-next v4 0/5] prepare interfaces for kTLS and sockmap support 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=sashiko-outbox-192855@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=geliang@kernel.org \
--cc=mptcp@lists.linux.dev \
--cc=sashiko-reviews@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.