aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikulas Patocka2018-02-11 17:10:28 -0600
committerGreg Kroah-Hartman2018-02-22 08:45:01 -0600
commit94abb4921833e70a5d09ac35dbc78e29d67d3d87 (patch)
tree9fb1d7fdf595e2529a812cdd98de86b35b472c98
parentb374197df2deb08fec55d48763711ea1df8efde7 (diff)
downloadkernel-omap-94abb4921833e70a5d09ac35dbc78e29d67d3d87.tar.gz
kernel-omap-94abb4921833e70a5d09ac35dbc78e29d67d3d87.tar.xz
kernel-omap-94abb4921833e70a5d09ac35dbc78e29d67d3d87.zip
mvpp2: fix multicast address filter
commit 7ac8ff95f48cbfa609a060fd6a1e361dd62feeb3 upstream. IPv6 doesn't work on the MacchiatoBIN board. It is caused by broken multicast address filter in the mvpp2 driver. The driver loads doesn't load any multicast entries if "allmulti" is not set. This condition should be reversed. The condition !netdev_mc_empty(dev) is useless (because netdev_for_each_mc_addr is nop if the list is empty). This patch also fixes a possible overflow of the multicast list - if mvpp2_prs_mac_da_accept fails, we set the allmulti flag and retry. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Cc: stable@vger.kernel.org Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/net/ethernet/marvell/mvpp2.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/net/ethernet/marvell/mvpp2.c b/drivers/net/ethernet/marvell/mvpp2.c
index 4f34e1b79705..ac92685dd4e5 100644
--- a/drivers/net/ethernet/marvell/mvpp2.c
+++ b/drivers/net/ethernet/marvell/mvpp2.c
@@ -5666,6 +5666,7 @@ static void mvpp2_set_rx_mode(struct net_device *dev)
5666 int id = port->id; 5666 int id = port->id;
5667 bool allmulti = dev->flags & IFF_ALLMULTI; 5667 bool allmulti = dev->flags & IFF_ALLMULTI;
5668 5668
5669retry:
5669 mvpp2_prs_mac_promisc_set(priv, id, dev->flags & IFF_PROMISC); 5670 mvpp2_prs_mac_promisc_set(priv, id, dev->flags & IFF_PROMISC);
5670 mvpp2_prs_mac_multi_set(priv, id, MVPP2_PE_MAC_MC_ALL, allmulti); 5671 mvpp2_prs_mac_multi_set(priv, id, MVPP2_PE_MAC_MC_ALL, allmulti);
5671 mvpp2_prs_mac_multi_set(priv, id, MVPP2_PE_MAC_MC_IP6, allmulti); 5672 mvpp2_prs_mac_multi_set(priv, id, MVPP2_PE_MAC_MC_IP6, allmulti);
@@ -5673,9 +5674,13 @@ static void mvpp2_set_rx_mode(struct net_device *dev)
5673 /* Remove all port->id's mcast enries */ 5674 /* Remove all port->id's mcast enries */
5674 mvpp2_prs_mcast_del_all(priv, id); 5675 mvpp2_prs_mcast_del_all(priv, id);
5675 5676
5676 if (allmulti && !netdev_mc_empty(dev)) { 5677 if (!allmulti) {
5677 netdev_for_each_mc_addr(ha, dev) 5678 netdev_for_each_mc_addr(ha, dev) {
5678 mvpp2_prs_mac_da_accept(priv, id, ha->addr, true); 5679 if (mvpp2_prs_mac_da_accept(priv, id, ha->addr, true)) {
5680 allmulti = true;
5681 goto retry;
5682 }
5683 }
5679 } 5684 }
5680} 5685}
5681 5686