Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Eliezer Tamir and committed by
Jeff Kirsher
d9d888b8 f6877fcf

+2 -1
+2 -1
drivers/net/ethernet/intel/ixgb/ixgb_main.c
··· 285 285 /* prevent the interrupt handler from restarting watchdog */ 286 286 set_bit(__IXGB_DOWN, &adapter->flags); 287 287 288 + netif_carrier_off(netdev); 289 + 288 290 napi_disable(&adapter->napi); 289 291 /* waiting for NAPI to complete can re-enable interrupts */ 290 292 ixgb_irq_disable(adapter); ··· 300 298 301 299 adapter->link_speed = 0; 302 300 adapter->link_duplex = 0; 303 - netif_carrier_off(netdev); 304 301 netif_stop_queue(netdev); 305 302 306 303 ixgb_reset(adapter);