🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #5635

[PATCH net 2/3] net: stmmac: dwmac1000: don't discard frames with only a checksum error

#5635
From: Grische
Date: Tue, 20 Oct 2026 19:03
57 lines
11936 bytes
On dwmac1000 with enhanced descriptors, the hardware sets the Error
Summary (ES) bit of the Rx descriptor not only for L2 errors but also
for an L3/L4 checksum error. enh_desc_get_rx_status() returns
discard_frame whenever ES is set, and since commit 1b746ce8b397 ("net:
stmmac: don't overwrite discard_frame status") the checksum status is
only evaluated for good frames.

Return discard_frame only for L2 errors. A frame with only a checksum
error is then reported as csum_none and reaches the stack as
CHECKSUM_NONE, so the stack verifies the checksum itself. This matches
dwmac4, whose Error Summary check does not include the checksum bits.

Also drop the per-frame pr_err in enh_desc_get_rx_status(). Once the MAC
delivers checksum-error frames, it can be triggered from the wire.

This prepares for setting DMA_CONTROL_DT, which makes the MAC deliver
checksum-error frames instead of dropping them in its Rx FIFO.

Fixes: 1b746ce8b397 ("net: stmmac: don't overwrite discard_frame status")
Cc: <stable@vger.kernel.org> # 6.6.x: ee0aace5f844: net: stmmac: Correctly handle Rx checksum offload errors
Cc: <stable@vger.kernel.org> # 6.6.x
Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Grische <opensource@grische.xyz>
---
 drivers/net/ethernet/stmicro/stmmac/enh_desc.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/enh_desc.c b/drivers/net/ethernet/stmicro/stmmac/enh_desc.c
index 051253601225..5c43d32a2f22 100644
--- a/drivers/net/ethernet/stmicro/stmmac/enh_desc.c
+++ b/drivers/net/ethernet/stmicro/stmmac/enh_desc.c
@@ -195,9 +195,6 @@ static int enh_desc_get_rx_status(struct stmmac_extra_stats *x,
 		if (unlikely(rdes0 & RDES0_OVERFLOW_ERROR))
 			x->rx_gmac_overflow++;
 
-		if (unlikely(rdes0 & RDES0_IPC_CSUM_ERROR))
-			pr_err("\tIPC Csum Error/Giant frame\n");
-
 		if (unlikely(rdes0 & RDES0_COLLISION))
 			x->rx_collision++;
 		if (unlikely(rdes0 & RDES0_RECEIVE_WATCHDOG))
@@ -209,7 +206,11 @@ static int enh_desc_get_rx_status(struct stmmac_extra_stats *x,
 		if (unlikely(rdes0 & RDES0_CRC_ERROR)) {
 			x->rx_crc_errors++;
 		}
-		ret = discard_frame;
+		if (rdes0 & (RDES0_DESCRIPTOR_ERROR | RDES0_OVERFLOW_ERROR |
+			     RDES0_COLLISION | RDES0_RECEIVE_WATCHDOG |
+			     RDES0_MII_ERROR | RDES0_CRC_ERROR |
+			     RDES0_LENGTH_ERROR))
+			ret = discard_frame;
 	}
 
 	/* After a payload csum error, the ES bit is set.
-- 
2.54.0
Technical Details
Message-ID: <20261020190319.884375-3-opensource@grische.xyz>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-349481-linux-kernel-netdev=dewy.ru
References: <20261020190319.884375-1-opensource@grische.xyz>

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-349481-linux-kernel-netdev=dewy.ru
From: opensource@grische.xyz (Grische)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net 2/3] net: stmmac: dwmac1000: don't discard frames with only a checksum error
Date: Tue, 20 Oct 2026 21:03:17 +0200
Organization: Usenet Network
Message-ID: <20261020190319.884375-3-opensource@grische.xyz>
References: <20261020190319.884375-1-opensource@grische.xyz>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="3929382"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:+xuatZ04fmKs4uq6H/0FtCS3Ujc= sha256:CtCTzRjb2y2nZzmP9n5MRcAr3qehZN+I5csPD+CxVzY=
	sha1:q/Xm2wJugr9XbhFU2ufEVyZOnCM= sha256:LHR/oSUMs9QEDWK3e6kSPt+DAviGH/FI5NeCBT+cMWc=
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 644E1110DE0; Tue, 20 Oct 2026 22:04:10 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -2.551
X-Spam-Status: No, score=-2.551 tagged_above=-9999 required=6.31
	tests=[FROM_SUSPICIOUS_NTLD=0.499, 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-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 BVaVa_mgneAc;
	Tue, 20 Oct 2026 22:04:08 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-349481-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=grische.xyz
X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
	by mail.dewy.ru (Postfix) with ESMTPS id 052A9110DDD; Tue, 20 Oct 2026 22:04:04 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sto.lore.kernel.org (Postfix) with ESMTP id CB821614679; Tue, 20 Oct 2026 19:03:42 +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=1792523013;
	b=qNAYm9A4B/D/tPQZBDdzVDwU2zq1i5n73WkxX2GzGvoUDgb6YeIo6/XtMr5JgQaJ79zZ
	 xNyy7KkuYkCfajsKNkkpVymnnCC/U8BO7nlkLYMcGGUew/unrmVrPh18cI7F2PuymO4qQ
	 xzjD4rkuhDPAR9Dvg0USn/hVyGV4KXe1JUtg7VcLHayRYglemFXYBIJvjZqivlZgdlnx7
	 5BlA37RQ2woa5ZYL4jX35Vomjqo3VjAZXYuzfQoKeLIUQtF6+hxhoFvI9do82qQEhpBrT
	 b7XpkFD8faSrJexM1wJUOL+f/ERt50IUj3F23JXNlbCjz++NyXvY5OsjWvBala9XR9w==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792523013;
	h=X-Original-To:Received:DMARC-Filter:Received:X-Google-DKIM-Signature:
	 X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:To:Cc:Subject:
	 Date:Message-ID:X-Mailer:In-Reply-To:References:X-Mailing-List:
	 List-Id:List-Post:List-Help:List-Subscribe:List-Unsubscribe:
	 List-Owner:Precedence:MIME-Version:Content-Transfer-Encoding;
	bh=yDyp6R6XHxt49rPY0V1CwuTyDv1VXxyGmnKmgJVZ160=;
	b=DrV8DXue/h2jZg8IGjCXiVdrhkJOaGA6UjxNwaxU5HMvjPNZnflme1012WfSXlYgsAKw
	 /XYxHoRf4YlAzcnTqzK3/JFXEaeQlRr8v2YNiUct1NU0zKmYrsgDhHCnvcyBCh0Rvm3UT
	 zGhnUko+NKJX5h7RgfngDpfC2ZORvljTotl23e9uektuurmNQkQQN+ZZrzc7yzDyFMb/9
	 N7uyQoXEE54lMY7w7zpoqXCqR9F77BwMGV3oEMYMJEMe2iLno4Gl3E7DwSg7sw7gdLmlR
	 qjG76kdIJfVzeZ/N4s74VxDHuW3BxvEohIwm7KtCdmQOGy6zLhPckesC13c42+TAbzA==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dmarc=none header.from=grische.xyz;
	spf=pass smtp.mailfrom=grische.xyz;
	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 DF9F2606A322;
	Tue, 20 Oct 2026 19:03:33 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.53
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1792523008;
	b=ubFdR3jmnwU4OynuvX5q4pn3Y9C5SPSnlEZbUgi9sbO53N9e9EPBJkKxpUUIEQg9YVfA
	 s3ISwVEe7z/v/lZF+VWaiDEsrK4Y4RYF+H6QbLuNeug4V8hJXMtFVdcmvern2tjNHrdSx
	 18J0b6uIE10AHx6nk3qYkLM6/8DPO0F31HJsO33BZ9gf1RvKgm6j8SwuOUfgWMiBFEk3x
	 eCBTvmlPZAKmoP2a/9bvFpwZ35Vz0T30MeaJw4ejA5wrMnOoqRXNdkQYWDRxDrC3136St
	 kItpC2b5nNgZTEwRWkhCky9Ig4R+utWQl5C0iJqpkfrqVDzGLKONinqJviKSAxsESsw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792523008;
	h=DMARC-Filter:Received:X-Google-DKIM-Signature:X-Gm-Message-State:
	 X-Gm-Gg:X-Received:Received:From:To:Cc:Subject:Date:Message-ID:
	 X-Mailer:In-Reply-To:References:MIME-Version:
	 Content-Transfer-Encoding;
	bh=yDyp6R6XHxt49rPY0V1CwuTyDv1VXxyGmnKmgJVZ160=;
	b=Wm91CAJOw//b41xO+01bYIFSi6JlDgyLT9KANqBSnJUDQuRFBPJb/qIyi84utaaT5+ps
	 4lO4uw/1UCQrGhGP1b9qBefNJDTus3DP0XOMdSJ7LXSxoSPY7MrPb/WtYrzfzfWmc13dX
	 OVm+9g5jl6EMDppYc+x72/MubuxNgQufL1gqFkv2lRHTjObWif93kS78C2GHU+JSjWogt
	 5nny+iOldK2+/NxNKR5f3SO/NSLAvwa6XcmoqiIWIA2A4ozeRtbnxEvb5MEicpK0uB4Yv
	 1XNe8ULjNzxYTgxE4kuIRIFybB/6HBWHHwSO5r3q/yXg30rN8Xw1GKNyodJr+3gnw2g==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=none header.from=grische.xyz;
	spf=pass smtp.mailfrom=grische.xyz;
	arc=none smtp.remote-ip=209.85.221.53
X-Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.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 E7D6E60A2606
	for <netdev@vger.kernel.org>; Tue, 20 Oct 2026 19:03:27 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org E7D6E60A2606
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=grische.xyz
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=grische.xyz
X-Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-48dfc0421d9so2612910f8f.1
        for <netdev@vger.kernel.org>; Tue, 20 Oct 2026 12:03:27 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1792523006; x=1793127806;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=yDyp6R6XHxt49rPY0V1CwuTyDv1VXxyGmnKmgJVZ160=;
        b=y81YjsmRd636OBmKmEG/pyFumct6NRA/PZth51qfiXbwXbyMNxOmEXs35oGIxudUaz
         Np8eCVfYV/DNjVFXr184HtLW/jmcG/2Y+YVbJAOh59pBDrj49mIPd+wtReeaUXayRt7c
         WWXOc95DqMYK8Qu7GU9VHdK1NeT68jju2Z1hMM7MvBY+60SCLAAeJHw4JiTTLxP/4Wnw
         C1X3uTD/MqADZuo2ymfGCvy8UtGfpCfEvgi1r+8g98Eb4aNP5mjdQaRMsL5oDe5fbqML
         H+vj9mFiY8yvKt3fjXwmNUOiv/6rwU/+7UbMjg0pOIIcvqqUI3ZnH3/35zRWplzW6oZR
         OHBQ==
X-Gm-Message-State: AFq9FYLSgZjFu7rd8PRy9BlmXENTMZZVIXTshDxeyXkznyvvBcrcRDhu
	afbSqudrQBA3ZHGjap/qK/k3bgGGpN+5XT1h7NPUNSdmMcYrAVMIHsCffJs3HvvPKaWW8fRrAUJ
	otRItObMqwA==
X-Gm-Gg: AYBFou1gLL6gZ7l4HlOHnX02I9mD2k7d0QpDAOz47IWwz6YB7FymXkuo1cexT4NGELw
	iY8KmN+HrheWZJDi3Hma6OuV51LQCA1v1ZfELU1uWi35N/nJF7yxR0Lnma595xlq8TGB+aHS35T
	mNDst5xn1SKhuR8Gsi/byavulFmeO2Gb5JZeD7uh3Hg1Dh+aPXLmEc4E7958rviq/fUO/uiF7n6
	9/NDfeM504e6OytOjL9KcNGTBt2cheqlm3CLyGZ9CCrnC32kxWQGPRSUtD39nqcRxrjtE2XsO60
	tRLXR3o01vNCH2Roj9JSbhpA07dYBK0jQXBiBRtoYuzxAWsEhOiQ9NlF3iZ97SNrY5jzTP9IA+X
	tLegKpzSE0MRlPSff5G7t8k1gJiA5GV2DxT3ZJembjWZIJpGnIUNtVjGVMYYhP1tU0fVU28FYtj
	vp7YOtNt11jEHUMMFW8q5OGqr+KjdPwk2qgAVfFSHfOz3R6Z2eAPL0LPwhbN76OHts24U=
X-Received: by 2002:a05:6000:1865:b0:48d:f7ef:cd1d with SMTP id ffacd0b85a97d-48e07bb2cc8mr29021791f8f.9.1792523006337;
        Tue, 20 Oct 2026 12:03:26 -0700 (PDT)
X-Received: from lake ([2a02:810d:d09:1b65:a3ee:29e0:454d:c31e])
        by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-48e25828cbfsm279157f8f.23.2026.10.20.12.03.23
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Tue, 20 Oct 2026 12:03:25 -0700 (PDT)
X-Cc: maxime.chevallier@bootlin.com,
	andrew+netdev@lunn.ch,
	davem@davemloft.net,
	edumazet@kernel.org,
	kuba@kernel.org,
	pabeni@redhat.com,
	Oleksij Rempel <o.rempel@pengutronix.de>,
	Grische <opensource@grische.xyz>,
	stable@vger.kernel.org,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Aaro Koskinen <aaro.koskinen@nokia.com>,
	linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
X-Mailer: git-send-email 2.54.0
X-In-Reply-To: <20261020190319.884375-1-opensource@grische.xyz>
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