Skip to content

Commit 148cbab

Browse files
ecree-solarflaredavem330
authored andcommitted
sfc: don't insert mc_list on low-latency firmware if it's too long
If the mc_list is longer than 256 addresses, we enter mc_promisc mode. If we're in mc_promisc mode and the firmware doesn't support cascaded multicast, normally we also insert our mc_list, to prevent stealing by another VI. However, if the mc_list was too long, this isn't really helpful - the MC groups that didn't fit in the list can still get stolen, and having only some of them stealable will probably cause more confusing behaviour than having them all stealable. Since inserting 256 multicast filters takes a long time and can lead to MCDI state machine timeouts, just skip the mc_list insert in this overflow condition. Signed-off-by: Edward Cree <ecree@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent a4b7c07 commit 148cbab

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

  • drivers/net/ethernet/sfc

‎drivers/net/ethernet/sfc/ef10.c‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ struct efx_ef10_filter_table {
119119
bool mc_promisc;
120120
/* Whether in multicast promiscuous mode when last changed */
121121
bool mc_promisc_last;
122+
bool mc_overflow; /* Too many MC addrs; should always imply mc_promisc */
122123
bool vlan_filter;
123124
struct list_head vlan_list;
124125
};
@@ -5058,13 +5059,15 @@ static void efx_ef10_filter_mc_addr_list(struct efx_nic *efx)
50585059
struct netdev_hw_addr *mc;
50595060
unsigned int i, addr_count;
50605061

5062+
table->mc_overflow = false;
50615063
table->mc_promisc = !!(net_dev->flags & (IFF_PROMISC | IFF_ALLMULTI));
50625064

50635065
addr_count = netdev_mc_count(net_dev);
50645066
i = 0;
50655067
netdev_for_each_mc_addr(mc, net_dev) {
50665068
if (i >= EFX_EF10_FILTER_DEV_MC_MAX) {
50675069
table->mc_promisc = true;
5070+
table->mc_overflow = true;
50685071
break;
50695072
}
50705073
ether_addr_copy(table->dev_mc_list[i].addr, mc->addr);
@@ -5469,12 +5472,15 @@ static void efx_ef10_filter_vlan_sync_rx_mode(struct efx_nic *efx,
54695472
}
54705473
} else {
54715474
/* If we failed to insert promiscuous filters, don't
5472-
* rollback. Regardless, also insert the mc_list
5475+
* rollback. Regardless, also insert the mc_list,
5476+
* unless it's incomplete due to overflow
54735477
*/
54745478
efx_ef10_filter_insert_def(efx, vlan,
54755479
EFX_ENCAP_TYPE_NONE,
54765480
true, false);
5477-
efx_ef10_filter_insert_addr_list(efx, vlan, true, false);
5481+
if (!table->mc_overflow)
5482+
efx_ef10_filter_insert_addr_list(efx, vlan,
5483+
true, false);
54785484
}
54795485
} else {
54805486
/* If any filters failed to insert, rollback and fall back to

0 commit comments

Comments
 (0)