[PATCH] e1000: Fix TX queue length based on link speed
authorJeff Kirsher <jeffrey.t.kirsher@intel.com>
Fri, 13 Jan 2006 00:50:53 +0000 (16:50 -0800)
committerJeff Garzik <jgarzik@pobox.com>
Tue, 17 Jan 2006 12:44:50 +0000 (07:44 -0500)
10/100 speeds seem to have some problems reporting false tx timeouts especially at half duplex.  Fixed by using a timeout factor to attempt to mitigate the false timeouts.

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: John Ronciak <john.ronciak@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
drivers/net/e1000/e1000.h
drivers/net/e1000/e1000_main.c

index 0a084e915dd6a3baa3e90a37f70b33be2397684e..d95a5f88181c808eca32c0cd74431b98fbf0772b 100644 (file)
@@ -296,6 +296,7 @@ struct e1000_adapter {
        uint32_t tx_fifo_head;
        uint32_t tx_head_addr;
        uint32_t tx_fifo_size;
+       uint8_t  tx_timeout_factor;
        atomic_t tx_fifo_stall;
        boolean_t pcix_82544;
        boolean_t detect_tx_hung;
index cefc7cc092a7b10c1ce05e55c087558e936b712f..cf4fc51170327346632c4e5688c308542f777b2e 100644 (file)
@@ -2319,6 +2319,21 @@ e1000_watchdog_task(struct e1000_adapter *adapter)
                               adapter->link_duplex == FULL_DUPLEX ?
                               "Full Duplex" : "Half Duplex");
 
+                       /* tweak tx_queue_len according to speed/duplex */
+                       netdev->tx_queue_len = adapter->tx_queue_len;
+                       adapter->tx_timeout_factor = 1;
+                       if (adapter->link_duplex == HALF_DUPLEX) {
+                               switch (adapter->link_speed) {
+                               case SPEED_10:
+                                       netdev->tx_queue_len = 10;
+                                       adapter->tx_timeout_factor = 8;
+                                       break;
+                               case SPEED_100:
+                                       netdev->tx_queue_len = 100;
+                                       break;
+                               }
+                       }
+
                        netif_carrier_on(netdev);
                        netif_wake_queue(netdev);
                        mod_timer(&adapter->phy_info_timer, jiffies + 2 * HZ);