• Jian Shen's avatar
    net: hns3: fix VLAN offload handle for VLAN inserted by port · 44e626f7
    Jian Shen authored
    Currently, in TX direction, driver implements the TX VLAN offload
    by checking the VLAN header in skb, and filling it into TX descriptor.
    Usually it works well, but if enable inserting VLAN header based on
    port, it may conflict when out_tag field of TX descriptor is already
    used, and cause RAS error.
    
    In RX direction, hardware supports stripping max two VLAN headers.
    For vlan_tci in skb can only store one VLAN tag, when RX VLAN offload
    enabled, driver tells hardware to strip one VLAN header from RX
    packet; when RX VLAN offload disabled, driver tells hardware not to
    strip VLAN header from RX packet. Now if port based insert VLAN
    enabled, all RX packets will have the port based VLAN header. This
    header is useless for stack, driver needs to ask hardware to strip
    it. Unfortunately, hardware can't drop this VLAN header, and always
    fill it into RX descriptor, so driver has to identify and drop it.
    Signed-off-by: default avatarJian Shen <shenjian15@huawei.com>
    Signed-off-by: default avatarHuazhong Tan <tanhuazhong@huawei.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    44e626f7
hclge_main.c 218 KB