🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #8650

Re: [PATCH iwl-net v2] e1000e: fix Tx descriptor field wrapping

#8650
From: Alexander H Duyck
Date: Thu, 29 Oct 2026 16:47
112 lines
15414 bytes
On Wed, 2026-10-28 at 13:02 -0400, Matt Vollrath wrote:
> When an skb arrives at the driver and the header length exceeds the u8
> hdr_len, tucss and tucso fields in e1000_context_desc, wrapped values
> are sent to the card. If TSO is enabled, some header lengths will cause
> the card to hang.
> 
> This was reproduced on an I218-V with an unprivileged Python script.

Can you elaborate on what the script did to trigger this? I am
wondering if it can even get there with a valid frame supported by the
interface since most of these e1000e parts don't support tunnels and
such.

Also did it have separate cases for the CSUM vs the GSO? I would
suspect this is more a CSUM issue than a GSO issue.

> Fix it by disabling GSO and checksum offload when the header length (and
> checksum offset) would exceed the field widths. Compensate for a
> software-inserted VLAN tag.
> 
> Because of a quirk in the ordering of ndo_features_check, the skb's
> transport_header field may be stale. If the skb carries
> CHECKSUM_PARTIAL, use csum_start to find the header. Otherwise, there's
> no reliable interface, so don't offload it.
> 
> Fixes: bc7f75fa9788 ("[E1000E]: New pci-express e1000 driver (currently for ICH9 devices only)")

I am pretty sure this Fixes tag is bogus. This is the introduction of
the e1000e driver which was in 2007. The ndo_features_check didn't
exist until 2014 sometime after that if I am not mistaken.

Much of the complexity that enabled frames to build up massive headers
wasn't until much later when the network tunnels and OVS started being
added.

> Cc: stable@vger.kernel.org
> Assisted-by: LLM
> Signed-off-by: Matt Vollrath <tactii@gmail.com>
> ---
>  drivers/net/ethernet/intel/e1000e/netdev.c | 34 +++++++++++++++++++++-
>  1 file changed, 33 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
> index 6f85dab5c55c5..370776657d100 100644
> --- a/drivers/net/ethernet/intel/e1000e/netdev.c
> +++ b/drivers/net/ethernet/intel/e1000e/netdev.c
> @@ -7355,6 +7355,38 @@ static int e1000_set_features(struct net_device *netdev,
>  	return 1;
>  }
>  
> +static netdev_features_t e1000_features_check(struct sk_buff *skb,
> +					      struct net_device *netdev,
> +					      netdev_features_t features)
> +{
> +	/* Do not offload packets whose header lengths exceed the u8 fields
> +	 * in the descriptor.
> +	 */
> +	unsigned int hdr_len = 0;
> +
> +	if (skb->ip_summed == CHECKSUM_PARTIAL) {
> +		const struct tcphdr *th = (const void *)skb_checksum_start(skb);
> +
> +		hdr_len = skb_checksum_start_offset(skb);
> +		if (skb_is_gso(skb) && skb_is_gso_tcp(skb))
> +			hdr_len += __tcp_hdrlen(th);
> +		else
> +			hdr_len += skb->csum_offset;
> +	} else if (skb_is_gso(skb)) {
> +		/* Work around untrustworthy header offsets in this case. */
> +		return features & ~(NETIF_F_CSUM_MASK | NETIF_F_GSO_MASK);
> +	}

Most drivers currently assume if the CHECKSUM_PARTIAL isn't set then
the frame must not be TCP/UDP GSO since for those normally the checksum
and offsets should be populated. Have you identified cases where we are
seeing TCP/UDP GSO w/o the checksum being set up?

From what I can tell it looks like the only valid cases for it not to
be set and instead it is set to CHECKSUM_UNNECESSARY on a GSO frame are
FCoE and SCTP (GSO_FRAGS) which are both non-TCP/UDP specialty cases
anyway.

> +
> +	if (skb_vlan_tag_present(skb) &&
> +	    !vlan_hw_offload_capable(features, skb->vlan_proto))
> +		hdr_len += VLAN_HLEN;
> +
> +	if (hdr_len > U8_MAX)
> +		features &= ~(NETIF_F_CSUM_MASK | NETIF_F_GSO_MASK);
> +
> +	return features;
> +}
> +
>  static const struct net_device_ops e1000e_netdev_ops = {
>  	.ndo_open		= e1000e_open,
>  	.ndo_stop		= e1000e_close,
> @@ -7374,7 +7406,7 @@ static const struct net_device_ops e1000e_netdev_ops = {
>  #endif
>  	.ndo_set_features	= e1000_set_features,
>  	.ndo_fix_features	= e1000_fix_features,
> -	.ndo_features_check	= passthru_features_check,
> +	.ndo_features_check	= e1000_features_check,
>  	.ndo_hwtstamp_get	= e1000e_hwtstamp_get,
>  	.ndo_hwtstamp_set	= e1000e_hwtstamp_set,
>  };
> 
> base-commit: 7076f684d5132e6a6145e1da2fa74771ecd052e5
Technical Details
Message-ID: <31444b89635e8520c262ae915235991c3c075a0a.camel@gmail.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-353397-linux-kernel-netdev=dewy.ru
References: <20261028170239.28606-1-tactii@gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-353397-linux-kernel-netdev=dewy.ru
From: alexander.duyck@gmail.com (Alexander H Duyck)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH iwl-net v2] e1000e: fix Tx descriptor field wrapping
Date: Thu, 29 Oct 2026 09:47:34 -0700
Organization: Usenet Network
Message-ID: <31444b89635e8520c262ae915235991c3c075a0a.camel@gmail.com>
References: <20261028170239.28606-1-tactii@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Injection-Info: usenet.network;
	logging-data="2052768"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:0e0PKzMmnSAThXWs+E2yJT/xjvg= sha256:HqBmlyhRFooEywmhbJ7n3ct/GzcXwAsm9CRKbrEhzbg=
	sha1:jY5ow8/6eL77V0CIo9eKoL9WHoQ= sha256:XTw1IzFhl2+Jn6+C6LuqIC/Lh3N4sPvQYK9XL/NQaz4=
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 7F1F3125C6B; Thu, 29 Oct 2026 19:53:05 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.048
X-Spam-Status: No, score=-3.048 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
	FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25,
	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=gmail.com
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 fkwf_Dnzw7pI;
	Thu, 29 Oct 2026 19:53: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-353397-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 6CF40125C65; Thu, 29 Oct 2026 19:52: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 B65C026DD7; Thu, 29 Oct 2026 16:47:38 +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=1793292458;
	b=CSdhM0ESp48uqYRp5PssjT68/eEo02hupSLImEc34y7sxdfEm6tm6lZNGArgugRHEmQF
	 lAcdgErhoL+lxMBBhlzMWxF6rZOyPNNdQbZjFOxCXwl9CUpbidTAZyxEhgzgebTvApcvJ
	 VPiDunGblrlYyHDAlnSckC4pEkKLPpmltniCsJYY0us6qV7AdeE1QLH10xgxhsRT/kcpv
	 nNTVGRiDN06G2WrvRHe2aEDb/fFfeezXEjl626JEpxsFKi/ZG1x2atT8f2Ajxr/+pqfxT
	 NtmMrqfAxeDohdkri4BJ/LdSDg13sq+WpU3gZVdHoJoM+Q7A8IqeZ5fLntH3NqGfewA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793292458;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
	 X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received:
	 Received:Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References:
	 Content-Type:Content-Transfer-Encoding:User-Agent:X-Mailing-List:
	 List-Id:List-Post:List-Help:List-Subscribe:List-Unsubscribe:
	 List-Owner:Precedence:MIME-Version;
	bh=79DDn4vmcOC3ldaXqJtmkrA2/5RtNDXGpNRnaOFomtw=;
	b=G+O5kXaoWUG2jt2oDDel1vlp4f2/Sb9k8RuWSEGIv3u7HY+j8zRN44mVL8V/y3jsRP8p
	 tkc6qN4/VGud/HB/bGbETSm5/1wPCFLIyw7MsoUxyW406F//9VJ692sJ2desv1GmjgPrr
	 kszrwdG5dHg4JmImpvtPieB0aoGepbwmtG4D/EvASFiESjUPVGBYF2M2iaDOhWIc4xNFd
	 9/gXimjezgCUTsyu2i4n1DWvHyy/0LnRKSlXo/57A7XuQy0341/IZfQ9N9digKMJZW7Ph
	 069s90gU1J2mk43Zcuxuga3QKmAcfINesLGC4lJ4pzqOHJ8fCrVxiyP6W07a7Ongyvg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b="bc3UWHS/";
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	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 4B2BB606A31D;
	Thu, 29 Oct 2026 16:47:38 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=bc3UWHS/
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.216.53
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1793292457;
	b=ohkAqwKf2xWos6ofNvI11dlhkbzSqJIPGto/gd9x7d4Hir7ErPXl8XpIFocCKcBCcK11
	 9T7jQHSs/F0MiJIWTVnuDwFYQae7WRLDEcWMdDm8Y7WHjni+7N+Py19JrmOOc2D2VNVRL
	 lVzwYnCxIPdvRFawLyJTfybSVFNAZwLSmjEqw6B6xRjHY1uJWoktpzaIMzlqT2qpnSPoU
	 koX6HaaV5/NMOxm2ua5eEYuidmJRqmUuxk69Ey9swS+O1nkjkFfCtZCDjWW/wRUwc8OzJ
	 ZJtJxfzIpGRfAGzarRT3JYoVQ4aiXx/DGc7iTDPqeDd8OSCOhDJ8vbgP1FOa2pDJ87g==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793292457;
	h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
	 X-Gm-Message-State:X-Gm-Gg:X-Received:Received:Message-ID:Subject:
	 From:To:Cc:Date:In-Reply-To:References:Content-Type:
	 Content-Transfer-Encoding:User-Agent:MIME-Version;
	bh=79DDn4vmcOC3ldaXqJtmkrA2/5RtNDXGpNRnaOFomtw=;
	b=uGZPxH7yOGS+JU2DR9hurZpZRUt1Xag7HTr3c1iPgNjUbotSSs/O3vhv0BqINuY7qqxX
	 2BXJoUCPg3TIp6IAXXLol/u6a67EFPVYr5Hgq0Vz7y2OHGJIAboeSj8F6Omx8LUfUVSsr
	 0KRCyYymdBVLbnVooShEASrEpNmIubJIR1/x9vTN6v6UxpaDokmvUflLFppHGugUacbcH
	 JJyfEdmnVutOyoJjwRbWndrrbA9sSqpHPKTcV47XwSFsdKfhDFutIRGGrYtD2jyoiZTlw
	 uzWdDpyxDRO4uEO5vVXsZGn2gWYYe44Y7FqXQaQZRIekuxVIHmSm4eq9PRpQlr0vxKw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b="bc3UWHS/";
	arc=none smtp.remote-ip=209.85.216.53
X-Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id A6A34606A31A
	for <netdev@vger.kernel.org>; Thu, 29 Oct 2026 16:47:36 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org A6A34606A31A
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-pj1-f53.google.com with SMTP id 98e67ed59e1d1-3ac78f4c10bso1214998a91.1
        for <netdev@vger.kernel.org>; Thu, 29 Oct 2026 09:47:36 -0700 (PDT)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20260707; t=1793292456; x=1793897256; darn=vger.kernel.org;
        h=mime-version:user-agent:content-transfer-encoding:content-type
         :references:in-reply-to:date:cc:to:from:subject:message-id:from:to
         :cc:subject:date:message-id:reply-to:content-type;
        bh=79DDn4vmcOC3ldaXqJtmkrA2/5RtNDXGpNRnaOFomtw=;
        b=bc3UWHS/ITwD0lzOlY9HZfRl+H+UlpoFOjSpInaHqsAGuPpJWyh/FXc6a2K2pSXk8w
         iTkYvSbr/AjS/E3BcXEgQzgON7gmFsF3M/7fJ5AxagKMx184QFcpqSt1l5rJFLI5bDVa
         nHyINJKhvRk+27BZYbVV1Rg05Mo3v4/3Y1XKToRKQPk0nni5CUyd7mn17xcCeW+VdeQE
         hwkgFvVf2k/csc87MnoCKBvEqeDnuXyIJNiPcItywFhxtVKgEgOmuQ5cdtqYVIdrZfbq
         cSZJlAoEu4KsgNSOugcHmITimtX+YJAe1RQqYic4vi3h3gFW/mRHyzkMVSJkS5fgDAA9
         yN9g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1793292456; x=1793897256;
        h=mime-version:user-agent:content-transfer-encoding:content-type
         :references:in-reply-to:date:cc:to:from:subject:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=79DDn4vmcOC3ldaXqJtmkrA2/5RtNDXGpNRnaOFomtw=;
        b=ggN/HCCRG6LYNG5bi9QhFYdRUHHPSKjtghJ+kU+1Hc+CXwMjpzmIhUJ9rDKkp8Jgv2
         fxy+hHjmPnqhelxGmz1n/vrOjmu9fa2gOFa/FSZQwbUaSu2t8Y8SNyW+6IJ3d1mDlzUP
         iYWdtcYKNWznIUmawi9zUNdH9dQSMJ9v3cF2guKyrZkeqQfai3oFH3tAqSr/JpmsfaQc
         j+t2t2ade8oiHPC/CDnDr4c21KCWTeIdbl1zc0S58vTYAaWo0E94p4Lycm3Qp9FcdkbB
         jPa41P5Q4Lt/jFc4EEWYMT+IRlTNGuMV/JwTcsDlVLBDqd7rB+JqBRsiwPGA7J0Gc4nA
         eO0g==
X-Gm-Message-State: AFq9FYJX1vLhEBz8A4bCyOTBL0ESePlzQHpjZXB1Y5NKpGj9RAcT29oc
	CHwEsD5p4AI8wJqtC1Bd15ST5dbQ8r37W9fuuhVGnLLV8Eogoll7ROIq
X-Gm-Gg: AYBFou2ospVgAKb4hQ6f0pF6f9lnd/j2ADzjQjBnlH5wpyBB2AEgKOPZx+mXD3cxayY
	a72cAoPhxMGVxHXMKos76zR4T4wMpVfQ1iOFwjznrZCpqYC6hMhFcDvD8/uFgWcA1jqpkZWuN/Y
	V528CnMJiwEOBDG/Ws3mCFv5gQppTxXetGIn3CPiTkU8ngEjb9P1YbVqdG5/pMUDo4ijG3jm1Ey
	vRnhiqGx6Px84KXkw7srO4eoGMMIROtE2Hd3Ei6kn4B3KPKDjdO21qYAhuuG1tOZxLV5exzJ/0D
	V2fNEQD3kJytzlT7dkhb8w6ZJISjOR5A+E0GEogw6H4s1lAwpbouoDJLbupe/UaT3rMgi1k8WjB
	xxDYtY7qOKrhNIP46Qx9mL2fa5BgAxewxbwi7NDig6ERtqOlMCrBriYw3gQdopIoClL2FfFkTdy
	k5gHnQUXYYrIEUce46PMJq2wo6IfOarcHaG+lr+FYM1be2LOBT7FUYOKme+tfYR3oGCbc5+WBGf
	db2vtBMgUr7BzEEyJ51A7op5K/bJ1TcXn3rm36xE2FZiW2cUJ0vtsa19k6yXb/ttJ4u864fyDmt
	iLI5zzsVtsfzXH10ysnAF8vuuGm4zTzNmDU8UK8hiPnMAVcojVeyGlCsaSmXYKaSG+okVvEdMRk
	jAv1BEzUDib5tQdxgnL6BX5o0ZVG+DUHYd09EehxvUF/WBQJuGFTHsLkMmvuID1X2P/4=
X-Received: by 2002:a17:90b:57c5:b0:3ab:9f89:e1b3 with SMTP id 98e67ed59e1d1-3ae580dded9mr4420716a91.40.1793292455884;
        Thu, 29 Oct 2026 09:47:35 -0700 (PDT)
X-Received: from ?IPv6:2605:59c1:38c:400:82ee:73ff:fe41:9a02? ([2605:59c1:38c:400:82ee:73ff:fe41:9a02])
        by smtp.googlemail.com with ESMTPSA id 98e67ed59e1d1-3ae6e9583c1sm5285959a91.10.2026.10.29.09.47.34
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Thu, 29 Oct 2026 09:47:35 -0700 (PDT)
X-Cc: netdev@vger.kernel.org, Andrew Lunn <andrew+netdev@lunn.ch>, "David S .
 Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@kernel.org>, Jakub
 Kicinski <kuba@kernel.org>,  Paolo Abeni <pabeni@redhat.com>, Andre Brait
 <andrebrait@gmail.com>, stable@vger.kernel.org
X-In-Reply-To: <20261028170239.28606-1-tactii@gmail.com>
X-User-Agent: Evolution 3.60.2 (3.60.2-1.fc44) 
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