🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #17469

[PATCH net 1/7] mptcp: do not use a raised snd_wnd for the send window

#17469
From: "Matthieu Baerts (NGI0)"
Date: Mon, 16 Nov 2026 22:06
88 lines
11988 bytes
ack_update_msk() sets the right edge of the MPTCP send window from the
DATA_ACK and tcp_sk(ssk)->snd_wnd, but this is not always what the peer
announced: mptcp_check_allowed_size() raises it to
window_end - data_seq, so that TCP lets through what the MPTCP-level
window allows.

That is fine for new data. For data sent again, data_seq can be below
snd_una, and snd_wnd ends up too large by the difference. TCP only
overwrites it when an ACK moves things forward on this subflow, see
tcp_may_update_window(). If a DATA_ACK moved by another subflow comes in
on this subflow before that, wnd_end goes past what the peer offered. It
only moves forward, so it stays there.

The sender then transmits data beyond the peer's window: the peer drops
it (MPTCP_MIB_NODSSWINDOW) after TCP acked it, and only an MPTCP-level
retransmission can recover it, which raises snd_wnd again. The
connection can then stay stuck at a low rate for several seconds, with
nothing in flight on any subflow.

This raise has been added by commit b713d0067574 ("mptcp: really share
subflow snd_wnd"), but snd_wnd could already be too large before: when
nothing moves at the TCP level, tcp_may_update_window() ignores a lower
non-zero window, while the peer can announce one with a DATA_ACK that
moved, keeping the same right edge.

Use the window announced in the packet carrying the DATA_ACK instead.

In my case with BBR, a small TCP rmem, and a second path with a much
higher latency, a lower throughput and some losses, this small change
can double the throughput in the worst cases.

The issue has been reproduced with a new Packetdrill test, on a single
subflow: the data is acked by TCP, then by MPTCP with a lower window,
keeping the same right edge. Without this patch, the 2000 bytes written
next were sent, instead of the 1280 bytes up to this right edge:

  dss_dack_window_server.pkt:23: error handling packet: live packet payload: expected 1280 bytes vs actual 2000 bytes

Fixes: 6f8a612a33e4 ("mptcp: keep track of advertised windows right edge")
Cc: stable@vger.kernel.org
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
 net/mptcp/options.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/net/mptcp/options.c b/net/mptcp/options.c
index 02e785a14b8a..a1e65309171e 100644
--- a/net/mptcp/options.c
+++ b/net/mptcp/options.c
@@ -1120,9 +1120,11 @@ static void rwin_update(struct mptcp_sock *msk, struct sock *ssk,
 
 static void ack_update_msk(struct mptcp_sock *msk,
 			   struct sock *ssk,
+			   const struct sk_buff *skb,
 			   struct mptcp_options_received *mp_opt)
 {
 	u64 new_wnd_end, new_snd_una, old_snd_una;
+	u32 win = ntohs(tcp_hdr(skb)->window);
 	struct sock *sk = (struct sock *)msk;
 	u64 snd_nxt;
 
@@ -1143,7 +1145,12 @@ static void ack_update_msk(struct mptcp_sock *msk,
 		     after64(new_snd_una, snd_nxt)))
 		new_snd_una = old_snd_una;
 
-	new_wnd_end = new_snd_una + tcp_sk(ssk)->snd_wnd;
+	/* What the peer announced: tcp_sk(ssk)->snd_wnd can be larger, see
+	 * mptcp_check_allowed_size(), and is not always updated.
+	 */
+	if (likely(!tcp_hdr(skb)->syn))
+		win <<= tcp_sk(ssk)->rx_opt.snd_wscale;
+	new_wnd_end = new_snd_una + win;
 
 	if (after64(new_wnd_end, msk->wnd_end))
 		WRITE_ONCE(msk->wnd_end, new_wnd_end);
@@ -1313,7 +1320,7 @@ bool mptcp_incoming_options(struct sock *sk, struct sk_buff *skb)
 	 * monodirectional flows will stuck
 	 */
 	if (mp_opt.use_ack)
-		ack_update_msk(msk, sk, &mp_opt);
+		ack_update_msk(msk, sk, skb, &mp_opt);
 	rwin_update(msk, sk, skb);
 
 	/* Zero-data-length packets are dropped by the caller and not

-- 
2.55.0
Technical Details
Message-ID: <20261116-net-mptcp-misc-fixes-7-4-rc4-v1-1-bf7656de653e@kernel.org>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!3.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!peer04.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364749-linux-kernel-netdev=dewy.ru
References: <20261116-net-mptcp-misc-fixes-7-4-rc4-v1-0-bf7656de653e@kernel.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!3.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!peer04.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364749-linux-kernel-netdev=dewy.ru
From: matttbe@kernel.org ("Matthieu Baerts (NGI0)")
Newsgroups: linux.kernel.netdev
Subject: [PATCH net 1/7] mptcp: do not use a raised snd_wnd for the send window
Date: Mon, 16 Nov 2026 23:06:08 +0100
Organization: Usenet Network
Message-ID: <20261116-net-mptcp-misc-fixes-7-4-rc4-v1-1-bf7656de653e@kernel.org>
References: <20261116-net-mptcp-misc-fixes-7-4-rc4-v1-0-bf7656de653e@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network; logging-data="2178656"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:7+Tlfv4/xsaMLV77Bins+sXXdgM= sha256:BU66yfq4U0MwcdVYNH5UPvFbJKqpdMkHXkkf+XoCqsk= sha1:G7d6s8yAP+7JHzQ63BSpgXJcwjc= sha256:WbTO9bKpssspnvtPyvAGz9vVpJ3VrmDhgO1PEI0DPy8=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 3D570114D74; Tue, 17 Nov 2026 01:09:15 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.501
X-Spam-Status: No, score=-3.501 tagged_above=-9999 required=6.31 tests=[DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id oH9GZs1HVhZe; Tue, 17 Nov 2026 01:09:10 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-364749-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mail.dewy.ru (Postfix) with ESMTPS id D705F114D78; Tue, 17 Nov 2026 01:09:02 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sto.lore.kernel.org (Postfix) with ESMTP id 1A6F2601903; Mon, 16 Nov 2026 22:09:02 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1794866931; b=qh1O5qGPhB/TDLsTY96VkORRRFdpDFEhwrTL6PtiwIifCS1dt2NvVCAVGXDPQBzSm2PQ m9rpSeByfqGO2H5/VdWGu/N8cThYacVB5FVrm3ckF7w4Esp/LtfSPJ+4i+RsP/DOeeh2b 8aP0RFgWvZLuSpD6UeMuUXHRVDYds0iUVmODnabmSvkUQ0cem6K1oTl15Em6oIlWIzt8k KUUghQjYFUew4tgXUnYuvttCXM3aLjEcdYwp99HWd1Isl8fMV5UdCR+0GgdmGKkQi+6pe CT5KCno4aG8S5u4zQ7br/XfpEuYq5J2SKaBJpPRbjU1jMkvbygJ0FfzdBzJvuFDS8nw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794866931; h=X-Original-To:Received:Received:DKIM-Signature:From:Date:Subject: X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe: List-Unsubscribe:List-Owner:Precedence:MIME-Version:Content-Type: Content-Transfer-Encoding:Message-Id:References:In-Reply-To:To:Cc: X-Mailer:X-Developer-Signature:X-Developer-Key; bh=uMYq6JE8xuNZqyVh9m0VgbWr7vZYU9GSmfyKxFS5D+A=; b=EjcaTw5C6abFNVAo+eIQ2+uWLo8lGGAdqx2ACKD5cEC1Rs2YzMNAMhyHELnZCYEh85DL HLyRwcXqHtpSr70nm+ZTcsicRK2+Dy3rr5Z2WT0XusgElqYE+RMsVDC3L3BvPAHoOr70o XRhhl29WU3Nvubb7YktTh+WJGPZpUwZVgxpIu5CnrPlKpyMsYl3O09CS5ECTA26va3AGc OWo+g63txYYRX1HSiWbTU3o4J3+1ZW6poCId0Q1AdKvaZoQJhdHfwebTQz8Zrxiy870Dc L4iCvak4t/V+fFBzp0ugbA/Qhj1RCWxabp4uGR+J5+KH7y+8by9iXhQzdDYu6IjUkpw==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=DLidWKMH; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5594A606A89E; Mon, 16 Nov 2026 22:08:51 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=DLidWKMH
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794866930; b=ZBTa2aOzENuvUDdo2y9YCANN1d3Zxw7hjclePo6hSLOWBydEadRZoHpDzZ2myiw2ghbc abqaDeJwsJ48iJpb5HAOijQNwtRrfoPmB8OayqdKINy2e+lbuBJoQjxTFVsED45K6i2dc rWFqKuvjgF3xR0/cQao2uZhuat4wrOPdyAj0J5Xh/dBF2ABlVU8CbSGPIGBcdDwRcWyNN sIXqItxeNUABi2r6Hp0Mxu7iKW5IVpKDqcQmUHgKg/F316KLRV0mCDwZeVokoycKANkoV iJwXEob9Qb/Q9C6kzGObFr04G98vYSDa4pMP0ZcowLGY02uKWAVp8Vkr1QujrJZw7qA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794866930; h=Received:DKIM-Signature:From:Date:Subject:MIME-Version:Content-Type: Content-Transfer-Encoding:Message-Id:References:In-Reply-To:To:Cc: X-Mailer:X-Developer-Signature:X-Developer-Key; bh=uMYq6JE8xuNZqyVh9m0VgbWr7vZYU9GSmfyKxFS5D+A=; b=1Bb74MJsS8T7VPi33zKfdUsTD4eeEe/cU3c5FfJZyXAppyywOD156cCfsvZOc8rPBy2U VZNaTkV3X6HdGR25wb6bhp3ohFHB3+TaAN1awXcOdydWjQnPlZfosaTRVi/HGGcFxRrht b97eLstj9zcTY4nk5Y+X/2c8kGLVanDJiDcaE7YgBC3EI24o9TxH7bslGQ4t+tezvZAYM PoPSzdoZGvdtvGsIqKoP4fK0AGpD56Dpl9kV8HqxnIJtqFXZ9GTUTRcbA4pxXgRZMB9ZV genZ30XYpQO8J0JDac9lhx20z0msp+RtGrFzhCp5l3IVL/FDXLTZwas56EZJaOOAYnA==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=DLidWKMH; arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 773A6606A330; Mon, 16 Nov 2026 22:08:50 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id CA7BA1F000C4; Mon, 16 Nov 2026 22:08:47 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794866930; bh=uMYq6JE8xuNZqyVh9m0VgbWr7vZYU9GSmfyKxFS5D+A=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=DLidWKMHgkte+wcx8XviGctfDknmqXQhV6a00gH3EIHqU7Afe13izKrBMzLE+ahf6 SHtdWjtSQGVabAvD+hROIl3Z1XeYFgI8CZ/B2+ZIYcitEPqOIUJsdv5PgGY1Gek+OP KzBi5m2FWAoHqC+q+Xg8PZIDQYRzyV4tSA8lwRAt3jfAcd20LZhq0XHAM4fs+EoiTt mUFOrjYuMshD/iMSmvXxQtCMk/y4DCDWIy1oIu2FrWHpcu2W11ZYI+yeJ7Vf+JqzdE t6jFyXF6WTGmDDqXQmwqHz67UIp/6BmkRUB5gDmIjuzRtlNaXTT2ZTlhE9acaRpSSe wZ/q+ng1XXUdw==
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-In-Reply-To: <20261116-net-mptcp-misc-fixes-7-4-rc4-v1-0-bf7656de653e@kernel.org>
X-Cc: netdev@vger.kernel.org, mptcp@lists.linux.dev, linux-kernel@vger.kernel.org, "Matthieu Baerts (NGI0)" <matttbe@kernel.org>, stable@vger.kernel.org
X-Mailer: b4 0.17-dev
X-Developer-Signature: v=1; a=openpgp-sha256; l=3711; i=matttbe@kernel.org; h=from:subject:message-id; bh=7zDQSYKcpnKhli3dcbyFsT9TAjx17AqSPorjk+qb/hU=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGLJ+1z2bodi3o0M+f3vSn0sBImwn/iz4FNWxe9NV0U2PP iQeZGiX7yhlYRDjYpAVU2SRbovMn/m8irfEy88CZg4rE8gQBi5OAZjInY+MDCff+5y5OeHnv7yd x9JPXfq3/9bpx9eXbbEItUjeWN//79oXhv9ufTeVH62qmh948c+K8mPq8xym/kxg7HytLaUa5ls 3/yc3AA==
X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073
X-Received-Bytes: 11702