• Brett Creeley's avatar
    ice: Enable VSI Rx/Tx pruning only when VLAN 0 is active · 4f74dcc1
    Brett Creeley authored
    VLAN pruning is not valid when VLAN 0 is not active. If VLAN
    pruning is enabled and VLAN 0 is not active (8021q driver not loaded)
    then normal, non-VLAN, traffic will not pass.
    
    TX/RX VLAN pruning is enabled when the VLAN 0 is added to the
    active_vlan bitmap and it is disabled when VLAN 0 is removed from the
    active_vlan bitmap.
    
    So, only enable VLAN pruning when VLAN 0 is active. Setting RX VLAN
    pruning causes the switch to drop received VLAN packets when there
    are no matching VLAN ids in the associated VSI's switch filters. Setting
    TX pruning makes it so the switch will not send out any packets with
    VLAN tags that don't match the associated VSI's switch filters.
    
    With this patch, if the VF or PF tries to send a VLAN tagged packet with
    a VLAN tag that it does not have a pruning rule for it will trigger an
    MDD event. For example, if PF0 has VLAN10 and VLAN11 interfaces and
    scapy is used to send a packet with VLAN8 then the MDD is triggered.
    
    Also make ice_vsi_kill_vlan return a value which the caller can check
    before updating VLAN related data structures (counts, pruning bits, etc.).
    Signed-off-by: default avatarBrett Creeley <brett.creeley@intel.com>
    Signed-off-by: default avatarAnirudh Venkataramanan <anirudh.venkataramanan@intel.com>
    Tested-by: default avatarTony Brelinski <tonyx.brelinski@intel.com>
    Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
    4f74dcc1
ice_main.c 156 KB