| From 29225bac60e5cab9f78b04793b706f0777cdf2cb Mon Sep 17 00:00:00 2001 |
| From: Jonathan McDowell <noodles@earth.li> |
| Date: Wed, 12 Aug 2020 20:37:01 +0100 |
| Subject: [PATCH] net: stmmac: dwmac1000: provide multicast filter fallback |
| |
| commit 592d751c1e174df5ff219946908b005eb48934b3 upstream. |
| |
| If we don't have a hardware multicast filter available then instead of |
| silently failing to listen for the requested ethernet broadcast |
| addresses fall back to receiving all multicast packets, in a similar |
| fashion to other drivers with no multicast filter. |
| |
| Cc: stable@vger.kernel.org |
| Signed-off-by: Jonathan McDowell <noodles@earth.li> |
| Signed-off-by: David S. Miller <davem@davemloft.net> |
| |
| diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c |
| index 81af0f3f5cf9..054e79a36b5a 100644 |
| --- a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c |
| +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c |
| @@ -166,6 +166,9 @@ static void dwmac1000_set_filter(struct mac_device_info *hw, |
| value = GMAC_FRAME_FILTER_PR; |
| } else if (dev->flags & IFF_ALLMULTI) { |
| value = GMAC_FRAME_FILTER_PM; /* pass all multi */ |
| + } else if (!netdev_mc_empty(dev) && (mcbitslog2 == 0)) { |
| + /* Fall back to all multicast if we've no filter */ |
| + value = GMAC_FRAME_FILTER_PM; |
| } else if (!netdev_mc_empty(dev)) { |
| struct netdev_hw_addr *ha; |
| |
| -- |
| 2.27.0 |
| |