diff options
author | Alexander Duyck <alexander.h.duyck@intel.com> | 2009-11-12 13:38:16 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-11-13 23:46:52 -0500 |
commit | dbabb065802a46d64b8869ba97674bfa90b55d83 (patch) | |
tree | d38b0efce1b978d7e05221aa66cf7188c56d4386 /drivers | |
parent | 971d1d3a7e9f03af870909fddfc3b2fc08e4f5b1 (diff) |
igb: check for packets on all tx rings when link is down
We were previously only checking the first tx ring to see if it had any
packets in it when the link when down. However we should be checking all
of the rings so this patch makes it so that all of the rings are now being
checked.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/igb/igb_main.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c index 4d4ab87aeab..9911b3aaed3 100644 --- a/drivers/net/igb/igb_main.c +++ b/drivers/net/igb/igb_main.c | |||
@@ -2943,7 +2943,6 @@ static void igb_watchdog_task(struct work_struct *work) | |||
2943 | watchdog_task); | 2943 | watchdog_task); |
2944 | struct e1000_hw *hw = &adapter->hw; | 2944 | struct e1000_hw *hw = &adapter->hw; |
2945 | struct net_device *netdev = adapter->netdev; | 2945 | struct net_device *netdev = adapter->netdev; |
2946 | struct igb_ring *tx_ring = adapter->tx_ring; | ||
2947 | u32 link; | 2946 | u32 link; |
2948 | int i; | 2947 | int i; |
2949 | 2948 | ||
@@ -3013,22 +3012,24 @@ static void igb_watchdog_task(struct work_struct *work) | |||
3013 | igb_update_stats(adapter); | 3012 | igb_update_stats(adapter); |
3014 | igb_update_adaptive(hw); | 3013 | igb_update_adaptive(hw); |
3015 | 3014 | ||
3016 | if (!netif_carrier_ok(netdev)) { | 3015 | for (i = 0; i < adapter->num_tx_queues; i++) { |
3017 | if (igb_desc_unused(tx_ring) + 1 < tx_ring->count) { | 3016 | struct igb_ring *tx_ring = &adapter->tx_ring[i]; |
3017 | if (!netif_carrier_ok(netdev)) { | ||
3018 | /* We've lost link, so the controller stops DMA, | 3018 | /* We've lost link, so the controller stops DMA, |
3019 | * but we've got queued Tx work that's never going | 3019 | * but we've got queued Tx work that's never going |
3020 | * to get done, so reset controller to flush Tx. | 3020 | * to get done, so reset controller to flush Tx. |
3021 | * (Do the reset outside of interrupt context). */ | 3021 | * (Do the reset outside of interrupt context). */ |
3022 | adapter->tx_timeout_count++; | 3022 | if (igb_desc_unused(tx_ring) + 1 < tx_ring->count) { |
3023 | schedule_work(&adapter->reset_task); | 3023 | adapter->tx_timeout_count++; |
3024 | /* return immediately since reset is imminent */ | 3024 | schedule_work(&adapter->reset_task); |
3025 | return; | 3025 | /* return immediately since reset is imminent */ |
3026 | return; | ||
3027 | } | ||
3026 | } | 3028 | } |
3027 | } | ||
3028 | 3029 | ||
3029 | /* Force detection of hung controller every watchdog period */ | 3030 | /* Force detection of hung controller every watchdog period */ |
3030 | for (i = 0; i < adapter->num_tx_queues; i++) | 3031 | tx_ring->detect_tx_hung = true; |
3031 | adapter->tx_ring[i].detect_tx_hung = true; | 3032 | } |
3032 | 3033 | ||
3033 | /* Cause software interrupt to ensure rx ring is cleaned */ | 3034 | /* Cause software interrupt to ensure rx ring is cleaned */ |
3034 | if (adapter->msix_entries) { | 3035 | if (adapter->msix_entries) { |