All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mvpp2: fix multicast address filter
@ 2018-02-11 23:10 ` Mikulas Patocka
  0 siblings, 0 replies; 4+ messages in thread
From: Mikulas Patocka @ 2018-02-11 23:10 UTC (permalink / raw)
  To: David S. Miller, Marcin Wojtas, Russell King; +Cc: linux-arm-kernel, netdev

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

---
 drivers/net/ethernet/marvell/mvpp2.c |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

Index: linux-2.6/drivers/net/ethernet/marvell/mvpp2.c
===================================================================
--- linux-2.6.orig/drivers/net/ethernet/marvell/mvpp2.c	2018-02-11 23:40:01.000000000 +0100
+++ linux-2.6/drivers/net/ethernet/marvell/mvpp2.c	2018-02-11 23:44:09.000000000 +0100
@@ -7137,6 +7137,7 @@ static void mvpp2_set_rx_mode(struct net
 	int id = port->id;
 	bool allmulti = dev->flags & IFF_ALLMULTI;
 
+retry:
 	mvpp2_prs_mac_promisc_set(priv, id, dev->flags & IFF_PROMISC);
 	mvpp2_prs_mac_multi_set(priv, id, MVPP2_PE_MAC_MC_ALL, allmulti);
 	mvpp2_prs_mac_multi_set(priv, id, MVPP2_PE_MAC_MC_IP6, allmulti);
@@ -7144,9 +7145,13 @@ static void mvpp2_set_rx_mode(struct net
 	/* Remove all port->id's mcast enries */
 	mvpp2_prs_mcast_del_all(priv, id);
 
-	if (allmulti && !netdev_mc_empty(dev)) {
-		netdev_for_each_mc_addr(ha, dev)
-			mvpp2_prs_mac_da_accept(priv, id, ha->addr, true);
+	if (!allmulti) {
+		netdev_for_each_mc_addr(ha, dev) {
+			if (mvpp2_prs_mac_da_accept(priv, id, ha->addr, true)) {
+				allmulti = true;
+				goto retry;
+			}
+		}
 	}
 }
 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] mvpp2: fix multicast address filter
@ 2018-02-11 23:10 ` Mikulas Patocka
  0 siblings, 0 replies; 4+ messages in thread
From: Mikulas Patocka @ 2018-02-11 23:10 UTC (permalink / raw)
  To: linux-arm-kernel

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 at vger.kernel.org

---
 drivers/net/ethernet/marvell/mvpp2.c |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

Index: linux-2.6/drivers/net/ethernet/marvell/mvpp2.c
===================================================================
--- linux-2.6.orig/drivers/net/ethernet/marvell/mvpp2.c	2018-02-11 23:40:01.000000000 +0100
+++ linux-2.6/drivers/net/ethernet/marvell/mvpp2.c	2018-02-11 23:44:09.000000000 +0100
@@ -7137,6 +7137,7 @@ static void mvpp2_set_rx_mode(struct net
 	int id = port->id;
 	bool allmulti = dev->flags & IFF_ALLMULTI;
 
+retry:
 	mvpp2_prs_mac_promisc_set(priv, id, dev->flags & IFF_PROMISC);
 	mvpp2_prs_mac_multi_set(priv, id, MVPP2_PE_MAC_MC_ALL, allmulti);
 	mvpp2_prs_mac_multi_set(priv, id, MVPP2_PE_MAC_MC_IP6, allmulti);
@@ -7144,9 +7145,13 @@ static void mvpp2_set_rx_mode(struct net
 	/* Remove all port->id's mcast enries */
 	mvpp2_prs_mcast_del_all(priv, id);
 
-	if (allmulti && !netdev_mc_empty(dev)) {
-		netdev_for_each_mc_addr(ha, dev)
-			mvpp2_prs_mac_da_accept(priv, id, ha->addr, true);
+	if (!allmulti) {
+		netdev_for_each_mc_addr(ha, dev) {
+			if (mvpp2_prs_mac_da_accept(priv, id, ha->addr, true)) {
+				allmulti = true;
+				goto retry;
+			}
+		}
 	}
 }
 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mvpp2: fix multicast address filter
  2018-02-11 23:10 ` Mikulas Patocka
@ 2018-02-12  3:37   ` David Miller
  -1 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2018-02-12  3:37 UTC (permalink / raw)
  To: mpatocka; +Cc: mw, rmk, linux-arm-kernel, netdev

From: Mikulas Patocka <mpatocka@redhat.com>
Date: Sun, 11 Feb 2018 18:10:28 -0500 (EST)

> 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>

Applied, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] mvpp2: fix multicast address filter
@ 2018-02-12  3:37   ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2018-02-12  3:37 UTC (permalink / raw)
  To: linux-arm-kernel

From: Mikulas Patocka <mpatocka@redhat.com>
Date: Sun, 11 Feb 2018 18:10:28 -0500 (EST)

> 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>

Applied, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-02-12  3:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-11 23:10 [PATCH] mvpp2: fix multicast address filter Mikulas Patocka
2018-02-11 23:10 ` Mikulas Patocka
2018-02-12  3:37 ` David Miller
2018-02-12  3:37   ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.