net: ethernet: dwmac-sun8i: show message only when switching to promisc
Subsystems (5)
PATCH 1/1 net: ethernet: dwmac-sun8i: show message only when switching to promisc
Printing the info message every time more than the max number of mac addresses are requested generates unnecessary log spam. Showing it only when the hw is not already in promiscous mode is equally informative without being annoying.
--- drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +2 -1
@@ -646,7 +646,8 @@ static void sun8i_dwmac_set_filter(struct mac_device_info *hw, } } }else { -netdev_info (dev,"Too many address, switching to promiscuous\n" ); +if (readl (ioaddr +EMAC_RX_FRM_FLT ) !=EMAC_FRM_FLT_RXALL ) +netdev_info (dev,"Too many address, switching to promiscuous\n" ); v =EMAC_FRM_FLT_RXALL ; }
Signature · 1 line
2.23.0
Quoted 15 lines · Mans Rullgard
Printing the info message every time more than the max number of mac addresses are requested generates unnecessary log spam. Showing it only when the hw is not already in promiscous mode is equally informative without being annoying.
Signed-off-by Mans Rullgard <[email protected]>--- drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +0
-0
drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c static void sun8i_dwmac_set_filter(struct mac_device_info *hw, · line 653
Quoted 9 lines
drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +2
-1@@ -646,7 +646,8 @@ static void sun8i_dwmac_set_filter(struct mac_device_info *hw, } } }else { -netdev_info (dev,"Too many address, switching to promiscuous\n" ); +if (readl (ioaddr +EMAC_RX_FRM_FLT ) !=EMAC_FRM_FLT_RXALL ) +netdev_info (dev,"Too many address, switching to promiscuous\n" ); v =EMAC_FRM_FLT_RXALL ; }
You need to mask the result, if EMAC_FRM_FLT_MULTICAST | EMAC_FRM_FLT_RXALL is set, you will still print the message. Or shorter than masking, !(readl(ioaddr + EMAC_RX_FRM_FLT) & EMAC_FRM_FLT_RXALL)
I just realize that perhaps we need to set also IFF_PROMISC in dev->flags.
Thanks
Regards