Skip to content

net: stmmac: deliver frames with Rx checksum errors to the stack

Christian Schmidbauer bpf linux-arm-kernel lkml netdev stable 3 versions – Applied

Status from this message: This series was applied to netdev/net.git (main)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest3 patches 3 repliesApplied 3/3
  2. v23 patches 3 repliesSuperseded
  3. v13 patches 3 repliesSuperseded

Changes in v3 from the cover letter

- 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.").

Patches in v3 All 3 applied

#Subject and filesSizeRepliesApplied
1/3net: stmmac: honour Rx checksum errors in the AF_XDP zero-copy pathdrivers/net/ethernet/stmicro/stmmac/stmmac_main.c+5 -31 replyApplied
2/3net: stmmac: dwmac1000: don't discard frames with only a checksum errordrivers/net/ethernet/stmicro/stmmac/enh_desc.c+4 -41 replyApplied
3/3net: stmmac: dwmac1000: stop hardware from dropping checksum-error packetsdrivers/net/ethernet/stmicro/stmmac/dwmac1000.h drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c+9 -11 replyApplied

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchMaxime Chevallier
1/3R-b
2/3R-b T-b
3/3R-b T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH net v3 0/3] net: stmmac: deliver frames with Rx checksum errors to the stack

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/[email protected]/
v1: https://lore.kernel.org/netdev/[email protected]/

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

Signature · 1 line
2.54.0