diff options
author | Manish Chopra <manish.chopra@qlogic.com> | 2014-04-14 10:02:23 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-04-14 13:43:53 -0400 |
commit | 696f1943a1538bb448c5bf55a18793ad410da00b (patch) | |
tree | 83dca5a5591e1fdb07979f76e6394262dc7d3a97 | |
parent | 4f0302277718810494f8c618f28d1edb33af859a (diff) |
qlcnic: Do not disable SR-IOV when VFs are assigned to VMs
o While disabling SR-IOV when VFs are assigned to VMs causes host crash
so return -EPERM when user request to disable SR-IOV using pci sysfs in
case of VFs are assigned to VMs.
Signed-off-by: Manish Chopra <manish.chopra@qlogic.com>
Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c index 14f748cbf0de..280137991544 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c | |||
@@ -461,6 +461,16 @@ static int qlcnic_pci_sriov_disable(struct qlcnic_adapter *adapter) | |||
461 | { | 461 | { |
462 | struct net_device *netdev = adapter->netdev; | 462 | struct net_device *netdev = adapter->netdev; |
463 | 463 | ||
464 | if (pci_vfs_assigned(adapter->pdev)) { | ||
465 | netdev_err(adapter->netdev, | ||
466 | "SR-IOV VFs belonging to port %d are assigned to VMs. SR-IOV can not be disabled on this port\n", | ||
467 | adapter->portnum); | ||
468 | netdev_info(adapter->netdev, | ||
469 | "Please detach SR-IOV VFs belonging to port %d from VMs, and then try to disable SR-IOV on this port\n", | ||
470 | adapter->portnum); | ||
471 | return -EPERM; | ||
472 | } | ||
473 | |||
464 | rtnl_lock(); | 474 | rtnl_lock(); |
465 | if (netif_running(netdev)) | 475 | if (netif_running(netdev)) |
466 | __qlcnic_down(adapter, netdev); | 476 | __qlcnic_down(adapter, netdev); |