🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #22233

Re: [PATCH net] ice: do not report CHECKSUM_COMPLETE when an XDP program is attached

#22233
From: netdev-bot+sashiko
Date: Wed, 25 Nov 2026 01:38
126 lines
13269 bytes
Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.

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

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] On E830 with an XDP program attached, ice_rx_csum()
  (drivers/net/ethernet/intel/ice/ice_txrx_lib.c) now skips ice_rx_gcs()…
- [Low] ice_rx_csum() decides whether to use GCS/CHECKSUM_COMPLETE by
  reading ring->xdp_prog again with `!READ_ONCE(ring->xdp_prog)`…

--

ice: do not report CHECKSUM_COMPLETE when an XDP program is attached

This patch stops ice_rx_csum() from using the E830 generic checksum (GCS)
to report CHECKSUM_COMPLETE when the rx ring has an XDP program attached,
because an XDP_PASS program may have modified the frame. Such packets now
take the L3L4P/XSUM_* descriptor status path, as on E810.

Link: https://lore.kernel.org/all/20260715-bpf-xdp-meta-rxcksum-v5-0-623d5c0d0ab7@kernel.org/ [1]
Link: https://lore.kernel.org/all/cover.1794281983.git.tianyi@cloudflare.com/ [2]

> diff --git a/drivers/net/ethernet/intel/ice/ice_txrx_lib.c b/drivers/net/ethernet/intel/ice/ice_txrx_lib.c
> index e695a664e53d1..ad22d855436eb 100644
> --- a/drivers/net/ethernet/intel/ice/ice_txrx_lib.c
> +++ b/drivers/net/ethernet/intel/ice/ice_txrx_lib.c
> @@ -123,6 +123,7 @@ ice_rx_csum(struct ice_rx_ring *ring, struct sk_buff *skb,
>  	rx_status1 = le16_to_cpu(rx_desc->wb.status_error1);
>  
>  	if ((ring->flags & ICE_RX_FLAGS_RING_GCS) &&
> +	    !READ_ONCE(ring->xdp_prog) &&

[Severity: Medium]
With an XDP program attached, E830 packets now go to the L3L4P/XSUM_*
status path further down in ice_rx_csum(). Can that path mark a modified
packet CHECKSUM_UNNECESSARY based on how the hardware parsed the original
frame?

ice_rx_csum() runs after XDP has already run:

ice_clean_rx_irq()
    ice_run_xdp()             /* returns XDP_PASS */
    ice_process_skb_fields()
        ice_rx_csum()

The same thing happens in ice_clean_rx_irq_zc() via ice_run_xdp_zc().

Take the load balancer case from the commit message. The program strips
a UDP encapsulation with bpf_xdp_adjust_head() and returns XDP_PASS.

If the outer UDP port is not a configured VXLAN/GENEVE port, the parser
does not treat the frame as a tunnel. The L4 status bits then describe
only the outer UDP checksum. A zero outer UDP checksum over IPv4 ends up
here:

	if (decoded.tunnel_type >= LIBETH_RX_PT_TUNNEL_IP_GRENAT)
		skb->csum_level = 1;

	skb->ip_summed = CHECKSUM_UNNECESSARY;

After decapsulation, the outermost L4 header is the inner TCP/UDP header.
The stack skips that checksum, and nothing has verified it. If the parser
did recognise the tunnel, csum_level = 1 is applied to a packet that is
no longer tunnelled.

Before this patch, the stale CHECKSUM_COMPLETE value made the stack
recompute the checksum in software. Good packets passed with a
netdev_rx_csum_fault() warning, and corrupted ones were dropped.

The commit message says:

    E830 also sets the L3L4P and checksum error bits, so the packet gets
    CHECKSUM_UNNECESSARY or CHECKSUM_NONE, as on E810.

E810 already behaves this way, and so does mlx5, where
MLX5E_RQ_STATE_NO_CSUM_COMPLETE leads to csum_unnecessary. On E830,
though, corrupted packets on these rings used to be caught in software.

Would CHECKSUM_NONE be a safer fallback here until the pending XDP
checksum hint series land? If not, could the commit message describe
this trade-off?

[Severity: Low]
Should this use the per-poll snapshot instead of reading ring->xdp_prog
a second time? The program that actually ran comes from:

ice_clean_rx_irq():
	xdp_prog = READ_ONCE(rx_ring->xdp_prog);
	...
	xdp_verdict = ice_run_xdp(rx_ring, xdp, xdp_prog, xdp_ring, rx_desc);

ice_clean_rx_irq_zc() takes the same kind of snapshot for
ice_run_xdp_zc(). Neither function passes the snapshot to
ice_process_skb_fields().

The commit message already mentions the window this opens.
ice_prepare_for_reset() sets ICE_VSI_REBUILD_PENDING before calling
ice_pf_dis_all_vsi(). ice_dis_vsi() then has to take rtnl_lock before
ice_vsi_close() can stop NAPI. An XDP detach that holds rtnl during that
window gets here:

ice_xdp_setup_prog():
	if (ice_is_xdp_ena_vsi(vsi) == !!prog ||
	    test_bit(ICE_VSI_REBUILD_PENDING, vsi->state)) {
		ice_vsi_assign_bpf_prog(vsi, prog);
		return 0;
	}

ice_vsi_assign_bpf_prog() writes NULL to rx_ring->xdp_prog while NAPI
is still running. Suppose a poll runs the old program on a packet and
gets XDP_PASS. ice_rx_csum() then reads NULL here and reports the stale
GCS value as CHECKSUM_COMPLETE.

Both callers of ice_process_skb_fields() already know whether a program
ran. Would passing that down close this window and also save a
per-packet load?

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261121012402.84848-1-tianyi%40cloudflare.com
Technical Details
Message-ID: <179557068810.3135.17964087549504688357@kernel.org>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-370955-linux-kernel-netdev=dewy.ru
References: <20261121012402.84848-1-tianyi@cloudflare.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-370955-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net] ice: do not report CHECKSUM_COMPLETE when an XDP
 program is attached
Date: Wed, 25 Nov 2026 01:38:08 +0000
Organization: Usenet Network
Message-ID: <179557068810.3135.17964087549504688357@kernel.org>
References: <20261121012402.84848-1-tianyi@cloudflare.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="83302"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:+JriLBsp1lWzCX0HkFHFO8IaeXY= sha256:IWQfTn8m4ReqZ2qBuzZVDTXcSxH7L64a4K2313iBROM=
	sha1:ePy7aIatxNH2/MDV+7KscnBNVEo= sha256:KdaezSkgGp142+pw1ddGWJoDOpxAJBM9eZMt3tYuH8s=
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 2D84E125E2F; Wed, 25 Nov 2026 04:38:41 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.4
X-Spam-Status: No, score=-3.4 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, URIBL_BLOCKED=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 Z_LpJCmK0eMf;
	Wed, 25 Nov 2026 04:38:33 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-370955-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 E213B125E38; Wed, 25 Nov 2026 04:38:24 +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 2B48136AF6; Wed, 25 Nov 2026 01:38:21 +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=1795570701;
	b=2w/KeLVDdgRLUmFjOGXemplJxCxdG3/wDe0RsfjwKFKwUbRHPw58lLqoyHdotnpWsYOh
	 bxsjcuXBnfdEpvaNzeEQxXq0P6T5hMRNkwigA9L7dRCX641QUaXeB+PGZUdQrPocq9zHd
	 vOo7eMc/lKYHyX5s7kdaxanBgC0WEBa7SXrxJceEyyZwGUGyfZRSnxXp6YiwHLRk4Vc3j
	 zJ9UkYXu/MSpL3H+RPHW35d1fdOeBcLB/9O82SPaaX0VgUKZllDGT1FNl7uj/iXDX6teE
	 qW400/CP0XVfC0ZFtUIMRnPG/K1HiQzWGCN7gGY+rrRDTy9n/PBtexS38Mkbkzphd2g==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795570701;
	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=/i4jNdS1y5p3R3vSDLsBxb1ySs5NP+dCuDhMtJTNlqs=;
	b=WYOSuZA4CT9WgWogZhqJR4Wxfs06pYJ5v4LJxZD/v79Ts5sPTpA3Yq+8BSW7Fh2AAPnU
	 xgefwMiIYmudOwza1O0aNsrCcNLPQbNXL1SFOOZ2Mh0EZOtQ14GzEj3PD2oCcpTORBWVG
	 Pb+7QVMGZ/UQuBboFQ03hI6PTNJIoak7Ql2J8cIOt1d6xm5zCrA/KYwWOlQAfnfGdmKUb
	 FlTZlo9EItQv91FasuPmh+iE+tq3Eq6tSU3wHvyetpfwkKjaDuN+/MmjsBBjNH8m26uOX
	 IMgRGhP/sNFJASFeG+dUaLSnXMVb/zlYxg30w34LfewbRPThy+FNzDYWBu36BDDlpww==
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=kUOKGAh8;
	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 03973606A329;
	Wed, 25 Nov 2026 01:38:21 +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=kUOKGAh8
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=1795570690;
	b=zayn+QhZBMBGxVqIrfmYRTwgyzI9qYfyCiWe6KwbLWKMqxYwZsqUHw05S9zHd//CPlq7
	 m52Cfi6QnVCluu+oUqQI58x0SvEmplnU1b23vTrMmXLnXZTJYSVDHMvRIiz4LZTtwKu1S
	 XTp0mPjRxjuLIHh+PHbU/4GIOUsVdrit4vPf0tPSerfX79Y0nRiHXa3YvdsJ0FyaEKAcj
	 X0nQuq3TL+VouPKTlb3JfgA9n5iePF7m65N7zqNiMFcLuVqe+wdKQkm1SlT96cbo2WJ7L
	 PXiCBxVeGYkAyvxCviqDexYr9375HbmS1zS8uTpwcMpn9EIFpfKHSS3ZjgO0WFtNhHA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795570690;
	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=/i4jNdS1y5p3R3vSDLsBxb1ySs5NP+dCuDhMtJTNlqs=;
	b=SgWR+gYtFRFuuxQj7RSryhRsNYOYrFM0bmpbX2msRqPQIqMxp6rekRK+COV16nrAcp+b
	 eLyvrg/OqzwAeigij3w2wL+H9sTUZluFOOa26SdbfFlX8xOp5RdYUewgsoGCupBMzRT48
	 kPGdCrdRQTtOmRtqqwxK+WJ/NfRr5sbgOMJ0xWZWPK4xJ8talbiTtcILeyisMxHiP4det
	 jPUmw4E0dFHpsgJw4gtkrAJo8/gdnPk/vC2TkSWGEzorkpbQ/7GHQBnYyc4Cpaz/IIAae
	 on3z3WNRCkxPNEqVKvn97wiwJjD+CPOofMLJ+SdemuRUXSI69IkQxOYImaXCT95rNig==
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=kUOKGAh8;
	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 1F025606A31E;
	Wed, 25 Nov 2026 01:38:09 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 88C621F000C6;
	Wed, 25 Nov 2026 01:38:08 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1795570689;
	bh=/i4jNdS1y5p3R3vSDLsBxb1ySs5NP+dCuDhMtJTNlqs=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=kUOKGAh8l/KAFUNWyQrKSsmQsU5/wiBnVMWq7tCCQrQ1RNWNl3dsHK4WquJ/Rzg78
	 iahk5s+iSvj1Q00iJtc9XsjwSv3gCyL0KR+70Dg7RrVuch4PiPR1mtIF1wdFhy8oy6
	 8DzeiJXdQ8rJQRPnDb+VZla9K5yrA01RtP3o7ps1lIQUN1k1miZaw7khbV5eL06yHY
	 sTeGkj7r2grUauDXeHHv3b+iQaGv9O6vSwZeAbK55pHIEtbNplousCGwVuBoQPnE21
	 qEHVOQt33tc/2FzgOpYMMAucQ5YlINnfzvEy41YpXN3SjwmxlHzmqLK2gcvHzdop/4
	 bAdX4j5k9jwlg==
X-Cc: netdev@vger.kernel.org, intel-wired-lan@lists.osuosl.org,
 anthony.l.nguyen@intel.com, przemyslaw.kitszel@intel.com,
 andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org,
 kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, ast@kernel.org,
 daniel@iogearbox.net, hawk@kernel.org, john.fastabend@gmail.com,
 sdf@fomichev.me, paul.greenwalt@intel.com, alice.michael@intel.com,
 eric.joyner@intel.com, jbrandeb@kernel.org, lorenzo@kernel.org,
 bpf@vger.kernel.org, kernel-team@cloudflare.com, tianyi.gao@linux.dev
X-In-Reply-To: <20261121012402.84848-1-tianyi@cloudflare.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