• Alan Brady's avatar
    i40e: fix MAC filters when removing VLANs · 84f5ca6c
    Alan Brady authored
    Currently there exists a bug where adding at least one VLAN and then
    removing all VLANs leaves the mac filters for the VSI with an incorrect
    value for 'vid' which indicates the mac filter's VLAN status.
    
    The current implementation for handling the removal of VLANs is wrong
    for a couple reasons. The first is that when i40e_vsi_kill_vlan
    iterates through the MAC filters, it fails to account for the MAC filter
    status; i.e. it's not accommodating for filters that are about to be
    deleted. The second problem is that MAC filters can be deleted in other
    places (specifically i40e_set_rx_mode). Thus if it occurs that all the
    VLAN MAC filters get deleted we need to switch out of VLAN mode, but the
    code path through i40e_vsi_kill_vlan has already been executed and we're
    now stuck in VLAN mode.
    
    This patch fixes the issue by removing the check from i40e_vsi_kill_vlan
    and puts the check instead in i40e_sync_vsi_filters where we're
    guaranteed to see all filter deletions and can properly detect when we
    need to switch out of VLAN mode.
    
    Change-ID: Ib38fe6034b356eee9a0e20b8a9eeed5ff2debcd9
    Signed-off-by: default avatarAlan Brady <alan.brady@intel.com>
    Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
    Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
    84f5ca6c
i40e_main.c 318 KB