On Sun, 28 May 2017 14:49:58 +, Mintz, Yuval wrote:
> > pf->limit_vfs = nfp_rtsym_read_le(pf->cpp, "nfd_vf_cfg_max_vfs",
> > &err);
> > if (!err)
> > - return;
> > + return pci_sriov_set_totalvfs(pf->pdev, pf->limit_vfs);
>
> While you're at it, If you're going to
> pf->limit_vfs = nfp_rtsym_read_le(pf->cpp, "nfd_vf_cfg_max_vfs",
> &err);
> if (!err)
> - return;
> + return pci_sriov_set_totalvfs(pf->pdev, pf->limit_vfs);
While you're at it, If you're going to enforce the limit at the PCI level,
shouldn't you retire 'limit
PCI subsystem has support for drivers limiting the number of VFs
available below what the IOV capability claims. Make use of it.
While at it remove the #ifdef/#endif on CONFIG_PCI_IOV, it was
there to avoid unnecessary warnings in case device read failed
but kernel doesn't have SR-IOV support any