[PATCH net-next v1 0/3] stmmac: stop silently dropping bad checksum packets

Oleksij Rempel posted 3 patches 1 month, 2 weeks ago
drivers/net/ethernet/stmicro/stmmac/dwmac4.h       | 1 +
drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c | 8 ++++++--
drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c   | 2 ++
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c  | 3 ++-
4 files changed, 11 insertions(+), 3 deletions(-)
[PATCH net-next v1 0/3] stmmac: stop silently dropping bad checksum packets
Posted by Oleksij Rempel 1 month, 2 weeks ago
Hi all,

this series reworks how stmmac handles receive checksum offload
(CoE) errors on dwmac4.

At present, when CoE is enabled, the hardware silently discards any
frame that fails checksum validation. These packets never reach the
driver and are not accounted in the generic drop statistics. They are
only visible in the stmmac-specific counters as "payload error" or
"header error" packets, which makes it harder to debug or monitor
network issues.

Following discussion [1], the driver is reworked to propagate checksum
error information up to the stack. With these changes, CoE stays
enabled, but frames that fail hardware validation are no longer dropped
in hardware. Instead, the driver marks them with CHECKSUM_NONE so the
network stack can validate, drop, and properly account them in the
standard drop statistics.

[1] https://lore.kernel.org/all/20250625132117.1b3264e8@kernel.org/

Oleksij Rempel (3):
  net: stmmac: Correctly handle Rx checksum offload errors
  net: stmmac: dwmac4: report Rx checksum errors in status
  net: stmmac: dwmac4: stop hardware from dropping checksum-error
    packets

 drivers/net/ethernet/stmicro/stmmac/dwmac4.h       | 1 +
 drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c | 8 ++++++--
 drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c   | 2 ++
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c  | 3 ++-
 4 files changed, 11 insertions(+), 3 deletions(-)

--
2.39.5
Re: [PATCH net-next v1 0/3] stmmac: stop silently dropping bad checksum packets
Posted by Russell King (Oracle) 1 month, 2 weeks ago
On Mon, Aug 18, 2025 at 11:02:14AM +0200, Oleksij Rempel wrote:
> Hi all,
> 
> this series reworks how stmmac handles receive checksum offload
> (CoE) errors on dwmac4.
> 
> At present, when CoE is enabled, the hardware silently discards any
> frame that fails checksum validation. These packets never reach the
> driver and are not accounted in the generic drop statistics. They are
> only visible in the stmmac-specific counters as "payload error" or
> "header error" packets, which makes it harder to debug or monitor
> network issues.

FYI, there are counters at 0x214 and 0x228 that indicate header
problems, including checksum failures. There are also counters
at 0x234, 0x23c, 0x244 that count udp, tcp and icmp checksum
errors.

So, the hardware does keep statistics. Maybe we should make use
of those rather than the approach in this series?

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!