Skip to content

Commit

Permalink
e1000: call netif_carrier_off early on down
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eliezer Tamir authored and Jeff Kirsher committed Mar 6, 2015
1 parent b23c0cc commit f9c029d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/intel/e1000/e1000_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,7 @@ void e1000_down(struct e1000_adapter *adapter)
struct net_device *netdev = adapter->netdev;
u32 rctl, tctl;

netif_carrier_off(netdev);

/* disable receives in the hardware */
rctl = er32(RCTL);
Expand Down Expand Up @@ -544,7 +545,6 @@ void e1000_down(struct e1000_adapter *adapter)

adapter->link_speed = 0;
adapter->link_duplex = 0;
netif_carrier_off(netdev);

e1000_reset(adapter);
e1000_clean_all_tx_rings(adapter);
Expand Down

0 comments on commit f9c029d

Please sign in to comment.