All of lore.kernel.org
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: matttbe@kernel.org
Cc: mptcp@lists.linux.dev, kuba@kernel.org
Subject: Re: [PATCH mptcp-net v3 40/50] mptcp: send the DATA_ACK after moving the backlog
Date: Thu, 26 Nov 2026 23:29:54 +0000	[thread overview]
Message-ID: <179573579467.3133.15201406203716765653@kernel.org> (raw)
In-Reply-To: <20261124-mptcp-cmason-fixes-v3-40-416c0920c73f@kernel.org>

Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 1 · Low: 1

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [Medium] The fix tries only one subflow, the one recorded from the last
  backlog skb with a non-NULL skb->sk, and gives up if that subflow…
- [Low] The new mptcp_subflow_schedule_ack()
  (net/mptcp/protocol.c:2421-2428) calls tcp_send_delayed_ack(ssk) on a…

--

mptcp: send the DATA_ACK after moving the backlog

Data received while the msk is owned by the user goes to the backlog.
The TCP ACKs sent for it carry the old DATA_ACK, so the peer can do a
spurious MPTCP-level retransmission. This patch schedules a delayed ACK
on the subflow of the last skb spooled from the backlog, if no ACK is
already pending there.

> diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
> index 0ff84d9684f13..2f89719e84545 100644
> --- a/net/mptcp/protocol.c
> +++ b/net/mptcp/protocol.c
> @@ -2417,10 +2417,21 @@ static void mptcp_rcv_space_adjust(struct mptcp_sock *msk, int copied)
>  	msk->rcvq_space.time = mstamp;
>  }
>  
> +/* The ACKs of the data put in the backlog carried the previous DATA_ACK */
> +static void mptcp_subflow_schedule_ack(struct sock *ssk)
> +{
> +	bool slow = lock_sock_fast(ssk);
> +
> +	if (tcp_can_send_ack(ssk) && !inet_csk_ack_scheduled(ssk))
> +		tcp_send_delayed_ack(ssk);

[Severity: Low]
Is the side effect on the subflow's TCP delayed-ACK heuristics intended?

At this point TCP has already ACKed the data, possibly right away, so
the subflow has no new TCP data to acknowledge. tcp_send_delayed_ack()
still sets ICSK_ACK_SCHED | ICSK_ACK_TIMER and arms icsk_delack_timer.

The patch targets the case where the peer has nothing more to send. If
nothing goes out on this subflow within ato, the timer fires and
tcp_delack_timer_handler() treats it as a missed delayed ACK:

net/ipv4/tcp_timer.c:tcp_delack_timer_handler() {
    ...
	if (inet_csk_ack_scheduled(sk)) {
		if (!inet_csk_in_pingpong_mode(sk)) {
			/* Delayed ACK missed: inflate ATO. */
			icsk->icsk_ack.ato = min3((u32)icsk->icsk_ack.ato << 1,
						  icsk->icsk_rto,
						  (u32)TCP_DELACK_MAX);
		} else {
			...
			inet_csk_exit_pingpong_mode(sk);
			icsk->icsk_ack.ato      = TCP_ATO_MIN;
		}
		...
		__NET_INC_STATS(sock_net(sk), LINUX_MIB_DELAYEDACKS);
	}
}

This can happen every time data lands in the msk backlog while the msk
is owned, for example when recvmsg() or the worker overlaps incoming
data. Each time, the subflow's ato can be inflated or pingpong mode can
be exited for a reason that has nothing to do with TCP.
TcpExtDelayedACKs is also incremented.

The commit message only says the DATA_ACK is sent "when the delayed ACK
timer expires". Could it mention these effects? Alternatively, could the
DATA_ACK be sent without going through the TCP delayed-ACK state?

> +	unlock_sock_fast(ssk, slow);
> +}
> +
>  static bool __mptcp_move_skbs(struct sock *sk, struct list_head *skbs, u32 *delta)
>  {
>  	struct sk_buff *skb = list_first_entry(skbs, struct sk_buff, list);
>  	struct mptcp_sock *msk = mptcp_sk(sk);
> +	struct sock *ssk = NULL;
>  	bool moved = false;
>  
>  	while (1) {
> @@ -2428,6 +2439,9 @@ static bool __mptcp_move_skbs(struct sock *sk, struct list_head *skbs, u32 *delt
>  		list_del(&skb->list);
>  		*delta += skb->truesize;
>  
> +		/* NULL if the subflow has been closed */
> +		if (skb->sk)
> +			ssk = skb->sk;
>  		moved |= __mptcp_move_skb(sk, skb);
>  		if (list_empty(skbs))
>  			break;
> @@ -2439,6 +2453,9 @@ static bool __mptcp_move_skbs(struct sock *sk, struct list_head *skbs, u32 *delt
>  	if (!moved)
>  		return false;
>  
> +	if (ssk && !__mptcp_check_fallback(msk))
> +		mptcp_subflow_schedule_ack(ssk);

[Severity: Medium]
Only one subflow is tried here. What happens when that subflow cannot
carry the updated DATA_ACK?

In two cases nothing gets scheduled even though msk->ack_seq has moved
forward.

First, a subflow may be closed with MPTCP_CF_PUSH while the msk is
owned, for example by a PM subflow destroy or a worker close. If data
arrived on that subflow before the close, mptcp_cleanup_ssk_backlog()
clears skb->sk on its backlog skbs:

net/mptcp/protocol.c:mptcp_cleanup_ssk_backlog() {
    ...
		atomic_sub(skb->truesize, &skb->sk->sk_rmem_alloc);
		skb->sk = NULL;
    ...
}

If all spooled skbs came from that subflow, ssk stays NULL in
__mptcp_move_skbs() and mptcp_subflow_schedule_ack() is never called.

Second, the last skb's subflow may move to TCP_CLOSE after its data was
queued and before spooling, for example after an RST and before
__mptcp_close_ssk() runs. tcp_can_send_ack(ssk) then returns false
inside mptcp_subflow_schedule_ack(), and nothing is scheduled.

In both cases no other entry in msk->conn_list is tried, even if another
subflow is ESTABLISHED and could carry the connection-level DATA_ACK.

The later mptcp_cleanup_rbuf(msk, 0) from release_cb doesn't seem to
cover this. With copied == 0 it only acts on subflows that already have
an ACK scheduled and more than rcv_mss of unacked data. So the peer
would keep the stale DATA_ACK and could still do the spurious
retransmission this patch is meant to avoid.

The v2 note covers the second case, but the commit message itself
mentions neither case. Would it make sense to fall back to another
subflow in conn_list that can send ACKs?

> +
>  	/* Only the worker can close an orphan, as it must then destroy it */
>  	if (!sock_flag(sk, SOCK_DEAD))
>  		mptcp_check_data_fin(sk);

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261124-mptcp-cmason-fixes-v3-0-416c0920c73f%40kernel.org

  reply	other threads:[~2026-11-26 23:29 UTC|newest]

Thread overview: 105+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-24 21:59 [PATCH mptcp-net v3 00/50] mptcp: misc fixes Matthieu Baerts (NGI0)
2026-11-24 21:59 ` [PATCH mptcp-net v3 01/50] mptcp: keep an orphan while it can send its data Matthieu Baerts (NGI0)
2026-11-25  1:16   ` Mat Martineau
2026-11-25  1:17     ` Mat Martineau
2026-11-26 23:29   ` netdev-bot+sashiko
2026-11-24 21:59 ` [PATCH mptcp-net v3 02/50] mptcp: limit an orphan probing a zero window Matthieu Baerts (NGI0)
2026-11-25  1:19   ` Mat Martineau
2026-11-24 21:59 ` [PATCH mptcp-net v3 03/50] mptcp: count orphans as TCP does Matthieu Baerts (NGI0)
2026-11-25  1:21   ` Mat Martineau
2026-11-24 21:59 ` [PATCH mptcp-net v3 04/50] mptcp: return EOF after a DATA_FIN, " Matthieu Baerts (NGI0)
2026-11-26  1:57   ` Mat Martineau
2026-11-26  2:59     ` Geliang Tang
2026-11-26  8:06       ` Matthieu Baerts
2026-11-26 23:29   ` netdev-bot+sashiko
2026-11-24 21:59 ` [PATCH mptcp-net v3 05/50] mptcp: let TCP send orphan data after fallback Matthieu Baerts (NGI0)
2026-11-24 21:59 ` [PATCH mptcp-net v3 06/50] mptcp: reset the subflow on abort " Matthieu Baerts (NGI0)
2026-11-26 23:29   ` netdev-bot+sashiko
2026-11-24 21:59 ` [PATCH mptcp-net v3 07/50] mptcp: wake up blocked senders when no sf left Matthieu Baerts (NGI0)
2026-11-24 21:59 ` [PATCH mptcp-net v3 08/50] mptcp: set SEND_SHUTDOWN on close by an sf error Matthieu Baerts (NGI0)
2026-11-24 21:59 ` [PATCH mptcp-net v3 09/50] mptcp: start close timeout on initial sf shutdown Matthieu Baerts (NGI0)
2026-11-24 21:59 ` [PATCH mptcp-net v3 10/50] mptcp: process a DATA_FIN received with old data Matthieu Baerts (NGI0)
2026-11-26 23:29   ` netdev-bot+sashiko
2026-11-24 21:59 ` [PATCH mptcp-net v3 11/50] mptcp: no sf left: process pending MP_FASTCLOSE Matthieu Baerts (NGI0)
2026-11-27  1:12   ` Geliang Tang
2026-11-27 18:57     ` Matthieu Baerts
2026-12-01  8:59       ` Geliang Tang
2026-11-24 21:59 ` [PATCH mptcp-net v3 12/50] mptcp: no sf left: process pending DATA_FIN Matthieu Baerts (NGI0)
2026-11-24 22:33   ` sashiko-bot
2026-11-26 16:50     ` Matthieu Baerts
2026-11-26 23:29   ` netdev-bot+sashiko
2026-11-24 21:59 ` [PATCH mptcp-net v3 13/50] mptcp: process pending close events at accept() Matthieu Baerts (NGI0)
2026-11-27  1:06   ` Geliang Tang
2026-11-24 21:59 ` [PATCH mptcp-net v3 14/50] mptcp: report errors received before accept() Matthieu Baerts (NGI0)
2026-11-27  1:02   ` Geliang Tang
2026-11-27  1:04   ` Geliang Tang
2026-11-24 21:59 ` [PATCH mptcp-net v3 15/50] mptcp: clear sk_err on connect(), as TCP does Matthieu Baerts (NGI0)
2026-11-26  6:40   ` Geliang Tang
2026-11-26  8:15     ` Matthieu Baerts
2026-11-24 21:59 ` [PATCH mptcp-net v3 16/50] mptcp: clear DEFER_CONNECT on disconnect Matthieu Baerts (NGI0)
2026-11-26  6:41   ` Geliang Tang
2026-11-24 21:59 ` [PATCH mptcp-net v3 17/50] mptcp: report sf aborts during deferred connect Matthieu Baerts (NGI0)
2026-11-27  1:00   ` Geliang Tang
2026-11-24 21:59 ` [PATCH mptcp-net v3 18/50] mptcp: no fastclose reset from SYN_SENT subflows Matthieu Baerts (NGI0)
2026-11-26  7:04   ` Geliang Tang
2026-11-26  7:35     ` Matthieu Baerts
2026-11-26  8:02       ` Geliang Tang
2026-11-24 21:59 ` [PATCH mptcp-net v3 19/50] mptcp: fastopen: keep listeners and connections Matthieu Baerts (NGI0)
2026-11-26  8:20   ` Geliang Tang
2026-11-24 21:59 ` [PATCH mptcp-net v3 20/50] mptcp: don't inherit fastopening from a listener Matthieu Baerts (NGI0)
2026-11-26  7:07   ` Geliang Tang
2026-11-24 21:59 ` [PATCH mptcp-net v3 21/50] mptcp: drop non-MP_JOIN cookie ACKs on PM listeners Matthieu Baerts (NGI0)
2026-11-27  1:17   ` Geliang Tang
2026-11-24 21:59 ` [PATCH mptcp-net v3 22/50] mptcp: close a subflow reset for a bad mapping Matthieu Baerts (NGI0)
2026-11-27  1:17   ` Geliang Tang
2026-11-24 21:59 ` [PATCH mptcp-net v3 23/50] mptcp: pm: kernel: count endpoint listeners as sockets in use Matthieu Baerts (NGI0)
2026-11-24 21:59 ` [PATCH mptcp-net v3 24/50] mptcp: count a listener once when listen() is called again Matthieu Baerts (NGI0)
2026-11-24 21:59 ` [PATCH mptcp-net v3 25/50] mptcp: send the infinite map in a single segment Matthieu Baerts (NGI0)
2026-11-26 23:29   ` netdev-bot+sashiko
2026-11-24 21:59 ` [PATCH mptcp-net v3 26/50] mptcp: keep room for infinite map after fallback Matthieu Baerts (NGI0)
2026-11-26 23:29   ` netdev-bot+sashiko
2026-11-24 21:59 ` [PATCH mptcp-net v3 27/50] mptcp: do not fallback while old data is in flight Matthieu Baerts (NGI0)
2026-11-24 21:59 ` [PATCH mptcp-net v3 28/50] mptcp: stop resending data to a peer that fell back Matthieu Baerts (NGI0)
2026-11-24 21:59 ` [PATCH mptcp-net v3 29/50] mptcp: don't resend data acked without MPTCP opts Matthieu Baerts (NGI0)
2026-11-24 22:36   ` sashiko-bot
2026-11-26 16:53     ` Matthieu Baerts
2026-11-26 23:29   ` netdev-bot+sashiko
2026-11-24 21:59 ` [PATCH mptcp-net v3 30/50] mptcp: pm: kernel: don't count signal+subflow ID 0 endp Matthieu Baerts (NGI0)
2026-11-24 21:59 ` [PATCH mptcp-net v3 31/50] selftests: mptcp: join: check re-adding " Matthieu Baerts (NGI0)
2026-11-24 21:59 ` [PATCH mptcp-net v3 32/50] mptcp: reclaim forward memory after coalescing skbs Matthieu Baerts (NGI0)
2026-11-24 21:59 ` [PATCH mptcp-net v3 33/50] mptcp: don't charge a shared page twice at accept() Matthieu Baerts (NGI0)
2026-11-26  2:20   ` Mat Martineau
2026-11-26 14:32     ` Matthieu Baerts
2026-11-24 21:59 ` [PATCH mptcp-net v3 34/50] mptcp: don't charge the backlog " Matthieu Baerts (NGI0)
2026-11-26  2:43   ` Mat Martineau
2026-11-26 14:41     ` Matthieu Baerts
2026-11-24 21:59 ` [PATCH mptcp-net v3 35/50] mptcp: don't charge a subflow twice when it joins during accept() Matthieu Baerts (NGI0)
2026-11-24 21:59 ` [PATCH mptcp-net v3 36/50] mptcp: continue the last mapping after a fallback Matthieu Baerts (NGI0)
2026-11-26 23:29   ` netdev-bot+sashiko
2026-11-24 21:59 ` [PATCH mptcp-net v3 37/50] mptcp: keep the first byte after a simult connect Matthieu Baerts (NGI0)
2026-11-24 22:45   ` sashiko-bot
2026-11-26 23:29   ` netdev-bot+sashiko
2026-11-24 21:59 ` [PATCH mptcp-net v3 38/50] mptcp: move to ESTABLISHED " Matthieu Baerts (NGI0)
2026-11-24 21:59 ` [PATCH mptcp-net v3 39/50] mptcp: fix MSG_PEEK after a partly peeked skb Matthieu Baerts (NGI0)
2026-11-24 21:59 ` [PATCH mptcp-net v3 40/50] mptcp: send the DATA_ACK after moving the backlog Matthieu Baerts (NGI0)
2026-11-26 23:29   ` netdev-bot+sashiko [this message]
2026-11-24 21:59 ` [PATCH mptcp-net v3 41/50] selftests: mptcp: join: infinite map: no spurious rtx Matthieu Baerts (NGI0)
2026-11-24 21:59 ` [PATCH mptcp-net v3 42/50] selftests: mptcp: connect: trunc: wait for acks Matthieu Baerts (NGI0)
2026-11-24 22:00 ` [PATCH mptcp-net v3 43/50] mptcp: order write_seq and DATA_FIN flag Matthieu Baerts (NGI0)
2026-11-26 23:29   ` netdev-bot+sashiko
2026-11-24 22:00 ` [PATCH mptcp-net v3 44/50] mptcp: order write_seq and DATA_FIN flag for fallback Matthieu Baerts (NGI0)
2026-11-24 22:00 ` [PATCH mptcp-net v3 45/50] Squash to "bpf: Add mptcp packet scheduler struct_ops" Matthieu Baerts (NGI0)
2026-11-26 23:29   ` netdev-bot+sashiko
2026-11-24 22:00 ` [PATCH mptcp-net v3 46/50] Squash to "bpf: Export mptcp packet scheduler helpers" Matthieu Baerts (NGI0)
2026-11-24 22:45   ` sashiko-bot
2026-11-26 23:29   ` netdev-bot+sashiko
2026-11-24 22:00 ` [PATCH mptcp-next mptcp-net v3 47/50] mptcp: push pending data after a fallback on reception Matthieu Baerts (NGI0)
2026-11-24 22:00 ` [PATCH mptcp-next mptcp-net v3 48/50] mptcp: report errors as TCP does when closing Matthieu Baerts (NGI0)
2026-11-24 22:52   ` sashiko-bot
2026-11-26 23:29   ` netdev-bot+sashiko
2026-11-24 22:00 ` [PATCH mptcp-next mptcp-net v3 49/50] mptcp: trace: name all the mapping statuses Matthieu Baerts (NGI0)
2026-11-24 22:00 ` [PATCH RFC mptcp-next mptcp-net v3 50/50] mptcp: reset when the DSS disappears after a DATA_ACK Matthieu Baerts (NGI0)
2026-11-24 22:36   ` sashiko-bot
2026-11-26 23:29   ` netdev-bot+sashiko
2026-11-25  0:39 ` [PATCH mptcp-net v3 00/50] mptcp: misc fixes MPTCP CI
2026-11-26 16:54 ` Matthieu Baerts

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=179573579467.3133.15201406203716765653@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=kuba@kernel.org \
    --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 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.