From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, gospo@redhat.com,
Shannon Nelson <shannon.nelson@intel.com>,
Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next PATCH 3/3] ixgbe: Clear out stray tx work on link down
Date: Tue, 28 Apr 2009 01:43:12 -0700 [thread overview]
Message-ID: <20090428084312.32710.49988.stgit@localhost.localdomain> (raw)
In-Reply-To: <20090428084236.32710.14750.stgit@localhost.localdomain>
From: Nelson, Shannon <shannon.nelson@intel.com>
Ayyappan at VMware noticed that we're missing this check from ixgbe which
is in our other drivers. The difference with this implementation from our
other drivers is that this checks all the tx queues rather than just tx[0].
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ixgbe/ixgbe_main.c | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index 60c3a21..35ff703 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -4117,6 +4117,9 @@ static void ixgbe_watchdog_task(struct work_struct *work)
struct ixgbe_hw *hw = &adapter->hw;
u32 link_speed = adapter->link_speed;
bool link_up = adapter->link_up;
+ int i;
+ struct ixgbe_ring *tx_ring;
+ int some_tx_pending = 0;
adapter->flags |= IXGBE_FLAG_IN_WATCHDOG_TASK;
@@ -4174,6 +4177,25 @@ static void ixgbe_watchdog_task(struct work_struct *work)
}
}
+ if (!netif_carrier_ok(netdev)) {
+ for (i = 0; i < adapter->num_tx_queues; i++) {
+ tx_ring = &adapter->tx_ring[i];
+ if (tx_ring->next_to_use != tx_ring->next_to_clean) {
+ some_tx_pending = 1;
+ break;
+ }
+ }
+
+ if (some_tx_pending) {
+ /* 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).
+ */
+ schedule_work(&adapter->reset_task);
+ }
+ }
+
ixgbe_update_stats(adapter);
adapter->flags &= ~IXGBE_FLAG_IN_WATCHDOG_TASK;
}
next prev parent reply other threads:[~2009-04-28 8:43 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-28 8:42 [net-next PATCH 1/3] ixgbe: enable HW RSC for 82599 Jeff Kirsher
2009-04-28 8:42 ` [net-next PATCH 2/3] ixgbe: Interrupt management update " Jeff Kirsher
2009-04-28 8:55 ` David Miller
2009-04-28 8:43 ` Jeff Kirsher [this message]
2009-04-28 8:55 ` [net-next PATCH 3/3] ixgbe: Clear out stray tx work on link down David Miller
2009-04-28 8:55 ` [net-next PATCH 1/3] ixgbe: enable HW RSC for 82599 David Miller
2009-04-29 0:12 ` Brandeburg, Jesse
2009-04-29 0:54 ` David Miller
2009-04-29 16:16 ` Alexander Duyck
2009-04-29 16:40 ` Roland Dreier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090428084312.32710.49988.stgit@localhost.localdomain \
--to=jeffrey.t.kirsher@intel.com \
--cc=davem@davemloft.net \
--cc=gospo@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=shannon.nelson@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox