Commit c988ee82 authored by Emil Tantilov's avatar Emil Tantilov Committed by Jeff Kirsher

ixgbe: move reset code into a separate function

Move reset code into a separate function to allow for reuse in other
parts of the code.
Signed-off-by: default avatarEmil Tantilov <emil.s.tantilov@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 3a289264
...@@ -442,6 +442,16 @@ static int ixgbe_set_pauseparam(struct net_device *netdev, ...@@ -442,6 +442,16 @@ static int ixgbe_set_pauseparam(struct net_device *netdev,
return 0; return 0;
} }
static void ixgbe_do_reset(struct net_device *netdev)
{
struct ixgbe_adapter *adapter = netdev_priv(netdev);
if (netif_running(netdev))
ixgbe_reinit_locked(adapter);
else
ixgbe_reset(adapter);
}
static u32 ixgbe_get_rx_csum(struct net_device *netdev) static u32 ixgbe_get_rx_csum(struct net_device *netdev)
{ {
struct ixgbe_adapter *adapter = netdev_priv(netdev); struct ixgbe_adapter *adapter = netdev_priv(netdev);
...@@ -2249,12 +2259,8 @@ static int ixgbe_set_coalesce(struct net_device *netdev, ...@@ -2249,12 +2259,8 @@ static int ixgbe_set_coalesce(struct net_device *netdev,
* correctly w.r.t stopping tx, and changing TXDCTL.WTHRESH settings * correctly w.r.t stopping tx, and changing TXDCTL.WTHRESH settings
* also locks in RSC enable/disable which requires reset * also locks in RSC enable/disable which requires reset
*/ */
if (need_reset) { if (need_reset)
if (netif_running(netdev)) ixgbe_do_reset(netdev);
ixgbe_reinit_locked(adapter);
else
ixgbe_reset(adapter);
}
return 0; return 0;
} }
...@@ -2328,12 +2334,8 @@ static int ixgbe_set_flags(struct net_device *netdev, u32 data) ...@@ -2328,12 +2334,8 @@ static int ixgbe_set_flags(struct net_device *netdev, u32 data)
need_reset = true; need_reset = true;
} }
if (need_reset) { if (need_reset)
if (netif_running(netdev)) ixgbe_do_reset(netdev);
ixgbe_reinit_locked(adapter);
else
ixgbe_reset(adapter);
}
return 0; return 0;
} }
......
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