Skip to content

Commit 7363115

Browse files
atbrady-intelJeff Kirsher
authored andcommitted
i40e: do not force filter failure in overflow promiscuous
Broadcast filters can now cause overflow promiscuous to trigger when adding "too many" VLANs to all the ports of a device and the driver needs a way to exit overflow promiscuous once triggered. Currently the driver looks to see if there are "too many" filters and/or we have any failed filters to determine when it is safe to exit overflow promiscuous. If we trigger overflow promiscuous with broadcast filters, any new filters added will be "auto-failed" until we exit overflow promiscuous. Since the user can't manually remove the failed broadcast filters for VLANs (nor should we expect the user to do such), there is no way to exit overflow promiscuous without reloading the driver. The easiest way to do this is to remove the shortcut to "auto-fail" filters in overflow promiscuous. If the user removes the VLANs, the failed filters will be removed and since we're no longer "auto-failing" new filters, we'll eventually get a good set of filters and exit overflow promiscuous. This has the side benefit of making filter state more explicit in that if a filter says it's failed we know for a fact it failed and not just assuming it will if we're in overflow promiscuous. This is nice because if the user removes some filters and then adds some, even if we're in overflow promiscuous, the filter might succeed; we were just assuming it won't because the user hasn't rectified other existing failed filters. Signed-off-by: Alan Brady <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent cc6a96a commit 7363115

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

drivers/net/ethernet/intel/i40e/i40e_main.c

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1380,14 +1380,7 @@ struct i40e_mac_filter *i40e_add_filter(struct i40e_vsi *vsi,
13801380

13811381
ether_addr_copy(f->macaddr, macaddr);
13821382
f->vlan = vlan;
1383-
/* If we're in overflow promisc mode, set the state directly
1384-
* to failed, so we don't bother to try sending the filter
1385-
* to the hardware.
1386-
*/
1387-
if (test_bit(__I40E_VSI_OVERFLOW_PROMISC, vsi->state))
1388-
f->state = I40E_FILTER_FAILED;
1389-
else
1390-
f->state = I40E_FILTER_NEW;
1383+
f->state = I40E_FILTER_NEW;
13911384
INIT_HLIST_NODE(&f->hlist);
13921385

13931386
key = i40e_addr_to_hkey(macaddr);
@@ -2425,12 +2418,6 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)
24252418

24262419
num_add = 0;
24272420
hlist_for_each_entry_safe(new, h, &tmp_add_list, hlist) {
2428-
if (test_bit(__I40E_VSI_OVERFLOW_PROMISC,
2429-
vsi->state)) {
2430-
new->state = I40E_FILTER_FAILED;
2431-
continue;
2432-
}
2433-
24342421
/* handle broadcast filters by updating the broadcast
24352422
* promiscuous flag instead of adding a MAC filter.
24362423
*/

0 commit comments

Comments
 (0)