🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #15032

Re: [PATCH net-next v2 4/6] eth: mpnic: UDP segmentation offload

#15032
From: netdev-bot+sashiko
Date: Thu, 12 Nov 2026 10:08
88 lines
11246 bytes
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.

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

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] This patch adds `skb->len < MPNIC_MIN_FRAME_LEN ||` to the
  generic `skb_is_gso(skb)` branch of mpnic_features_check()…

--

eth: mpnic: UDP segmentation offload

This commit adds NETIF_F_GSO_UDP_L4 support for non-encapsulated udp4
and udp6 packets. As for TCP, the UDP checksum is seeded with a zero
length. It also makes mpnic_features_check() fall back to software GSO
for skbs shorter than MPNIC_MIN_FRAME_LEN.

> diff --git a/drivers/net/ethernet/meta/mpnic/mpnic_txrx.c b/drivers/net/ethernet/meta/mpnic/mpnic_txrx.c
> index b78f8599bbe8f..2a0560b7dd19e 100644
> --- a/drivers/net/ethernet/meta/mpnic/mpnic_txrx.c
> +++ b/drivers/net/ethernet/meta/mpnic/mpnic_txrx.c

[ ... ]

> @@ -369,7 +384,8 @@ netdev_features_t mpnic_features_check(struct sk_buff *skb,
>  		return features & ~(NETIF_F_CSUM_MASK | NETIF_F_GSO_MASK);
>  
>  	if (skb_is_gso(skb) &&
> -	    !FIELD_FIT(MPNIC_TWD_MSS, skb_shinfo(skb)->gso_size))
> +	    (skb->len < MPNIC_MIN_FRAME_LEN ||
> +	     !FIELD_FIT(MPNIC_TWD_MSS, skb_shinfo(skb)->gso_size)))
>  		return features & ~NETIF_F_GSO_MASK;

[Severity: Medium]
This check applies to every GSO type. That means TCP GSO skbs shorter
than 60 bytes now fall back to software GSO too, not just UDP ones.

The commit message body only talks about UDP. The only mention of this
check is the v2 changelog below the "---", and that text is dropped when
the patch is applied:

  v2:
  - fall back to SW GSO for skbs shorter than MPNIC_MIN_FRAME_LEN, since
    HW LSO would segment the zero padding as payload

Should the commit message describe the effect on TCP? Or should the
check move into the earlier "eth: mpnic: TCP segmentation offload"
patch?

With only the TSO patch applied, TCP seems to have the same problem. In
that version, mpnic_features_check() rejected GSO only when gso_size
didn't fit MPNIC_TWD_MSS. So a short TCP GSO skb reaches
mpnic_xmit_frame_ring() with HW TSO enabled, and gets padded first:

drivers/net/ethernet/meta/mpnic/mpnic_txrx.c:mpnic_xmit_frame_ring() {
    ...
	if (skb_put_padto(skb, MPNIC_MIN_FRAME_LEN))
		goto err_drop;
    ...
}

Then mpnic_tx_lso() seeds the TCP pseudo-checksum from the padded
length:

	payload_len = cpu_to_be16(skb->len - skb_checksum_start_offset(skb));
	csum_replace_by_diff(&tcph->check, (__force __wsum)payload_len);

Locally generated TCP GSO skbs are always longer than 60 bytes. A GSO
skb built from a virtio_net_hdr can be shorter, though. Sources include
tun/vhost and packet sockets with a vnet header. Such an skb can carry
a tiny gso_size and only a few bytes of payload.

In that case, wouldn't the receiver get the zero padding as TCP stream
data, with a valid checksum?

The check is still present at the end of the series, so the final tree
is fine. The TSO commit on its own would still corrupt data if someone
bisects to it or backports it alone.

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261110-mpnic-lso-v2-0-ccd37b051d08%40gmail.com
Technical Details
Message-ID: <179447813712.2199510.12165491734923049464@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!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-361696-linux-kernel-netdev=dewy.ru
References: <20261110-mpnic-lso-v2-4-ccd37b051d08@gmail.com>

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!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-361696-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v2 4/6] eth: mpnic: UDP segmentation offload
Date: Thu, 12 Nov 2026 10:08:57 +0000
Organization: Usenet Network
Message-ID: <179447813712.2199510.12165491734923049464@kernel.org>
References: <20261110-mpnic-lso-v2-4-ccd37b051d08@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network; logging-data="1058639"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:Pz5qayIyZq8jXCcuPsz3c20xPnY= sha256:NTi/ytlX4abPxAWTVVi0OcZ0YbT4o+95K0cInFECYQ0= sha1:BiKbD8fc2ipn9hVx/WO3oCS24/g= sha256:rxvVMllLwIC1rlHaFYCITaPVvCsa8JUWvSAI7WCE8eU=
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 ED2991141AB; Thu, 12 Nov 2026 13:16:05 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.401
X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, 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 sunc0Jt_o-B1; Thu, 12 Nov 2026 13:16:02 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-361696-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id DAAD011415F; Thu, 12 Nov 2026 13:15:53 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 6AA52168E80; Thu, 12 Nov 2026 10:09:43 +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=1794478144; b=ZbcRi4j/fo8cijhvIjuXebaMo6hlWm5rmokGDm5z1ojQCQaV5wNu7cxi+fAuKFne9txE XMRjCKnH24WvmOVHvudkcOsWiu0oBgjSFJOPrAX0NmmNPtWHonWOC6WatfmxiLTawne2U AdNK+aX0zb2g+655+2j1MhuRZP12Ywvt+BzRmYO9qXIbpSoTcqG2G3dWakTj0q2Ts8DpE kk6Ad1loPr47jIu2rGD97sbKn7xRDH8LJTrWgFwBqOROMoh3mVVI/u7ZMcm61+VzWxknD 3aUyDH9Xc+grR0VXcHpakssQqr7nDZsAtIqDUfdEKiM3X72LuM2i2Ch5Uw+n8/d58Vg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794478144; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=c3Uerz6NVXCytr6ykqOceV0YspUsXoDMSUv7FULrkyw=; b=Cy8ovWem6dkIM1K+1uktKjc8n2yuZm1UUqwX9jkyD/pBGmci74w5i1RegdJNj8bzp8ts O1yLZAaUoSN0/h+zN85XSHUVBvcT5GgS4/bWd4uODICr8HJ5Mg+H4FWfLMLeOY/jqD1sa BE3j6L4I2t0y6uofhL3/4+tXxqJyZttX2tGbgfalz/sFUlLhq3xABq+7d3oMzPEegXU6M mmjrHt6NEJqbt28tYojGf4hPn6PTrrKsmGhVjngK60IcQOUIOXy6kQv/aCvxBfMQDqzq3 7DkEW6FcXsdt5m6qKqwobuBeBm1NNhusEZbNcbyjuInbMUNGdZRqwKyNCsv/oV8xs9A==
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=GypQxgVu; 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 519D360A261C; Thu, 12 Nov 2026 10:09:04 +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=GypQxgVu
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=1794478138; b=lYEpKHgNAfcEdZeVyywcpwHT1YFSaXqX5p0VLOw0045BkfYUiH+0laNF3YglQv2zY7ei /czVF3mPFm/sqWqtg5N1RC5J3GHTxGVh7B+wMkWUWQK4HV3o8FxrVtR4kw+TQSXIAr5jZ V6VVy/e7cOjZ6aDng8DQBQiWoMJ/PQbgHJwx+HBZ8lt3Erw0qqEa7AOyECii9vzTIxH5F bAdMilqSPZydf6tbu71bJiEdZnTCAIcjMZrL7VLh/yGIiyymNIw44n+iBWn1Hxk9hZAm+ 7Wmk+TM8/6X9IRtlC0Gc8qQvNOsX3oWZ/mtUxiS1nMxIZhFuINVVzOeARDa74swxO8g==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794478138; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=c3Uerz6NVXCytr6ykqOceV0YspUsXoDMSUv7FULrkyw=; b=w3ph0eKShvgJWfReOpIUMoWNfQRHyXk3tfu0x1DSgIrKxHwwW7B/f/iuzomPG6jwNws7 TjUWfz9ehwcbEnZ1dneFsYb1rkVNdMDTOGiVjRrHPCM4AsYW+WcOTCineN8QRzhZs6sdg jT7uJ2whRCize0pTGatupsI8Cn4yf4uiCLreX0ZB9CVQ9IiZDag1lwxpytdvtgWk5WTl4 fkohm6gftEwNihZqgxu+WLNWXj+aakP6ZAIEFwqbhiLjB7PXwyk4y2xhWQ4B/RrPMnJFf sOMZedRamPM+X98H2FynuGEC8vdI/4hVD4ypiJY/UAW9Mu0c4AHsd3N8bhBMjlSe+1Q==
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=GypQxgVu; 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 6DA12606A895; Thu, 12 Nov 2026 10:08:58 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 94C951F00A07; Thu, 12 Nov 2026 10:08:57 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794478138; bh=c3Uerz6NVXCytr6ykqOceV0YspUsXoDMSUv7FULrkyw=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=GypQxgVuK7RYKnec/3ahLhDPgn7nqYKDh0Kg3WWvfwCVdQUGd3h3voj2frxlM+6Qi z3NI/dAQWtQJ8mKUNDVKBmYVvmGaRYeybH362jCeh6CuxooymGb2iEo/Zd69cf87Fh hxnJ/BRIlV7HkIFy2VuGprKduVtpzo5bP7tNaY3yrTvqh7zUfaRNBiy40ykDX/spfs mIuK6EH1gEzTZYxnUwvFyqqDEfV2fLut+4IqbbqkkCm9wnRNEPCastwFaVqmxtSVWc biYCEr4Ta9+RTto73oyIKxtZ/JtpVs1jA20u3nnwn9VNQjzvIz2HV7GP+fePxQR5Fg RiA6AUIfPOpgA==
X-Cc: alexanderduyck@fb.com, kuba@kernel.org, kernel-team@meta.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org, pabeni@redhat.com, dimitri.daskalakis1@gmail.com, mohsin.bashr@gmail.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org
X-In-Reply-To: <20261110-mpnic-lso-v2-4-ccd37b051d08@gmail.com>
X-sashiko-severity: Medium
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