Skip to contentSkip to conversation

net: stmmac: dwmac-sun8i: Drop received MAC control frames

PATCH In review Arun Iyengar 3 participants 3 messages Nov 26

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

PATCH 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.

Fixes 9f93ac8d4085 ("net-next: stmmac: Add dwmac-sun8i")

---
Tested on an Orange Pi Zero2 (H616), net/main, MAC loopback: TX still waits 32.6 ms per PAUSE; rx_dropped per 20 PAUSE frames 20 -> 0. Claude (AI) helped find the cause and write the patch; I reviewed and tested it.

---
 drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +1 -2
index 2ece7ba9dd73..f669bf22b7dc 100644
@@ -192,7 +192,6 @@ static const struct emac_variant emac_variant_h616_emac1 = {
 
 /* Used in EMAC_RX_FRM_FLT */
 #define EMAC_FRM_FLT_RXALL              BIT(0)
-#define EMAC_FRM_FLT_CTL                BIT(13)
 #define EMAC_FRM_FLT_MULTICAST          BIT(16)
 
 /* Used in RX_CTL1*/
@@ -720,7 +719,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: e509726660dd06ce107437aecf7c106c9d3fc1e7
change-id: 20261122-sun8i-emac-ctl-frames-186c03e03399

Best regards,

Signature · 1 line
Arun Iyengar <[email protected]>
#1 lore raw

Hi,

Quoted 9 lines · On 11/26/26 10:56, Arun Iyengar via B4 Relay wrote:

From: Arun Iyengar <[email protected]>

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.

Fixes 9f93ac8d4085 ("net-next: stmmac: Add dwmac-sun8i")

This shouldn't go to net, this is fairly harmless.

Quoted 5 lines

---
Tested on an Orange Pi Zero2 (H616), net/main, MAC loopback: TX still waits 32.6 ms per PAUSE; rx_dropped per 20 PAUSE frames 20 -> 0. Claude (AI) helped find the cause and write the patch; I reviewed and tested it.

How ? For me on H2+, mac-loopback with Pause didn't work without this series:

https://lore.kernel.org/r/[email protected]

What does the "ethtool -t" flow control selftest report with this new patch ?

Maxime

Quoted 33 lines
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +1 -3
index 2ece7ba9dd73..f669bf22b7dc 100644
@@ -192,7 +192,6 @@ static const struct emac_variant emac_variant_h616_emac1 = {
 
 /* Used in EMAC_RX_FRM_FLT */
 #define EMAC_FRM_FLT_RXALL              BIT(0)
-#define EMAC_FRM_FLT_CTL                BIT(13)
 #define EMAC_FRM_FLT_MULTICAST          BIT(16)
 
 /* Used in RX_CTL1*/
@@ -720,7 +719,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: e509726660dd06ce107437aecf7c106c9d3fc1e7
change-id: 20261122-sun8i-emac-ctl-frames-186c03e03399

Best regards,

Signature · 1 line
Arun Iyengar <[email protected]>
#2 lore raw
In reply to Arun Iyengar
Quoted 23 lines · On Thu, Nov 26, 2026 at 09:56:52AM +0000, Arun Iyengar via B4 Relay wrote:

From: Arun Iyengar <[email protected]>

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.

Fixes 9f93ac8d4085 ("net-next: stmmac: Add dwmac-sun8i")

---
Tested on an Orange Pi Zero2 (H616), net/main, MAC loopback: TX still waits 32.6 ms per PAUSE; rx_dropped per 20 PAUSE frames 20 -> 0. Claude (AI) helped find the cause and write the patch; I reviewed and tested it.

---
 drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +0 -0
index 2ece7ba9dd73..f669bf22b7dc 100644

drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c static const struct emac_variant emac_variant_h616_emac1 = { · line 195

Quoted 4 lines
drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +0 -1
@@ -192,7 +192,6 @@ static const struct emac_variant emac_variant_h616_emac1 = {
 
 /* Used in EMAC_RX_FRM_FLT */
 #define EMAC_FRM_FLT_RXALL              BIT(0)
-#define EMAC_FRM_FLT_CTL                BIT(13)

Even if it is not used, i would leave this in place. It acts as documentation of what the bit does.

Andrew