Skip to content

Commit a60a132

Browse files
Eliezer TamirJeff Kirsher
authored andcommitted
e1000e: call netif_carrier_off early on down
When bringing down an interface netif_carrier_off() should be one the first things we do, since this will prevent the stack from queuing more packets to this interface. This operation is very fast, and should make the device behave much nicer when trying to bring down an interface under load. Also, this would Do The Right Thing (TM) if this device has some sort of fail-over teaming and redirect traffic to the other IF. Move netif_carrier_off as early as possible. Signed-off-by: Eliezer Tamir <eliezer.tamir@linux.intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
1 parent d9d888b commit a60a132

File tree

1 file changed

+2
-2
lines changed
  • drivers/net/ethernet/intel/e1000e

1 file changed

+2
-2
lines changed

drivers/net/ethernet/intel/e1000e/netdev.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4084,6 +4084,8 @@ void e1000e_down(struct e1000_adapter *adapter, bool reset)
40844084
*/
40854085
set_bit(__E1000_DOWN, &adapter->state);
40864086

4087+
netif_carrier_off(netdev);
4088+
40874089
/* disable receives in the hardware */
40884090
rctl = er32(RCTL);
40894091
if (!(adapter->flags2 & FLAG2_NO_DISABLE_RX))
@@ -4108,8 +4110,6 @@ void e1000e_down(struct e1000_adapter *adapter, bool reset)
41084110
del_timer_sync(&adapter->watchdog_timer);
41094111
del_timer_sync(&adapter->phy_info_timer);
41104112

4111-
netif_carrier_off(netdev);
4112-
41134113
spin_lock(&adapter->stats64_lock);
41144114
e1000e_update_stats(adapter);
41154115
spin_unlock(&adapter->stats64_lock);

0 commit comments

Comments
 (0)