From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fout-b5-smtp.messagingengine.com (fout-b5-smtp.messagingengine.com [202.12.124.148]) (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 67C803AEF5A for ; Tue, 26 May 2026 16:13:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.148 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779812001; cv=none; b=C5Q465bpWTdUJ+DJbcNjHMc9s9R+OFECqD0azrFSgOZPquSIAaKUNziLXuFH0sxN9KOOHIfoDQbKlqk+Cv9jiyE/27OWP0ao//7YuPw8qhd1F7SXmiA5MRkp4nnSyhkusqLxUWCGYcGS6ksSKOfiV3FqLZhaKugAQxhwzn/eGlo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779812001; c=relaxed/simple; bh=L3rwaAi/73P1SG6xoYEcJfPF0+vHETBnkx8uP/JFhuY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DKrogWTPhIRtUX4NyBibFFAHhRx+zuXJVGo6MWJ9tQPX0x1mUa8gqoqT+JF1d/8b6EfN3X1WaTBHuBbtTpD/U5CYMuR9cSLyOlT1Mt/Ovh+7A2KBtKiGUgqg8OwN148hvOb7RmR+Q7LzMdOWim3uyrlbBj0pHZRYKGqrvNTLuf0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=fastmail.im; spf=pass smtp.mailfrom=fastmail.im; dkim=pass (2048-bit key) header.d=fastmail.im header.i=@fastmail.im header.b=EywIqM/K; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=nnk823nW; arc=none smtp.client-ip=202.12.124.148 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=fastmail.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fastmail.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fastmail.im header.i=@fastmail.im header.b="EywIqM/K"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="nnk823nW" Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfout.stl.internal (Postfix) with ESMTP id 2FF2A1D00094; Tue, 26 May 2026 12:13:19 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-04.internal (MEProxy); Tue, 26 May 2026 12:13:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.im; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm3; t=1779811999; x= 1779898399; bh=6eyk3yzfgJTFHwNv6Y9QfAinNGyoJU1Y80rOBjZss6E=; b=E ywIqM/K8iW6lgVExjiczaFgC10loZmPxXWHjsoQ9D+Rlc6LKu2extHLBuaGmVgVV 9boNIGc5CLM0db2uJtCUdKRHBGjiOAO0FBwrB2B0SA5bn4Kbcm3E3fgB20T/0vB6 gpIVBKOivGGHJC72IKpCUNAPmzwS8IpH9NjnnUZKRanRFwwldETVIgFXUhMvrUXp qGMff+jTvGyIG3Ab1LSrdG/VDMcMsM3t26Vydw1sqtM6CeZjf+20J82IsmkwLjv5 n1ZcPT+NyD7UyB5L/v2G1+IAU/yqb/uP+KHzt+1iHLwjMriDMbfukn5aXcOgrC7J Bsxk8iqAlWAv5tebQ40sQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1779811999; x=1779898399; bh=6 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PU34NW86RiNnjHJa/xF6cD3qloFRmIiGFHolYg X-ME-Proxy: Feedback-ID: i559e4809:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 26 May 2026 12:13:18 -0400 (EDT) From: Alice Mikityanska To: Daniel Borkmann , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Xin Long , Willem de Bruijn , Willem de Bruijn , David Ahern , Nikolay Aleksandrov Cc: Shuah Khan , Stanislav Fomichev , Andrew Lunn , Simon Horman , Florian Westphal , netdev@vger.kernel.org, Alice Mikityanska Subject: [PATCH net-next v5 04/11] net: Enable BIG TCP with partial GSO Date: Tue, 26 May 2026 18:11:53 +0200 Message-ID: <20260526161200.1135899-5-alice.kernel@fastmail.im> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260526161200.1135899-1-alice.kernel@fastmail.im> References: <20260526161200.1135899-1-alice.kernel@fastmail.im> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Alice Mikityanska skb_segment is called for partial GSO, when netif_needs_gso returns true in validate_xmit_skb. Partial GSO is needed, for example, when segmentation of tunneled traffic is offloaded to a NIC that only supports inner checksum offload. Currently, skb_segment clamps the segment length to 65534 bytes, because gso_size == 65535 is a special value GSO_BY_FRAGS, and we don't want to accidentally assign mss = 65535, as it would fall into the GSO_BY_FRAGS check further in the function. This implementation, however, artificially blocks len > 65534, which is possible since the introduction of BIG TCP. To allow bigger lengths and avoid resegmentation of BIG TCP packets, store the gso_by_frags flag in the beginning and don't use a special value of mss for this purpose after mss was modified. Signed-off-by: Alice Mikityanska Reviewed-by: Willem de Bruijn --- net/core/skbuff.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/net/core/skbuff.c b/net/core/skbuff.c index bbc15e946c27..4d69997e5e86 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -4750,6 +4750,7 @@ struct sk_buff *skb_segment(struct sk_buff *head_skb, struct sk_buff *tail = NULL; struct sk_buff *list_skb = skb_shinfo(head_skb)->frag_list; unsigned int mss = skb_shinfo(head_skb)->gso_size; + bool gso_by_frags = mss == GSO_BY_FRAGS; unsigned int doffset = head_skb->data - skb_mac_header(head_skb); unsigned int offset = doffset; unsigned int tnl_hlen = skb_tnl_header_len(head_skb); @@ -4765,7 +4766,7 @@ struct sk_buff *skb_segment(struct sk_buff *head_skb, int nfrags, pos; if ((skb_shinfo(head_skb)->gso_type & SKB_GSO_DODGY) && - mss != GSO_BY_FRAGS && mss != skb_headlen(head_skb)) { + !gso_by_frags && mss != skb_headlen(head_skb)) { struct sk_buff *check_skb; for (check_skb = list_skb; check_skb; check_skb = check_skb->next) { @@ -4793,7 +4794,7 @@ struct sk_buff *skb_segment(struct sk_buff *head_skb, sg = !!(features & NETIF_F_SG); csum = !!can_checksum_protocol(features, proto); - if (sg && csum && (mss != GSO_BY_FRAGS)) { + if (sg && csum && !gso_by_frags) { if (!(features & NETIF_F_GSO_PARTIAL)) { struct sk_buff *iter; unsigned int frag_len; @@ -4827,9 +4828,8 @@ struct sk_buff *skb_segment(struct sk_buff *head_skb, /* GSO partial only requires that we trim off any excess that * doesn't fit into an MSS sized block, so take care of that * now. - * Cap len to not accidentally hit GSO_BY_FRAGS. */ - partial_segs = min(len, GSO_BY_FRAGS - 1) / mss; + partial_segs = len / mss; if (partial_segs > 1) mss *= partial_segs; else @@ -4853,7 +4853,7 @@ struct sk_buff *skb_segment(struct sk_buff *head_skb, int hsize; int size; - if (unlikely(mss == GSO_BY_FRAGS)) { + if (unlikely(gso_by_frags)) { len = list_skb->len; } else { len = head_skb->len - offset; -- 2.54.0