From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796382949; b=GpvUAjy/ngu5UflJ8N4PJ/BzywsskAdFD/XkbeGE8PtFub834bfTYx1ogrs0gSAQMEsX V9V4v/XeM7hsH8HMmY4L2OCTJpPUgJJ65skfqUw+BGMyWPev85dcrgvdLwG9NOWownf0i mc60EVxSLKWNHPpfx6OTs75PzVnBM2uCbEPH/J2gj5qI2ah0tWcP6Lkfz0K/IHlZktoct P5m08NsgJRK8v8h3E0rGf7604RC8EU3QhCwseBjdJVh0tSR0wPTS6JtBKy1mSW8fNxWx4 p4itmYW5JOrL68P2tynQTt4vVbBmamiLGaxq7R7EarUDx38StPftuKrk2LIPfnp6y+g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796382949; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=L9H59puodEGJMN0MW437xV52axyMw4SNr76gaLimUd8=; b=bPtjF+2gfpw6lTwKalE/7pY6koOeynQXxHfOau816fCgaB3YGQacJwxtDemPQOa7wmHH N1Eu0CW+F+NJCkFfFgXTTqTtQoVr+uj/raSCuJFIrs7BnRl4BhQRzXSXYizVQaFMitiZ7 C3rzQIgpg0Mp+WqscQzdfvES2LSY5DHUQDsGpqOzqZab+LlV4dWxMhHTIf5dZAHlYopKV IUq+tTtXLahCPEkHXyngXo2ynrlgzo1ie7ZauuUCG95d28B3CkdtAF2bhkIGl1FrunRi5 BywRRc8wPyEsQ8+96E1hHgB05EOaG+WwEcXvN2vGMiBrIYx2fRqBgL5Tmb/G6eOSP5w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b="o/KEQ5hH"; arc=none smtp.remote-ip=100.103.45.18 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 88E90606A322; Fri, 4 Dec 2026 11:15:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=o/KEQ5hH Received: by smtp.kernel.org (Postfix) with ESMTPSA id 00E311F000C2; Fri, 4 Dec 2026 11:15:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796382949; bh=L9H59puodEGJMN0MW437xV52axyMw4SNr76gaLimUd8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=o/KEQ5hHxNf3Q5+IWJ+EfbU3zCLM3aIUZOXNpwJuxjIKS21cG7g+hRkK1SAlZP0Lc w0TOiJeUbsunBTXt4i4MrkdIqYBMI6Se+xn6ed16zPa+YZfHXYphFXbw2GF3ZPW/7d u4vZfzPQAmbbxBz7aoQedIChYv7z+6zBg7bZw2Cs= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Christian Schmidbauer , Maxime Chevallier , Paolo Abeni , Sasha Levin Subject: [PATCH 6.18 661/703] net: stmmac: dwmac1000: stop hardware from dropping checksum-error packets Date: Fri, 4 Dec 2026 19:09:20 +0900 Message-ID: <20261204100645.366647907@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100627.522266145@linuxfoundation.org> References: <20261204100627.522266145@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Christian Schmidbauer [ Upstream commit 2dd48c4615a67ebb1762c2b0d79801be1949fcfb ] When the checksum offload engine (CoE) is enabled, the dwmac1000 MAC silently drops any frame for which the engine detects a checksum error, before the driver sees it. This breaks VXLAN over IPv6 with zero UDP checksums, which RFC 6935 and RFC 6936 allow for tunnels. Set DMA_CONTROL_DT so that such frames are delivered instead of dropped, as commit fe4042797651 ("net: stmmac: dwmac4: stop hardware from dropping checksum-error packets") did for dwmac4. CoE remains enabled, so the driver still sees the error status and marks the skb CHECKSUM_NONE for the stack to verify. Set the bit only with enhanced descriptors. The normal descriptor parser does not report a checksum-only error to the stack, so cores that use it keep dropping such frames in hardware anyway. Tested on an Aruba AP-325 (ipq806x-gmac-dwmac) with Rx checksum offload on. Link: https://lore.kernel.org/all/20250625132117.1b3264e8@kernel.org/ Link: https://github.com/freifunk-gluon/gluon/issues/3783 Fixes: 47dd7a540b8a ("net: add support for STMicroelectronics Ethernet controllers.") Cc: # 6.6.x: ee0aace5f844: net: stmmac: Correctly handle Rx checksum offload errors Cc: # 6.6.x Signed-off-by: Christian Schmidbauer Reviewed-by: Maxime Chevallier Tested-by: Maxime Chevallier Link: https://patch.msgid.link/20261114133640.3285413-4-opensource@grische.xyz Signed-off-by: Paolo Abeni [ sashal: Adjusted the header hunk for the existing two-line DMA_CONTROL_DT comment and define, and the C context line has csr6 |= DMA_CONTROL_RSF; without DMA_CONTROL_DFF. ] Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/stmicro/stmmac/dwmac1000.h | 3 +-- drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c | 8 ++++++++ 2 files changed, 9 insertions(+), 2 deletions(-) --- a/drivers/net/ethernet/stmicro/stmmac/dwmac1000.h +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac1000.h @@ -206,8 +206,7 @@ enum rx_tx_priority_ratio { #define DMA_BUS_FB 0x00010000 /* Fixed Burst */ /* DMA operation mode defines (start/stop tx/rx are placed in common header)*/ -/* Disable Drop TCP/IP csum error */ -#define DMA_CONTROL_DT 0x04000000 +#define DMA_CONTROL_DT 0x04000000 /* Disable Drop of TCP/IP csum errors */ #define DMA_CONTROL_RSF 0x02000000 /* Receive Store and Forward */ #define DMA_CONTROL_DFF 0x01000000 /* Disaable flushing */ /* Threshold for Activating the FC */ --- a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c @@ -15,6 +15,7 @@ #include #include "dwmac1000.h" #include "dwmac_dma.h" +#include "stmmac.h" static void dwmac1000_dma_axi(void __iomem *ioaddr, struct stmmac_axi *axi) { @@ -153,6 +154,13 @@ static void dwmac1000_dma_operation_mode { u32 csr6 = readl(ioaddr + DMA_CHAN_CONTROL(channel)); + /* Deliver checksum-error frames only with enhanced + * descriptors, because the normal descriptor parser does not + * report a checksum-only error. + */ + if (priv->plat->enh_desc) + csr6 |= DMA_CONTROL_DT; + if (mode == SF_DMA_MODE) { pr_debug("GMAC: enable RX store and forward mode\n"); csr6 |= DMA_CONTROL_RSF;