• Emil Tantilov's avatar
    ixgbe: set VLAN spoof checking unconditionally · d3dec7c7
    Emil Tantilov authored
    Previously the PF driver would only set VLAN spoof checking if
    the VF had created VLANs. This was done by setting and checking
    a counter (vlan_count) whenever a VLAN was created by the VF.
    However it is possible for the vlan_count to be !=0 while there are
    no VLANs assigned to the VF due to the count incrementing every
    time a VLAN 0 is added on ifdown/up, which resulted in VLAN spoofing
    always being set for those VFs.
    
    This patch cleans up the logic by unconditionally setting VLAN based on
    how the VF is configured (via ip link set ethX vf Y spoofchk on/off).
    This change also resolves an issue where the VLAN spoofing can remain
    set even after being disabled by the user due to the driver enabling
    VLAN spoof checking every time a VLAN is added to the VF, but would
    only allow changes in the setting if vlan_count != 0.
    
    Also default_vf_vlan_id and vlans_enabled were removed from the
    vf_data_storage structure since they are not being used in the driver.
    Signed-off-by: default avatarEmil Tantilov <emil.s.tantilov@intel.com>
    Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
    Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
    d3dec7c7
ixgbe_sriov.c 42.6 KB