i40e: Prevent falling to promiscuous if the VF is not trusted
authorAnjali Singhai Jain <anjali.singhai@intel.com>
Wed, 13 Apr 2016 10:08:23 +0000 (03:08 -0700)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Mon, 2 May 2016 00:03:37 +0000 (17:03 -0700)
With this change a non trusted VF can never fall to promiscuous
mode when there is no room for a MAC/VLAN filter.

Change-Id: I8a155aa25c0bcdc6093414920c9ade4ee0bd20e8
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40e/i40e_main.c

index 39b3b56d3a9fbe30835b2b4dec210fbdc5e3b60a..a45748e52ef631aa70caea40b2b5ed1635d9e720 100644 (file)
@@ -2098,6 +2098,12 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)
                }
        }
 
+       /* if the VF is not trusted do not do promisc */
+       if ((vsi->type == I40E_VSI_SRIOV) && !pf->vf[vsi->vf_id].trusted) {
+               clear_bit(__I40E_FILTER_OVERFLOW_PROMISC, &vsi->state);
+               goto out;
+       }
+
        /* check for changes in promiscuous modes */
        if (changed_flags & IFF_ALLMULTI) {
                bool cur_multipromisc;