Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 71158bf2 authored by Daniel Pieczko's avatar Daniel Pieczko Committed by David S. Miller
Browse files

sfc: do not allow VFs to be destroyed if assigned to guests

parent f00bf230
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -417,6 +417,15 @@ static int efx_ef10_pci_sriov_disable(struct efx_nic *efx)
{
	struct pci_dev *dev = efx->pci_dev;

	if (!efx->vf_count)
		return 0;

	if (pci_vfs_assigned(dev)) {
		netif_err(efx, drv, efx->net_dev, "VFs are assigned to guests; "
			  "please detach them before disabling SR-IOV\n");
		return -EBUSY;
	}

	pci_disable_sriov(dev);
	efx_ef10_sriov_free_vf_vswitching(efx);
	efx->vf_count = 0;