• Jacob Keller's avatar
    i40e: move all updates for VLAN mode into i40e_sync_vsi_filters · 489a3265
    Jacob Keller authored
    In a similar fashion to how we handled exiting VLAN mode, move the logic
    in i40e_vsi_add_vlan into i40e_sync_vsi_filters. Extract this logic into
    its own function for ease of understanding as it will become quite
    complex.
    
    The new function, i40e_correct_mac_vlan_filters() correctly updates all
    filters for when we need to enter VLAN mode, exit VLAN mode, and also
    enforces the PVID when assigned.
    
    Call i40e_correct_mac_vlan_filters from i40e_sync_vsi_filters passing it
    the number of active VLAN filters, and the two temporary lists.
    
    Remove the function for updating VLAN=0 filters from i40e_vsi_add_vlan.
    
    The end result is that the logic for entering and exiting VLAN mode is
    in one location which has the most knowledge about all filters. This
    ensures that we always correctly have the non-VLAN filters assigned to
    VID=0 or VID=-1 regardless of how we ended up getting to this result.
    
    Additionally this enforces the PVID at sync time so that we know for
    certain that an assigned PVID results in only filters with that PVID
    will be added to the firmware.
    
    Change-ID: I895cee81e9c92d0a16baee38bd0ca51bbb14e372
    Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
    Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
    Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
    489a3265
i40e_main.c 326 KB