From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fhigh-b6-smtp.messagingengine.com (fhigh-b6-smtp.messagingengine.com [202.12.124.157]) (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 E174B303C87 for ; Thu, 11 Jun 2026 19:30:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.157 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781206242; cv=none; b=iPrErtSkM6ku32/ffY5szjzq9iqQqfVXuupUr65CpEaBroKoZtP7K4CFwQjbO3IxHPfbIS6Pp1luDzo4fOQ5d/H47HMWnD/AOyI5KFxVp/MMxjgBlkWdGMnFs3Caizz/rf9bPDupdRacs8TEp+sqybw02bd6OPsyn00fPSzBtxI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781206242; c=relaxed/simple; bh=8Y41lsTwruYuymBRKx/WwbkfnxDr3A9GADkrE6kXqeY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=M5YoHGDbiaLkAJ74VFN0R9sHf93lfvplhMXIFWDBKmeG4ANM1iWsqdJKApnX8M926PsE2KIS7FN20BVbxvr+2ZAZz2SEoUprsW6Bqzdttk96Ww29/YCq1fpwwIu6AJfMyRzkJa468JVf3CQbq1umiGsDAJ03WeBOtg7Fni+zgAg= 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=TXSNgoOf; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=CZfkj+KN; arc=none smtp.client-ip=202.12.124.157 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="TXSNgoOf"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="CZfkj+KN" Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfhigh.stl.internal (Postfix) with ESMTP id D7F557A0150; Thu, 11 Jun 2026 15:30:39 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-04.internal (MEProxy); Thu, 11 Jun 2026 15:30:40 -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=fm1; t=1781206239; x= 1781292639; bh=dUIErbGsP3wv8Ie67b7ytj+lAe1TXPPhIZejfGlUUTc=; b=T XSNgoOff/WUtxYUTVu4DIxIEGlROyZ+c7iYfyxcHgCGew4C1kytfvg55gFXZlVuZ 0JYICALHP2qT03uelxlizyeiV2fn/XaJegmO90/Nhg70epAt4pdTwVmOqcUBmcVl xM9i/nWolHoFEIOBtxanBuanJ/5gCuCA0JW9hWuPVWmiddT9knEUadgrq4g47XyA tLEyeTYKpPcG+z9qim9uU4SnF16xqsX6E+Q84y5RPo4SS8jRkvkqA2lyNM6gUgYr aisqRPHCmo2iT8KhdP0SgxXyyjKuqsqdNHQn2LCV/fIotP0QbxasTiKhVVBG3yWE pN/oOkZJXnzYF12DYXW0A== 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=fm1; t=1781206239; x=1781292639; bh=d UIErbGsP3wv8Ie67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Fk8nJcg5oQ X-ME-Proxy: Feedback-ID: i559e4809:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 11 Jun 2026 15:30:38 -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 v7 04/11] net: Enable BIG TCP with partial GSO Date: Thu, 11 Jun 2026 21:29:48 +0200 Message-ID: <20260611192955.604661-5-alice.kernel@fastmail.im> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260611192955.604661-1-alice.kernel@fastmail.im> References: <20260611192955.604661-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 --- drivers/net/netdevsim/psp.c | 2 +- net/core/skbuff.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/net/netdevsim/psp.c b/drivers/net/netdevsim/psp.c index d3e36c74be62..6b3532b5e360 100644 --- a/drivers/net/netdevsim/psp.c +++ b/drivers/net/netdevsim/psp.c @@ -92,7 +92,7 @@ nsim_do_psp(struct sk_buff *skb, struct netdevsim *ns, * provide a valid checksum here, so the skb isn't dropped. */ uh = udp_hdr(skb); - udplen = ntohs(uh->len) ?: skb->len - skb_transport_offset(skb); + udplen = udp_get_len(skb, uh, skb_transport_offset(skb)); csum = skb_checksum(skb, skb_transport_offset(skb), udplen, 0); diff --git a/net/core/skbuff.c b/net/core/skbuff.c index c64693fcb2d1..5dcee79df8cf 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -4773,6 +4773,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); @@ -4788,7 +4789,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) { @@ -4816,7 +4817,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; @@ -4850,9 +4851,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 @@ -4876,7 +4876,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