Skip to content

Commit

Permalink
net/hinic: increase protection of the VLAN
Browse files Browse the repository at this point in the history
[ upstream commit 2cfd68e ]

If the VLAN id 0 is deleted for hinic, all packets without
VLAN will be discarded when the VLAN filter is turned on.

Fixes: 50ce3e7 ("ethdev: fix VLAN offloads set if no relative capabilities")

Signed-off-by: Guoyang Zhou <zhouguoyang@huawei.com>
  • Loading branch information
Guoyang Zhou authored and bluca committed Jul 26, 2021
1 parent 4e210bb commit 2ca9d75
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/hinic/hinic_pmd_ethdev.c
Expand Up @@ -1617,6 +1617,9 @@ static int hinic_vlan_filter_set(struct rte_eth_dev *dev,
if (vlan_id > RTE_ETHER_MAX_VLAN_ID)
return -EINVAL;

if (vlan_id == 0)
return 0;

func_id = hinic_global_func_id(nic_dev->hwdev);

if (enable) {
Expand Down

0 comments on commit 2ca9d75

Please sign in to comment.