From patchwork Fri Nov 13 04:38:16 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kirsher, Jeffrey T" X-Patchwork-Id: 38314 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id A9B06B7BA4 for ; Fri, 13 Nov 2009 15:38:39 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755794AbZKMEi3 (ORCPT ); Thu, 12 Nov 2009 23:38:29 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755778AbZKMEi2 (ORCPT ); Thu, 12 Nov 2009 23:38:28 -0500 Received: from qmta02.westchester.pa.mail.comcast.net ([76.96.62.24]:57324 "EHLO QMTA02.westchester.pa.mail.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755563AbZKMEi2 (ORCPT ); Thu, 12 Nov 2009 23:38:28 -0500 Received: from OMTA11.westchester.pa.mail.comcast.net ([76.96.62.36]) by QMTA02.westchester.pa.mail.comcast.net with comcast id 4UbZ1d0050mv7h052UeaVM; Fri, 13 Nov 2009 04:38:34 +0000 Received: from localhost.localdomain ([63.64.152.142]) by OMTA11.westchester.pa.mail.comcast.net with comcast id 4UeH1d00134bfcX3XUeKku; Fri, 13 Nov 2009 04:38:32 +0000 From: Jeff Kirsher Subject: [net-next-2.6 PATCH 6/7] igb: check for packets on all tx rings when link is down To: davem@davemloft.net Cc: netdev@vger.kernel.org, gospo@redhat.com, Alexander Duyck , Jeff Kirsher Date: Thu, 12 Nov 2009 20:38:16 -0800 Message-ID: <20091113043815.1240.48974.stgit@localhost.localdomain> In-Reply-To: <20091113043604.1240.80142.stgit@localhost.localdomain> References: <20091113043604.1240.80142.stgit@localhost.localdomain> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Alexander Duyck 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 Signed-off-by: Jeff Kirsher --- drivers/net/igb/igb_main.c | 23 ++++++++++++----------- 1 files changed, 12 insertions(+), 11 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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) {