net: stmmac: dwmac-sun8i: Drop received MAC control frames
Subsystems (5)
PATCH v2 1/1 net: stmmac: dwmac-sun8i: Drop received MAC control frames
sun8i_dwmac_set_filter() sets CTL_FRM_FILTER to "receive all control frames", so every PAUSE frame reaches the stack and is counted in rx_dropped. Leave it at 0, "drop", as the Allwinner BSP does; the MAC still obeys PAUSE.
---
Tested on an Orange Pi Zero2 (H616), net-next, MAC loopback, PAUSE
(quanta 0xffff) sent to itself from a raw socket: the next frame waits
32.6 ms with and without this patch; rx_dropped per 20 PAUSE 20 -> 0.
ethtool -t Flow Control passes on both (the test sets promiscuous mode).
Claude (AI) helped find the cause and write the patch; I reviewed and
tested it.
---
Changes in v2:
- Target net-next (Maxime).
- Keep the EMAC_FRM_FLT_CTL define (Andrew).
- Add the flow control test results (Maxime).
- Link to v1: https://patch.msgid.link/[email protected]
--- drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +1 -1
@@ -728,7 +728,7 @@ static void sun8i_dwmac_set_filter(struct mac_device_info *hw,struct netdev_hw_addr *ha;int macaddrs =netdev_uc_count (dev) +netdev_mc_count (dev) +1 ; - v =EMAC_FRM_FLT_CTL ; + v =0 ;if (dev->flags &IFF_PROMISC ) { v =EMAC_FRM_FLT_RXALL ;
---
base-commit: ccb81d5e317b0ae2cc66ca1c628c0ca907928f94
change-id: 20261122-sun8i-emac-ctl-frames-186c03e03399
Best regards,
Signature · 1 line
Arun Iyengar <[email protected]>