[PATCH] Avoid interruption of multicast reception if mc list changes

DORMANTno replies

From: Stephan Mondwurf <hidden>
Date: 2018-03-20 10:33:33
Subsystem: altera triple speed ethernet driver, networking drivers, the rest · Maintainers: Boon Khai Ng, Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

The Altera TSE driver clears the multicast hash table before reapplying the
correct values. This results in an interruption of multicast reception on
any change of the mc addr list.

This patch recalculates the multicast hash table before applying it to the
hardware.

Signed-off-by: Stephan Mondwurf <redacted>
---
 drivers/net/ethernet/altera/altera_tse_main.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/altera/altera_tse_main.c b/drivers/net/ethernet/altera/altera_tse_main.c
index 241d27b..ec4bb7b 100644
--- a/drivers/net/ethernet/altera/altera_tse_main.c
+++ b/drivers/net/ethernet/altera/altera_tse_main.c
@@ -1022,10 +1022,7 @@ static void altera_tse_set_mcfilter(struct net_device *dev)
 	struct altera_tse_private *priv = netdev_priv(dev);
 	int i;
 	struct netdev_hw_addr *ha;
-
-	/* clear the hash filter */
-	for (i = 0; i < 64; i++)
-		csrwr32(0, priv->mac_dev, tse_csroffs(hash_table) + i * 4);
+	u32 ht[64] = { 0 };

 	netdev_for_each_mc_addr(ha, dev) {
 		unsigned int hash = 0;
@@ -1041,8 +1038,12 @@ static void altera_tse_set_mcfilter(struct net_device *dev)

 			hash = (hash << 1) | xor_bit;
 		}
-		csrwr32(1, priv->mac_dev, tse_csroffs(hash_table) + hash * 4);
+		ht[hash] = 1;
 	}
+
+	/* write the hash filter table */
+	for (i = 0; i < 64; i++)
+		csrwr32(ht[i], priv->mac_dev, tse_csroffs(hash_table) + i * 4);
 }

-- 
1.9.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help