Skip to contentSkip to conversation

net: amd-xgbe: discard rx packets with bad FCS

PATCH Applied James Nugraha 2 participants 2 messages Aug 27 – Aug 30

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 net: amd-xgbe: discard rx packets with bad FCS

amd-xgbe driver currently sets the MAC_RCR.DCRCC bit whenever RX is enabled. This disables hardware FCS validation, causing packets with bad FCS to be accepted unconditionally.

This change unsets DCRCC so that packets with bad FCS will be dropped, in-line with typical behaviours of many other network controllers.

Tests:
- Verified that packets with bad FCS are now dropped.
- Verified that receiving packets with bad FCS will increment the rx_crc_errors counter.

Fixes c5aa9e3b8156 ("amd-xgbe: Initial AMD 10GbE platform driver")

---
v3:
- Removed DCRCC unset on xgbe_disable_rx().
- Add back the missing "Fixes" reference.
v2: https://lore.kernel.org/all/[email protected]/
- Eliminated DCRCC toggling via RXALL: now it simply sets the correct default value on MAC Rx enable.
- Updated testing information.
v1: https://lore.kernel.org/all/[email protected]/

 drivers/net/ethernet/amd/xgbe/xgbe-dev.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/ethernet/amd/xgbe/xgbe-dev.c +1 -2
index 2de974213..e2e850c1b 100644
@@ -3400,7 +3400,7 @@ static void xgbe_enable_rx(struct xgbe_prv_data *pdata)
 	XGMAC_IOWRITE(pdata, MAC_RQC0R, reg_val);
 
 	/* Enable MAC Rx */
-	XGMAC_IOWRITE_BITS(pdata, MAC_RCR, DCRCC, 1);
+	XGMAC_IOWRITE_BITS(pdata, MAC_RCR, DCRCC, 0);
 	XGMAC_IOWRITE_BITS(pdata, MAC_RCR, CST, 1);
 	XGMAC_IOWRITE_BITS(pdata, MAC_RCR, ACS, 1);
 	XGMAC_IOWRITE_BITS(pdata, MAC_RCR, RE, 1);
@@ -3411,7 +3411,6 @@ static void xgbe_disable_rx(struct xgbe_prv_data *pdata)
 	unsigned int i;
 
 	/* Disable MAC Rx */
-	XGMAC_IOWRITE_BITS(pdata, MAC_RCR, DCRCC, 0);
 	XGMAC_IOWRITE_BITS(pdata, MAC_RCR, CST, 0);
 	XGMAC_IOWRITE_BITS(pdata, MAC_RCR, ACS, 0);
 	XGMAC_IOWRITE_BITS(pdata, MAC_RCR, RE, 0);
#1 lore raw
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Fri, 28 Aug 2026 09:22:19 +1000 you wrote:

amd-xgbe driver currently sets the MAC_RCR.DCRCC bit whenever RX is enabled. This disables hardware FCS validation, causing packets with bad FCS to be accepted unconditionally.

This change unsets DCRCC so that packets with bad FCS will be dropped, in-line with typical behaviours of many other network controllers.

[...]

Here is the summary with links:
- [net,v3] net: amd-xgbe: discard rx packets with bad FCS

    https://git.kernel.org/netdev/net/c/ac8d6b28d48c

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html