]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: stmmac: xgmac: fix missing IFF_MULTICAST checki in dwxgmac2_set_filter
authorTan, Tee Min <tee.min.tan@intel.com>
Fri, 7 Feb 2020 07:34:15 +0000 (15:34 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 7 Feb 2020 10:36:22 +0000 (11:36 +0100)
Without checking for IFF_MULTICAST flag, it is wrong to assume multicast
filtering is always enabled. By checking against IFF_MULTICAST, now
the driver behaves correctly when the multicast support is toggled by below
command:-
  ip link set <devname> multicast off|on

Fixes: 4e0f6dc5add52 ("net: stmmac: xgmac: Fix XGMAC selftests")
Signed-off-by: Tan, Tee Min <tee.min.tan@intel.com>
Signed-off-by: Ong Boon Leong <boon.leong.ong@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c

index a0e67d178280dc5c99129abf113fea29bc86d455..67b754a56288a0e9475ad1459732ba4e0d64d78c 100644 (file)
@@ -458,7 +458,7 @@ static void dwxgmac2_set_filter(struct mac_device_info *hw,
 
                for (i = 0; i < XGMAC_MAX_HASH_TABLE; i++)
                        writel(~0x0, ioaddr + XGMAC_HASH_TABLE(i));
-       } else if (!netdev_mc_empty(dev)) {
+       } else if (!netdev_mc_empty(dev) && (dev->flags & IFF_MULTICAST)) {
                struct netdev_hw_addr *ha;
 
                value |= XGMAC_FILTER_HMC;