Skip to content

Commit

Permalink
net: stmmac: xgmac: fix missing IFF_MULTICAST checki in dwxgmac2_set_…
Browse files Browse the repository at this point in the history
…filter

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: 0efedbf ("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>
  • Loading branch information
Tan, Tee Min authored and David S. Miller committed Feb 7, 2020
1 parent 2ba31cd commit 2f633d5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2f633d5

Please sign in to comment.