diff options
author | 2017-10-23 19:51:04 +0800 | |
---|---|---|
committer | 2017-10-24 01:16:41 +0100 | |
commit | 709eb41ad8cd56ee68f9ca5140cfd46839d35837 (patch) | |
tree | 7e0ad86d89302606272d3875db13768c7210293b /drivers/net/ethernet/hisilicon | |
parent | net: hns3: fix the ops check in hns3_get_rxnfc (diff) | |
download | linux-709eb41ad8cd56ee68f9ca5140cfd46839d35837.tar.gz linux-709eb41ad8cd56ee68f9ca5140cfd46839d35837.tar.bz2 linux-709eb41ad8cd56ee68f9ca5140cfd46839d35837.zip |
net: hns3: get vf count by pci_sriov_get_totalvfs
This patch gets vf count by standard function pci_sriov_get_totalvfs,
instead of info from NIC HW.
Signed-off-by: Lipeng <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/hisilicon')
-rw-r--r-- | drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index 8508521c26e8..443124177f05 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -837,7 +837,6 @@ static int hclge_parse_func_status(struct hclge_dev *hdev, else hdev->flag &= ~HCLGE_FLAG_MAIN; - hdev->num_req_vfs = status->vf_num / status->pf_num; return 0; } @@ -4361,6 +4360,8 @@ static int hclge_pci_init(struct hclge_dev *hdev) goto err_clr_master; } + hdev->num_req_vfs = pci_sriov_get_totalvfs(pdev); + return 0; err_clr_master: pci_clear_master(pdev); |