Skip to content

Commit 709eb41

Browse files
321lipengdavem330
authored andcommitted
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 7410343 commit 709eb41

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -837,7 +837,6 @@ static int hclge_parse_func_status(struct hclge_dev *hdev,
837837
else
838838
hdev->flag &= ~HCLGE_FLAG_MAIN;
839839

840-
hdev->num_req_vfs = status->vf_num / status->pf_num;
841840
return 0;
842841
}
843842

@@ -4361,6 +4360,8 @@ static int hclge_pci_init(struct hclge_dev *hdev)
43614360
goto err_clr_master;
43624361
}
43634362

4363+
hdev->num_req_vfs = pci_sriov_get_totalvfs(pdev);
4364+
43644365
return 0;
43654366
err_clr_master:
43664367
pci_clear_master(pdev);

0 commit comments

Comments
 (0)