net: hns3: fix error VF index when setting VLAN offload
authorJian Shen <shenjian15@huawei.com>
Thu, 5 Sep 2019 13:31:36 +0000 (21:31 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 6 Sep 2019 13:20:34 +0000 (15:20 +0200)
commitd9c0f2756a33833b2653f7a3612814fa5f52a568
tree7a181207d571f8b26bdc234f88a7e30e24b7a6ec
parentc3a502deaf1f0da95f6d08be6a13a6b835066603
net: hns3: fix error VF index when setting VLAN offload

In original codes, the VF index used incorrectly in function
hclge_set_vlan_rx_offload_cfg() and hclge_set_vlan_rx_offload_cfg().
When VF id is greater than 8, for example 9, it will set the
same bit with VF id 1.

This patch fixes it by using  vport->vport_id % HCLGE_VF_NUM_PER_CMD /
HCLGE_VF_NUM_PER_BYTE as the array index, instead of vport->vport_id /
HCLGE_VF_NUM_PER_CMD.

Fixes: 052ece6dc19c ("net: hns3: add ethtool related offload command")
Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c