All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, gospo@redhat.com,
	Greg Rose <gregory.v.rose@intel.com>,
	Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next-2.6 PATCH 6/7] ixgbevf: Fix panics in the VF driver
Date: Sat, 23 Jan 2010 00:47:18 -0800	[thread overview]
Message-ID: <20100123084717.9865.5467.stgit@localhost.localdomain> (raw)
In-Reply-To: <20100123084457.9865.51853.stgit@localhost.localdomain>

From: Greg Rose <gregory.v.rose@intel.com>

Fix panics in the VF driver that occur when you bring it down after
having already brought the PF down.

Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---

 drivers/net/ixgbevf/ixgbevf_main.c |   24 ++++++++++++++++++++----
 1 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ixgbevf/ixgbevf_main.c b/drivers/net/ixgbevf/ixgbevf_main.c
index bd2fd46..0a27fa1 100644
--- a/drivers/net/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ixgbevf/ixgbevf_main.c
@@ -1693,8 +1693,10 @@ static void ixgbevf_clean_rx_ring(struct ixgbevf_adapter *adapter,
 	unsigned long size;
 	unsigned int i;
 
-	/* Free all the Rx ring sk_buffs */
+	if (!rx_ring->rx_buffer_info)
+		return;
 
+	/* Free all the Rx ring sk_buffs */
 	for (i = 0; i < rx_ring->count; i++) {
 		struct ixgbevf_rx_buffer *rx_buffer_info;
 
@@ -1751,6 +1753,9 @@ static void ixgbevf_clean_tx_ring(struct ixgbevf_adapter *adapter,
 	unsigned long size;
 	unsigned int i;
 
+	if (!tx_ring->tx_buffer_info)
+		return;
+
 	/* Free all the Tx ring sk_buffs */
 
 	for (i = 0; i < tx_ring->count; i++) {
@@ -1843,12 +1848,24 @@ void ixgbevf_down(struct ixgbevf_adapter *adapter)
 
 void ixgbevf_reinit_locked(struct ixgbevf_adapter *adapter)
 {
+	struct ixgbe_hw *hw = &adapter->hw;
+
 	WARN_ON(in_interrupt());
+
 	while (test_and_set_bit(__IXGBEVF_RESETTING, &adapter->state))
 		msleep(1);
 
-	ixgbevf_down(adapter);
-	ixgbevf_up(adapter);
+	/*
+	 * Check if PF is up before re-init.  If not then skip until
+	 * later when the PF is up and ready to service requests from
+	 * the VF via mailbox.  If the VF is up and running then the
+	 * watchdog task will continue to schedule reset tasks until
+	 * the PF is up and running.
+	 */
+	if (!hw->mac.ops.reset_hw(hw)) {
+		ixgbevf_down(adapter);
+		ixgbevf_up(adapter);
+	}
 
 	clear_bit(__IXGBEVF_RESETTING, &adapter->state);
 }
@@ -2423,7 +2440,6 @@ void ixgbevf_free_tx_resources(struct ixgbevf_adapter *adapter,
 {
 	struct pci_dev *pdev = adapter->pdev;
 
-
 	ixgbevf_clean_tx_ring(adapter, tx_ring);
 
 	vfree(tx_ring->tx_buffer_info);


  parent reply	other threads:[~2010-01-23  8:47 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-23  8:45 [net-next-2.6 PATCH 1/7] ixgbe: Set the correct pool when VLANs are added in SR-IOV mode Jeff Kirsher
2010-01-23  8:46 ` [net-next-2.6 PATCH 2/7] ixgbe: Remove unused emulation MAC storage from the per VF data structure Jeff Kirsher
2010-01-23  9:14   ` David Miller
2010-01-23  8:46 ` [net-next-2.6 PATCH 3/7] ixgbe: Allow the VF driver to be loaded before the PF driver Jeff Kirsher
2010-01-23  9:14   ` David Miller
2010-01-23  8:46 ` [net-next-2.6 PATCH 4/7] ixgbe: Improve reset coordination between the PF and the VF Jeff Kirsher
2010-01-23  9:14   ` David Miller
2010-01-23  8:47 ` [net-next-2.6 PATCH 5/7] ixgbevf: Take action when the PF notifies the VF it is resetting Jeff Kirsher
2010-01-23  9:14   ` David Miller
2010-01-23  8:47 ` Jeff Kirsher [this message]
2010-01-23  9:14   ` [net-next-2.6 PATCH 6/7] ixgbevf: Fix panics in the VF driver David Miller
2010-01-23  8:47 ` [net-next-2.6 PATCH 7/7] ixgbevf: Tell network stack to stop tx when the VF detects PF reset Jeff Kirsher
2010-01-23  9:14   ` David Miller
2010-01-23  9:14 ` [net-next-2.6 PATCH 1/7] ixgbe: Set the correct pool when VLANs are added in SR-IOV mode David Miller

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=20100123084717.9865.5467.stgit@localhost.localdomain \
    --to=jeffrey.t.kirsher@intel.com \
    --cc=davem@davemloft.net \
    --cc=gospo@redhat.com \
    --cc=gregory.v.rose@intel.com \
    --cc=netdev@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.