aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/igb
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@intel.com>2009-11-12 18:38:16 +0000
committerDavid S. Miller <davem@davemloft.net>2009-11-13 20:46:52 -0800
commitdbabb065802a46d64b8869ba97674bfa90b55d83 (patch)
treed38b0efce1b978d7e05221aa66cf7188c56d4386 /drivers/net/igb
parent971d1d3a7e9f03af870909fddfc3b2fc08e4f5b1 (diff)
downloadkernel_samsung_smdk4412-dbabb065802a46d64b8869ba97674bfa90b55d83.zip
kernel_samsung_smdk4412-dbabb065802a46d64b8869ba97674bfa90b55d83.tar.gz
kernel_samsung_smdk4412-dbabb065802a46d64b8869ba97674bfa90b55d83.tar.bz2
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/net/igb')
-rw-r--r--drivers/net/igb/igb_main.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index 4d4ab87..9911b3a 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)
watchdog_task);
struct e1000_hw *hw = &adapter->hw;
struct net_device *netdev = adapter->netdev;
- struct igb_ring *tx_ring = adapter->tx_ring;
u32 link;
int i;
@@ -3013,22 +3012,24 @@ static void igb_watchdog_task(struct work_struct *work)
igb_update_stats(adapter);
igb_update_adaptive(hw);
- if (!netif_carrier_ok(netdev)) {
- if (igb_desc_unused(tx_ring) + 1 < tx_ring->count) {
+ for (i = 0; i < adapter->num_tx_queues; i++) {
+ struct igb_ring *tx_ring = &adapter->tx_ring[i];
+ if (!netif_carrier_ok(netdev)) {
/* We've lost link, so the controller stops DMA,
* but we've got queued Tx work that's never going
* to get done, so reset controller to flush Tx.
* (Do the reset outside of interrupt context). */
- adapter->tx_timeout_count++;
- schedule_work(&adapter->reset_task);
- /* return immediately since reset is imminent */
- return;
+ if (igb_desc_unused(tx_ring) + 1 < tx_ring->count) {
+ adapter->tx_timeout_count++;
+ schedule_work(&adapter->reset_task);
+ /* return immediately since reset is imminent */
+ return;
+ }
}
- }
- /* Force detection of hung controller every watchdog period */
- for (i = 0; i < adapter->num_tx_queues; i++)
- adapter->tx_ring[i].detect_tx_hung = true;
+ /* Force detection of hung controller every watchdog period */
+ tx_ring->detect_tx_hung = true;
+ }
/* Cause software interrupt to ensure rx ring is cleaned */
if (adapter->msix_entries) {