mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-11 23:50:25 +00:00
qlcnic: Fix SR-IOV configuration
o Interface needs to be brought down and up while configuring SR-IOV. Protect interface up/down using rtnl_lock()/rtnl_unlock() Signed-off-by: Manish Chopra <manish.chopra@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
7167cf0e8c
commit
1ed98ed55d
@ -397,6 +397,7 @@ static int qlcnic_pci_sriov_disable(struct qlcnic_adapter *adapter)
|
|||||||
{
|
{
|
||||||
struct net_device *netdev = adapter->netdev;
|
struct net_device *netdev = adapter->netdev;
|
||||||
|
|
||||||
|
rtnl_lock();
|
||||||
if (netif_running(netdev))
|
if (netif_running(netdev))
|
||||||
__qlcnic_down(adapter, netdev);
|
__qlcnic_down(adapter, netdev);
|
||||||
|
|
||||||
@ -407,12 +408,15 @@ static int qlcnic_pci_sriov_disable(struct qlcnic_adapter *adapter)
|
|||||||
/* After disabling SRIOV re-init the driver in default mode
|
/* After disabling SRIOV re-init the driver in default mode
|
||||||
configure opmode based on op_mode of function
|
configure opmode based on op_mode of function
|
||||||
*/
|
*/
|
||||||
if (qlcnic_83xx_configure_opmode(adapter))
|
if (qlcnic_83xx_configure_opmode(adapter)) {
|
||||||
|
rtnl_unlock();
|
||||||
return -EIO;
|
return -EIO;
|
||||||
|
}
|
||||||
|
|
||||||
if (netif_running(netdev))
|
if (netif_running(netdev))
|
||||||
__qlcnic_up(adapter, netdev);
|
__qlcnic_up(adapter, netdev);
|
||||||
|
|
||||||
|
rtnl_unlock();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -533,6 +537,7 @@ static int qlcnic_pci_sriov_enable(struct qlcnic_adapter *adapter, int num_vfs)
|
|||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rtnl_lock();
|
||||||
if (netif_running(netdev))
|
if (netif_running(netdev))
|
||||||
__qlcnic_down(adapter, netdev);
|
__qlcnic_down(adapter, netdev);
|
||||||
|
|
||||||
@ -555,6 +560,7 @@ static int qlcnic_pci_sriov_enable(struct qlcnic_adapter *adapter, int num_vfs)
|
|||||||
__qlcnic_up(adapter, netdev);
|
__qlcnic_up(adapter, netdev);
|
||||||
|
|
||||||
error:
|
error:
|
||||||
|
rtnl_unlock();
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user