Commit 696f1943 authored by Manish Chopra's avatar Manish Chopra Committed by David S. Miller

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: default avatarManish Chopra <manish.chopra@qlogic.com>
Signed-off-by: default avatarShahed Shaikh <shahed.shaikh@qlogic.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4f030227
...@@ -461,6 +461,16 @@ static int qlcnic_pci_sriov_disable(struct qlcnic_adapter *adapter) ...@@ -461,6 +461,16 @@ static int qlcnic_pci_sriov_disable(struct qlcnic_adapter *adapter)
{ {
struct net_device *netdev = adapter->netdev; struct net_device *netdev = adapter->netdev;
if (pci_vfs_assigned(adapter->pdev)) {
netdev_err(adapter->netdev,
"SR-IOV VFs belonging to port %d are assigned to VMs. SR-IOV can not be disabled on this port\n",
adapter->portnum);
netdev_info(adapter->netdev,
"Please detach SR-IOV VFs belonging to port %d from VMs, and then try to disable SR-IOV on this port\n",
adapter->portnum);
return -EPERM;
}
rtnl_lock(); rtnl_lock();
if (netif_running(netdev)) if (netif_running(netdev))
__qlcnic_down(adapter, netdev); __qlcnic_down(adapter, netdev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment