]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: stmmac: dwmac4: stop hardware from dropping checksum-error packets
authorOleksij Rempel <o.rempel@pengutronix.de>
Mon, 18 Aug 2025 09:02:17 +0000 (11:02 +0200)
committerJakub Kicinski <kuba@kernel.org>
Wed, 20 Aug 2025 01:33:06 +0000 (18:33 -0700)
commitfe4042797651215ca9acd83035122b5e940acf2e
tree7e4e05b25c770c0400937f3d34b8b726174c6af0
parent644b8437ccef9e7444164d8c4409933565928371
net: stmmac: dwmac4: stop hardware from dropping checksum-error packets

Tell the MAC not to discard frames that fail TCP/IP checksum
validation.

By default, when the hardware checksum engine (CoE) is enabled,
dwmac4 silently drops any packet where the offload engine detects
a checksum error. These frames are not reported to the driver and
are not counted in any statistics as dropped packets.

Set the MTL_OP_MODE_DIS_TCP_EF bit when initializing the Rx channel so
that all packets are delivered, even if they failed hardware checksum
validation. CoE remains enabled, but instead of dropping such frames,
the driver propagates the error status and marks the skb with
CHECKSUM_NONE. This allows the stack to verify and drop the packet
while updating statistics.

This change follows the decision made in the discussion:
Link: https://lore.kernel.org/all/20250625132117.1b3264e8@kernel.org/
It depends on the previous patches that added proper error propagation
in the Rx path.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Link: https://patch.msgid.link/20250818090217.2789521-4-o.rempel@pengutronix.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/dwmac4.h
drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c