net: ll_temac: Cleanup multicast filter on change
authorEsben Haabendal <esben@geanix.com>
Thu, 23 May 2019 12:02:21 +0000 (14:02 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 23 May 2019 16:33:57 +0000 (09:33 -0700)
Avoid leaving old address table entries when using multicast.  If more than
one multicast address were removed, only the first removed address would
actually be cleared.

Signed-off-by: Esben Haabendal <esben@geanix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/xilinx/ll_temac_main.c

index cc58bd8..ef13fa9 100644 (file)
@@ -485,10 +485,13 @@ static void temac_set_multicast_list(struct net_device *ndev)
                                                    multi_addr_lsw);
                        i++;
                }
-       } else {
+       }
+
+       /* Clear all or remaining/unused address table entries */
+       while (i < MULTICAST_CAM_TABLE_NUM) {
                temac_indirect_out32_locked(lp, XTE_MAW0_OFFSET, 0);
                temac_indirect_out32_locked(lp, XTE_MAW1_OFFSET, i << 16);
-               }
+               i++;
        }
 
        /* Enable address filter block if currently disabled */