ice: Use the right function to enable/disable VSI
The ice_ena/dis_vsi should have a single differentiating factor to determine if the netdev_ops call is used or a direct call to ice_vsi_open/close. This is if the netif is running or not. If netif is running, use ndo_open/ndo_close. Else, use ice_vsi_open/ice_vsi_close. Signed-off-by: Dave Ertman <david.m.ertman@intel.com> Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
This commit is contained in:
committed by
Jeff Kirsher
parent
d2b464a7ff
commit
124cd54796
@@ -3214,14 +3214,15 @@ static void ice_dis_vsi(struct ice_vsi *vsi)
|
|||||||
|
|
||||||
set_bit(__ICE_NEEDS_RESTART, vsi->state);
|
set_bit(__ICE_NEEDS_RESTART, vsi->state);
|
||||||
|
|
||||||
if (vsi->netdev && netif_running(vsi->netdev) &&
|
if (vsi->type == ICE_VSI_PF && vsi->netdev) {
|
||||||
vsi->type == ICE_VSI_PF) {
|
if (netif_running(vsi->netdev)) {
|
||||||
rtnl_lock();
|
rtnl_lock();
|
||||||
vsi->netdev->netdev_ops->ndo_stop(vsi->netdev);
|
vsi->netdev->netdev_ops->ndo_stop(vsi->netdev);
|
||||||
rtnl_unlock();
|
rtnl_unlock();
|
||||||
} else {
|
} else {
|
||||||
ice_vsi_close(vsi);
|
ice_vsi_close(vsi);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -3232,11 +3233,15 @@ static int ice_ena_vsi(struct ice_vsi *vsi)
|
|||||||
{
|
{
|
||||||
int err = 0;
|
int err = 0;
|
||||||
|
|
||||||
if (test_and_clear_bit(__ICE_NEEDS_RESTART, vsi->state))
|
if (test_and_clear_bit(__ICE_NEEDS_RESTART, vsi->state) &&
|
||||||
if (vsi->netdev && netif_running(vsi->netdev)) {
|
vsi->netdev) {
|
||||||
|
if (netif_running(vsi->netdev)) {
|
||||||
rtnl_lock();
|
rtnl_lock();
|
||||||
err = vsi->netdev->netdev_ops->ndo_open(vsi->netdev);
|
err = vsi->netdev->netdev_ops->ndo_open(vsi->netdev);
|
||||||
rtnl_unlock();
|
rtnl_unlock();
|
||||||
|
} else {
|
||||||
|
err = ice_vsi_open(vsi);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
|
|||||||
Reference in New Issue
Block a user