Skip to content

Commit 7ac8ff9

Browse files
Mikulas Patockadavem330
authored andcommitted
mvpp2: fix multicast address filter
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 <[email protected]> Cc: [email protected] Signed-off-by: David S. Miller <[email protected]>
1 parent 54e0216 commit 7ac8ff9

File tree

1 file changed

+8
-3
lines changed
  • drivers/net/ethernet/marvell

1 file changed

+8
-3
lines changed

drivers/net/ethernet/marvell/mvpp2.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7137,16 +7137,21 @@ static void mvpp2_set_rx_mode(struct net_device *dev)
71377137
int id = port->id;
71387138
bool allmulti = dev->flags & IFF_ALLMULTI;
71397139

7140+
retry:
71407141
mvpp2_prs_mac_promisc_set(priv, id, dev->flags & IFF_PROMISC);
71417142
mvpp2_prs_mac_multi_set(priv, id, MVPP2_PE_MAC_MC_ALL, allmulti);
71427143
mvpp2_prs_mac_multi_set(priv, id, MVPP2_PE_MAC_MC_IP6, allmulti);
71437144

71447145
/* Remove all port->id's mcast enries */
71457146
mvpp2_prs_mcast_del_all(priv, id);
71467147

7147-
if (allmulti && !netdev_mc_empty(dev)) {
7148-
netdev_for_each_mc_addr(ha, dev)
7149-
mvpp2_prs_mac_da_accept(priv, id, ha->addr, true);
7148+
if (!allmulti) {
7149+
netdev_for_each_mc_addr(ha, dev) {
7150+
if (mvpp2_prs_mac_da_accept(priv, id, ha->addr, true)) {
7151+
allmulti = true;
7152+
goto retry;
7153+
}
7154+
}
71507155
}
71517156
}
71527157

0 commit comments

Comments
 (0)