Skip to content

Commit d9d888b

Browse files
Eliezer TamirJeff Kirsher
authored andcommitted
ixgb: 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> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
1 parent f6877fc commit d9d888b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/net/ethernet/intel/ixgb/ixgb_main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,8 @@ ixgb_down(struct ixgb_adapter *adapter, bool kill_watchdog)
285285
/* prevent the interrupt handler from restarting watchdog */
286286
set_bit(__IXGB_DOWN, &adapter->flags);
287287

288+
netif_carrier_off(netdev);
289+
288290
napi_disable(&adapter->napi);
289291
/* waiting for NAPI to complete can re-enable interrupts */
290292
ixgb_irq_disable(adapter);
@@ -298,7 +300,6 @@ ixgb_down(struct ixgb_adapter *adapter, bool kill_watchdog)
298300

299301
adapter->link_speed = 0;
300302
adapter->link_duplex = 0;
301-
netif_carrier_off(netdev);
302303
netif_stop_queue(netdev);
303304

304305
ixgb_reset(adapter);

0 commit comments

Comments
 (0)