]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
e1000e: do not schedule the Tx queue until ready
authorBruce Allan <bruce.w.allan@intel.com>
Fri, 13 May 2011 07:20:03 +0000 (07:20 +0000)
committerJoe Jin <joe.jin@oracle.com>
Thu, 2 Feb 2012 13:18:55 +0000 (21:18 +0800)
Start the Tx queue when the interface is brought up in e1000e_up() but do
not schedule the queue until link is up as detected in the watchdog task
which sets netif_carrier_on.

Also flush the descriptors and clean the Tx and Rx rings before resetting
the hardware when bringing the interface down otherwise there is a small
window where the watchdog task can be triggered with netif_carrier_off
and the Tx ring not yet empty which causes an additional and unnecessary
reset.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 400484fa65ead1bbc3e86ea79e7505182a31bce1)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
drivers/net/e1000e/netdev.c

index f5c1469f219ac5f8e19bb7a8592f39592bf550d4..da3fff664f274934aa1252148964dc0e81ee5e07 100644 (file)
@@ -3346,7 +3346,7 @@ int e1000e_up(struct e1000_adapter *adapter)
                e1000_configure_msix(adapter);
        e1000_irq_enable(adapter);
 
-       netif_wake_queue(adapter->netdev);
+       netif_start_queue(adapter->netdev);
 
        /* fire a link change interrupt to start the watchdog */
        if (adapter->msix_entries)
@@ -3413,17 +3413,16 @@ void e1000e_down(struct e1000_adapter *adapter)
        e1000e_update_stats(adapter);
        spin_unlock(&adapter->stats64_lock);
 
+       e1000e_flush_descriptors(adapter);
+       e1000_clean_tx_ring(adapter);
+       e1000_clean_rx_ring(adapter);
+
        adapter->link_speed = 0;
        adapter->link_duplex = 0;
 
        if (!pci_channel_offline(adapter->pdev))
                e1000e_reset(adapter);
 
-       e1000e_flush_descriptors(adapter);
-
-       e1000_clean_tx_ring(adapter);
-       e1000_clean_rx_ring(adapter);
-
        /*
         * TODO: for power management, we could drop the link and
         * pci_disable_device here.