From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BF17540756D; Mon, 11 May 2026 15:46:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778514413; cv=none; b=Nrr7xKdQQFGR3jlSdA0fcUm1Dnmm14NeMWz9tAKofzY2+r4Nr16ahFGNEYGDzqNm+eXQdHbdXiIJtpiZy3UZ1+xcvTkbvMHh5qTK+ygdX4mbs/oAzPvVuCyZsngAgqPbJsiNLCenUS5e7pfpFZdVKQvmXpe6SXc0V+rTLk+Zh9Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778514413; c=relaxed/simple; bh=qQvn5axOR+yyPoQDWmxod2/JnSKoOIIR/aijmbsFW08=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=S4etmu0HSdMRNx7EKrlvmxiAKJ1dRnQdOBuUL5CkT3Gqwa6bbDXhZFNAZKsBvfj6zpNLSK8jXw7BXVCp4ED9JJ0mUBoPNXWyZ9GeFo1PKFdhYtgGMSP3TAxeUW04Haol4nUqeTWqeQHub3k4Wzkd03old2Ypd3l6KbVEEP1uK08= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=LdylosbD; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="LdylosbD" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E835EC2BCC9; Mon, 11 May 2026 15:46:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1778514413; bh=qQvn5axOR+yyPoQDWmxod2/JnSKoOIIR/aijmbsFW08=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=LdylosbDnxzAsazD/O59xgGIElaxPEfRsB5iXyNnOGcH635D4Lw5XEKFXWMWlov3N yP8OuoMi4C+eVLfq7QrYqDBLxtlBMoowJYcudAMWPbpA3kgvY82oV9RGQrWwLYZ6Ob 4KOuzr2/3WJpuqbAkojbkNkdZHtBvy4k8zkagy0aV7514PTOAB2ESp2VrqCUc+PHZR 7C16N38jgQz2MQOdX3ClWnjwqvme2sOg6anw+Mntr8PynuCf2Ll4uYhUhiecdmUF6Y 7SbfUH4uFXD1WriFbMUee7yh8VcdeV4E795XodZDRz4b3wA14TENaugFPjWC4v1CN5 H+xu34rxaa+eA== From: "Matthieu Baerts (NGI0)" Date: Mon, 11 May 2026 17:46:27 +0200 Subject: [PATCH net 1/5] mptcp: do not drop partial packets Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260511-net-mptcp-misc-fixes-7-1-rc4-v1-1-5ee57cb2b7eb@kernel.org> References: <20260511-net-mptcp-misc-fixes-7-1-rc4-v1-0-5ee57cb2b7eb@kernel.org> In-Reply-To: <20260511-net-mptcp-misc-fixes-7-1-rc4-v1-0-5ee57cb2b7eb@kernel.org> To: Mat Martineau , Geliang Tang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman Cc: Eric Dumazet , netdev@vger.kernel.org, mptcp@lists.linux.dev, linux-kernel@vger.kernel.org, "Matthieu Baerts (NGI0)" , Shardul Bankar , stable@vger.kernel.org X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=3127; i=matttbe@kernel.org; h=from:subject:message-id; bh=doSwMYEfSiK6uGg6E6Qa8BN/Nu92k84XWlJ5BdjtdXs=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGLIYfz6ZWeE1yfzkspV394R0XNH5dHOKVWF6pkDM7lJrv n5f1Q+LO0pZGMS4GGTFFFmk2yLzZz6v4i3x8rOAmcPKBDKEgYtTACZifJfhn5149invW49Mba9P +PWhdNoT9/Ny9vN07h88pVC2iIWr/DEjw+U/P19pVhzfFHszkv2SzArzw87y57lcH7itNpn0M8J 9PScA X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 From: Shardul Bankar When a packet arrives with map_seq < ack_seq < end_seq, the beginning of the packet has already been acknowledged but the end contains new data. Currently the entire packet is dropped as "old data," forcing the sender to retransmit. Instead, skip the already-acked bytes by adjusting the skb offset and enqueue only the new portion. Update bytes_received and ack_seq to reflect the new data consumed. A previous attempt at this fix has been sent by Paolo Abeni [1], but had issues [2]: it also added a zero-window check and changed rcv_wnd_sent initialization, which caused test regressions. This version addresses only the partial packet handling without modifying receive window accounting. Fixes: ab174ad8ef76 ("mptcp: move ooo skbs into msk out of order queue.") Cc: stable@vger.kernel.org Link: https://lore.kernel.org/c9b426a4e163aa3c4fe8b80c79f1a610f47ae7d8.1763075056.git.pabeni@redhat.com [1] Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/600 [2] Signed-off-by: Shardul Bankar [pabeni@redhat.com: update map] Signed-off-by: Paolo Abeni Reviewed-by: Matthieu Baerts (NGI0) Signed-off-by: Matthieu Baerts (NGI0) --- v3: (Paolo) - update map_seq, too (AI tool) v2: (Shardul) - Drop the mptcp_try_coalesce() attempt for partial packets, since non-zero offset always prevents coalescing (Paolo). - https://lore.kernel.org/20260422143931.43281-1-shardul.b@mpiricsoftware.com v1: (Shardul) - https://lore.kernel.org/20260422120954.8877-1-shardul.b@mpiricsoftware.com v0: (Paolo) - https://lore.kernel.org/mptcp/c9b426a4e163aa3c4fe8b80c79f1a610f47ae7d8.1763075056.git.pabeni@redhat.com --- net/mptcp/protocol.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index 4546a8b09884..859df49e16dc 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -397,12 +397,26 @@ static bool __mptcp_move_skb(struct sock *sk, struct sk_buff *skb) return false; } - /* old data, keep it simple and drop the whole pkt, sender - * will retransmit as needed, if needed. + /* Completely old data? */ + if (!after64(MPTCP_SKB_CB(skb)->end_seq, msk->ack_seq)) { + MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_DUPDATA); + mptcp_drop(sk, skb); + return false; + } + + /* Partial packet: map_seq < ack_seq < end_seq. + * Skip the already-acked bytes and enqueue the new data. */ - MPTCP_INC_STATS(sock_net(sk), MPTCP_MIB_DUPDATA); - mptcp_drop(sk, skb); - return false; + copy_len = MPTCP_SKB_CB(skb)->end_seq - msk->ack_seq; + MPTCP_SKB_CB(skb)->offset += msk->ack_seq - MPTCP_SKB_CB(skb)->map_seq; + MPTCP_SKB_CB(skb)->map_seq += msk->ack_seq - + MPTCP_SKB_CB(skb)->map_seq; + msk->bytes_received += copy_len; + WRITE_ONCE(msk->ack_seq, msk->ack_seq + copy_len); + + skb_set_owner_r(skb, sk); + __skb_queue_tail(&sk->sk_receive_queue, skb); + return true; } static void mptcp_stop_rtx_timer(struct sock *sk) -- 2.53.0