* [PATCH net v3] net: amd-xgbe: discard rx packets with bad FCS
@ 2026-08-27 23:22 James Nugraha
0 siblings, 0 replies; only message in thread
From: James Nugraha @ 2026-08-27 23:22 UTC (permalink / raw)
To: Raju.Rangoju, PrashanthKumar.K.R
Cc: andrew+netdev, davem, edumazet, kuba, pabeni, netdev,
linux-kernel, david.laight.linux, James Nugraha
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")
Signed-off-by: James Nugraha <aslan.jnn@gmail.com>
---
v3:
- Removed DCRCC unset on xgbe_disable_rx().
- Add back the missing "Fixes" reference.
v2: https://lore.kernel.org/all/20260819091656.23943-1-aslan.jnn@gmail.com/
- 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/20260812091616.35811-1-aslan.jnn@gmail.com/
drivers/net/ethernet/amd/xgbe/xgbe-dev.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-dev.c b/drivers/net/ethernet/amd/xgbe/xgbe-dev.c
index 2de974213..e2e850c1b 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-dev.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-dev.c
@@ -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);
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-08-27 23:22 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-27 23:22 [PATCH net v3] net: amd-xgbe: discard rx packets with bad FCS James Nugraha
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox