diff mbox series

Avoid interruption of multicast reception if mc list changes

Message ID 3ddae983-f22c-f789-0195-3606e876eb6a@astro-kom.de
State Changes Requested, archived
Delegated to: David Miller
Headers show
Series Avoid interruption of multicast reception if mc list changes | expand

Commit Message

Stephan Mondwurf March 20, 2018, 10:28 a.m. UTC
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 <s.mondwurf@astro-kom.de>
---
  drivers/net/ethernet/altera/altera_tse_main.c | 11 ++++++-----
  1 file changed, 6 insertions(+), 5 deletions(-)

  		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);
  }
diff mbox series

Patch

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