mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 08:43:31 +00:00
ice: clean up freeing SR-IOV VFs
The check for existing VFs was redundant since very
inception of SR-IOV sysfs interface in the kernel,
see commit 1789382a72
("PCI: SRIOV control and status via sysfs").
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Tested-by: Rafal Romanowski <rafal.romanowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
This commit is contained in:
parent
469748429a
commit
f98277479a
1 changed files with 2 additions and 3 deletions
|
@ -905,14 +905,13 @@ err_unroll_intr:
|
|||
*/
|
||||
static int ice_pci_sriov_ena(struct ice_pf *pf, int num_vfs)
|
||||
{
|
||||
int pre_existing_vfs = pci_num_vf(pf->pdev);
|
||||
struct device *dev = ice_pf_to_dev(pf);
|
||||
int err;
|
||||
|
||||
if (pre_existing_vfs && pre_existing_vfs != num_vfs)
|
||||
if (!num_vfs) {
|
||||
ice_free_vfs(pf);
|
||||
else if (pre_existing_vfs && pre_existing_vfs == num_vfs)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (num_vfs > pf->vfs.num_supported) {
|
||||
dev_err(dev, "Can't enable %d VFs, max VFs supported is %d\n",
|
||||
|
|
Loading…
Add table
Reference in a new issue