diff options
author | Jakub Kicinski <jakub.kicinski@netronome.com> | 2018-06-29 16:09:00 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2018-06-29 16:09:00 -0400 |
commit | 83235822b8b4fe47ecbd6b6bcbcc902860ac00fc (patch) | |
tree | 19b9db3e4ace53c54a0fbfea6c27dc9dc1248273 | |
parent | 38972375ef7bdc7dd989bcb48d5448662a95bca2 (diff) |
nfp: stop limiting VFs to 0
Before 8d85a7a4f2c9 ("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 8d85a7a4f2c9, 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 8d85a7a4f2c9, 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: 8d85a7a4f2c9 ("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>
-rw-r--r-- | drivers/net/ethernet/netronome/nfp/nfp_main.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_main.c b/drivers/net/ethernet/netronome/nfp/nfp_main.c index 46b76d5a726c..152283d7e59c 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_main.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_main.c | |||
@@ -240,7 +240,6 @@ static int nfp_pcie_sriov_read_nfd_limit(struct nfp_pf *pf) | |||
240 | return pci_sriov_set_totalvfs(pf->pdev, pf->limit_vfs); | 240 | return pci_sriov_set_totalvfs(pf->pdev, pf->limit_vfs); |
241 | 241 | ||
242 | pf->limit_vfs = ~0; | 242 | pf->limit_vfs = ~0; |
243 | pci_sriov_set_totalvfs(pf->pdev, 0); /* 0 is unset */ | ||
244 | /* Allow any setting for backwards compatibility if symbol not found */ | 243 | /* Allow any setting for backwards compatibility if symbol not found */ |
245 | if (err == -ENOENT) | 244 | if (err == -ENOENT) |
246 | return 0; | 245 | return 0; |
@@ -668,7 +667,7 @@ static int nfp_pci_probe(struct pci_dev *pdev, | |||
668 | 667 | ||
669 | err = nfp_net_pci_probe(pf); | 668 | err = nfp_net_pci_probe(pf); |
670 | if (err) | 669 | if (err) |
671 | goto err_sriov_unlimit; | 670 | goto err_fw_unload; |
672 | 671 | ||
673 | err = nfp_hwmon_register(pf); | 672 | err = nfp_hwmon_register(pf); |
674 | if (err) { | 673 | if (err) { |
@@ -680,8 +679,6 @@ static int nfp_pci_probe(struct pci_dev *pdev, | |||
680 | 679 | ||
681 | err_net_remove: | 680 | err_net_remove: |
682 | nfp_net_pci_remove(pf); | 681 | nfp_net_pci_remove(pf); |
683 | err_sriov_unlimit: | ||
684 | pci_sriov_set_totalvfs(pf->pdev, 0); | ||
685 | err_fw_unload: | 682 | err_fw_unload: |
686 | kfree(pf->rtbl); | 683 | kfree(pf->rtbl); |
687 | nfp_mip_close(pf->mip); | 684 | nfp_mip_close(pf->mip); |
@@ -715,7 +712,6 @@ static void nfp_pci_remove(struct pci_dev *pdev) | |||
715 | nfp_hwmon_unregister(pf); | 712 | nfp_hwmon_unregister(pf); |
716 | 713 | ||
717 | nfp_pcie_sriov_disable(pdev); | 714 | nfp_pcie_sriov_disable(pdev); |
718 | pci_sriov_set_totalvfs(pf->pdev, 0); | ||
719 | 715 | ||
720 | nfp_net_pci_remove(pf); | 716 | nfp_net_pci_remove(pf); |
721 | 717 | ||