]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
net: hns3: Fix error of checking used vlan id
authorJian Shen <shenjian15@huawei.com>
Mon, 3 Sep 2018 10:21:48 +0000 (11:21 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 4 Sep 2018 05:04:45 +0000 (22:04 -0700)
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: 6c251711b37f ("net: hns3: Disable vf vlan filter when vf vlan table is full")
Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c

index 8f1339a9a6bb2d8a664f0ffd424d8f8ded166ae8..3cf8b809ac718da5e7921af7b7756c5c199344a2 100644 (file)
@@ -4769,7 +4769,7 @@ static int hclge_set_vlan_filter_hw(struct hclge_dev *hdev, __be16 proto,
                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++;
 
        if ((is_kill && vport_num == 0) || (!is_kill && vport_num == 1))