OSDN Git Service
(root)
/
sagit-ice-cold
/
kernel_xiaomi_msm8998.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f00bf23
)
sfc: do not allow VFs to be destroyed if assigned to guests
author
Daniel Pieczko
<dpieczko@solarflare.com>
Tue, 2 Jun 2015 10:40:31 +0000
(11:40 +0100)
committer
David S. Miller
<davem@davemloft.net>
Tue, 2 Jun 2015 19:57:31 +0000
(12:57 -0700)
Signed-off-by: Shradha Shah <sshah@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/sfc/ef10_sriov.c
patch
|
blob
|
history
diff --git
a/drivers/net/ethernet/sfc/ef10_sriov.c
b/drivers/net/ethernet/sfc/ef10_sriov.c
index
cd52454
..
083c534
100644
(file)
--- a/
drivers/net/ethernet/sfc/ef10_sriov.c
+++ b/
drivers/net/ethernet/sfc/ef10_sriov.c
@@
-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;