On dwmac1000 the MAC drops every frame that fails Rx checksum validation
before the driver sees it. The enhanced descriptor parser would discard
such a frame even if the MAC delivered it. As a result, a VXLAN tunnel
over IPv6 with zero UDP checksums receives nothing while Rx checksum
offload is on, and neither rx_dropped nor rx_errors shows the loss.
Patches 2 and 3 deliver these frames with CHECKSUM_NONE instead, as
commit fe4042797651 ("net: stmmac: dwmac4: stop hardware from dropping
checksum-error packets") did for dwmac4.
Patch 1 makes the AF_XDP zero-copy Rx path honour the checksum error
status. That path already receives such frames on dwmac4, and patches
2 and 3 make them reach it on dwmac1000 as well. Patch 3 depends on
patches 1 and 2.
Tested on an Aruba AP-325 (ipq806x-gmac-dwmac) on the net tree, with
and without the series.
Not tested:
- Patch 1 was only compile-tested, as an AF_XDP zero-copy setup was not
available.
- dwmac-loongson, which also uses dwmac1000_dma_ops.
- Cores with normal descriptors, such as Rockchip RK3288, RK3328 and
RK3399.
Changes in v3:
- Move code comment of DMA_CONTROL_DT on the line of the define, similar
to the original version in commit 47dd7a540b8a ("net: add support for
STMicroelectronics Ethernet controllers.").
Changes in v2:
- Rebase on net, where commit 834ec9530832 ("net: stmmac: drop split
frames on AF_XDP zero-copy RX") fixed the multi-buffer issue that
Sashiko raised in the v1 review.
- Drop RDES0_LENGTH_ERROR from the Error Summary mask in patch 2, as
the bit does not contribute to Error Summary and the length check
further down discards such a frame anyway.
- Explain in the commit message of patch 2 why RDES0 bit 7 is not
treated as an L2 error.
- Set DMA_CONTROL_DT in patch 3 only with enhanced descriptors, as
the normal descriptor parser does not report a checksum-only error.
v2: https://lore.kernel.org/netdev/20261104151914.2651241-1-opensource@grische.xyz/ (local)
v1: https://lore.kernel.org/netdev/20261020190319.884375-1-opensource@grische.xyz/ (local)
Christian Schmidbauer (3):
net: stmmac: honour Rx checksum errors in the AF_XDP zero-copy path
net: stmmac: dwmac1000: don't discard frames with only a checksum
error
net: stmmac: dwmac1000: stop hardware from dropping checksum-error
packets
drivers/net/ethernet/stmicro/stmmac/dwmac1000.h | 2 +-
drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c | 8 ++++++++
drivers/net/ethernet/stmicro/stmmac/enh_desc.c | 8 ++++----
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 8 +++++---
4 files changed, 18 insertions(+), 8 deletions(-)
base-commit: 241dec6f9ab74d8c3ef246764f3611666b96b9e1
--
2.54.0