提交 dbabb065 编写于 作者: A Alexander Duyck 提交者: David S. Miller

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: NAlexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 971d1d3a
...@@ -2943,7 +2943,6 @@ static void igb_watchdog_task(struct work_struct *work) ...@@ -2943,7 +2943,6 @@ static void igb_watchdog_task(struct work_struct *work)
watchdog_task); watchdog_task);
struct e1000_hw *hw = &adapter->hw; struct e1000_hw *hw = &adapter->hw;
struct net_device *netdev = adapter->netdev; struct net_device *netdev = adapter->netdev;
struct igb_ring *tx_ring = adapter->tx_ring;
u32 link; u32 link;
int i; int i;
...@@ -3013,12 +3012,14 @@ static void igb_watchdog_task(struct work_struct *work) ...@@ -3013,12 +3012,14 @@ static void igb_watchdog_task(struct work_struct *work)
igb_update_stats(adapter); igb_update_stats(adapter);
igb_update_adaptive(hw); igb_update_adaptive(hw);
for (i = 0; i < adapter->num_tx_queues; i++) {
struct igb_ring *tx_ring = &adapter->tx_ring[i];
if (!netif_carrier_ok(netdev)) { if (!netif_carrier_ok(netdev)) {
if (igb_desc_unused(tx_ring) + 1 < tx_ring->count) {
/* We've lost link, so the controller stops DMA, /* We've lost link, so the controller stops DMA,
* but we've got queued Tx work that's never going * but we've got queued Tx work that's never going
* to get done, so reset controller to flush Tx. * to get done, so reset controller to flush Tx.
* (Do the reset outside of interrupt context). */ * (Do the reset outside of interrupt context). */
if (igb_desc_unused(tx_ring) + 1 < tx_ring->count) {
adapter->tx_timeout_count++; adapter->tx_timeout_count++;
schedule_work(&adapter->reset_task); schedule_work(&adapter->reset_task);
/* return immediately since reset is imminent */ /* return immediately since reset is imminent */
...@@ -3027,8 +3028,8 @@ static void igb_watchdog_task(struct work_struct *work) ...@@ -3027,8 +3028,8 @@ static void igb_watchdog_task(struct work_struct *work)
} }
/* Force detection of hung controller every watchdog period */ /* Force detection of hung controller every watchdog period */
for (i = 0; i < adapter->num_tx_queues; i++) tx_ring->detect_tx_hung = true;
adapter->tx_ring[i].detect_tx_hung = true; }
/* Cause software interrupt to ensure rx ring is cleaned */ /* Cause software interrupt to ensure rx ring is cleaned */
if (adapter->msix_entries) { if (adapter->msix_entries) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册