Commit d01caf35 authored by Jian Shen's avatar Jian Shen Committed by Greg Kroah-Hartman

net: hns3: Fix error of checking used vlan id

[ Upstream commit 54e97d11 ]

PF uses hdev->vlan_table to manage the port vlan table. In function
hclge_set_vlan_filter_hw(), it checks whether a vlan id has been used,
by foreach all the vport bits. It should use macro HCLGE_VPORT_NUM,
not VLAN_N_VID as the foreach condition.

Fixes: 6c251711 ("net: hns3: Disable vf vlan filter when vf vlan table is full")
Signed-off-by: default avatarJian Shen <shenjian15@huawei.com>
Signed-off-by: default avatarPeng Li <lipeng321@huawei.com>
Signed-off-by: default avatarSalil Mehta <salil.mehta@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 4aea8f76
...@@ -4784,7 +4784,7 @@ static int hclge_set_vlan_filter_hw(struct hclge_dev *hdev, __be16 proto, ...@@ -4784,7 +4784,7 @@ static int hclge_set_vlan_filter_hw(struct hclge_dev *hdev, __be16 proto,
return -EINVAL; return -EINVAL;
} }
for_each_set_bit(vport_idx, hdev->vlan_table[vlan_id], VLAN_N_VID) for_each_set_bit(vport_idx, hdev->vlan_table[vlan_id], HCLGE_VPORT_NUM)
vport_num++; vport_num++;
if ((is_kill && vport_num == 0) || (!is_kill && vport_num == 1)) if ((is_kill && vport_num == 0) || (!is_kill && vport_num == 1))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment