Skip to content

Commit 8323582

Browse files
Jakub Kicinskibjorn-helgaas
authored andcommitted
nfp: stop limiting VFs to 0
Before 8d85a7a ("PCI/IOV: Allow PF drivers to limit total_VFs to 0"), pci_sriov_set_totalvfs(pdev, 0) meant "we can enable TotalVFs virtual functions". After 8d85a7a, it means "we can't enable *any* VFs". That broke this scenario where nfp intends to remove any limit on the number of VFs that can be enabled: nfp_pci_probe nfp_pcie_sriov_read_nfd_limit nfp_rtsym_read_le("nfd_vf_cfg_max_vfs", &err) pci_sriov_set_totalvfs(pf->pdev, 0) # if FW didn't expose a limit ... # userspace writes N to sysfs "sriov_numvfs": sriov_numvfs_store pci_sriov_get_totalvfs # now returns 0 return -ERANGE Prior to 8d85a7a, pci_sriov_get_totalvfs() returned TotalVFs, but it now returns 0. Remove the pci_sriov_set_totalvfs(pdev, 0) calls so we don't limit the number of VFs that can be enabled. Fixes: 8d85a7a ("PCI/IOV: Allow PF drivers to limit total_VFs to 0") Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> [bhelgaas: changelog] Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
1 parent 3897237 commit 8323582

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

‎drivers/net/ethernet/netronome/nfp/nfp_main.c‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,6 @@ static int nfp_pcie_sriov_read_nfd_limit(struct nfp_pf *pf)
240240
return pci_sriov_set_totalvfs(pf->pdev, pf->limit_vfs);
241241

242242
pf->limit_vfs = ~0;
243-
pci_sriov_set_totalvfs(pf->pdev, 0); /* 0 is unset */
244243
/* Allow any setting for backwards compatibility if symbol not found */
245244
if (err == -ENOENT)
246245
return 0;
@@ -668,7 +667,7 @@ static int nfp_pci_probe(struct pci_dev *pdev,
668667

669668
err = nfp_net_pci_probe(pf);
670669
if (err)
671-
goto err_sriov_unlimit;
670+
goto err_fw_unload;
672671

673672
err = nfp_hwmon_register(pf);
674673
if (err) {
@@ -680,8 +679,6 @@ static int nfp_pci_probe(struct pci_dev *pdev,
680679

681680
err_net_remove:
682681
nfp_net_pci_remove(pf);
683-
err_sriov_unlimit:
684-
pci_sriov_set_totalvfs(pf->pdev, 0);
685682
err_fw_unload:
686683
kfree(pf->rtbl);
687684
nfp_mip_close(pf->mip);
@@ -715,7 +712,6 @@ static void nfp_pci_remove(struct pci_dev *pdev)
715712
nfp_hwmon_unregister(pf);
716713

717714
nfp_pcie_sriov_disable(pdev);
718-
pci_sriov_set_totalvfs(pf->pdev, 0);
719715

720716
nfp_net_pci_remove(pf);
721717

0 commit comments

Comments
 (0)