net: stmmac: dwmac1000: stop hardware from dropping checksum-error packets

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 fe40427976 ("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/[email protected]/
Link: https://github.com/freifunk-gluon/gluon/issues/3783
Fixes: 47dd7a540b ("net: add support for STMicroelectronics Ethernet controllers.")
Cc: <[email protected]> # 6.6.x: ee0aace5f8: net: stmmac: Correctly handle Rx checksum offload errors
Cc: <[email protected]> # 6.6.x
Signed-off-by: Christian Schmidbauer <[email protected]>
Reviewed-by: Maxime Chevallier <[email protected]>
Tested-by: Maxime Chevallier <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Paolo Abeni <[email protected]>
This commit is contained in:
Christian Schmidbauer
2026-11-19 12:47:26 +01:00
committed by Paolo Abeni
parent 596c940868
commit 2dd48c4615
2 changed files with 9 additions and 1 deletions
@@ -162,7 +162,7 @@ enum rx_tx_priority_ratio {
/* DMA CRS Control and Status Register Mapping */
/* DMA operation mode defines (start/stop tx/rx are placed in common header)*/
/* Disable Drop TCP/IP csum error */
#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 */
@@ -15,6 +15,7 @@
#include <linux/io.h>
#include "dwmac1000.h"
#include "dwmac_dma.h"
#include "stmmac.h"
static void dwmac1000_dma_axi(void __iomem *ioaddr, struct stmmac_axi *axi)
{
@@ -129,6 +130,13 @@ static void dwmac1000_dma_operation_mode_rx(struct stmmac_priv *priv,
{
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 | DMA_CONTROL_DFF;