From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Mitch Williams <mitch.a.williams@intel.com>,
netdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com,
jogreene@redhat.com, Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next 06/15] i40evf: reset on module unload
Date: Mon, 9 Feb 2015 02:43:52 -0800 [thread overview]
Message-ID: <1423478641-3138-7-git-send-email-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <1423478641-3138-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Mitch Williams <mitch.a.williams@intel.com>
When the module is being unloaded, don't wait for the PF to politely
handle all of our admin queue requests, as that might take forever with
a lot of VFs enabled. Instead, just stop everything and request a VF
reset.
When the original shutdown code was written, VF resets were unreliable,
so we avoided them. But with production hardware and firmware, and the
1.x PF driver, this is no longer the case.
This fixes a potential multi-minute delay on driver unload, VF disable,
or system shutdown.
Change-ID: Ib43d6d860ef6b9b8f26e8dce0615a0302608c7d9
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Jim Young <james.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/i40evf/i40evf_main.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index f946aac..cd71c47 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -2423,7 +2423,6 @@ static void i40evf_remove(struct pci_dev *pdev)
struct i40evf_adapter *adapter = netdev_priv(netdev);
struct i40evf_mac_filter *f, *ftmp;
struct i40e_hw *hw = &adapter->hw;
- int count = 50;
cancel_delayed_work_sync(&adapter->init_task);
cancel_work_sync(&adapter->reset_task);
@@ -2432,12 +2431,18 @@ static void i40evf_remove(struct pci_dev *pdev)
unregister_netdev(netdev);
adapter->netdev_registered = false;
}
- while (count-- && adapter->aq_required)
- msleep(50);
- if (count < 0)
- dev_err(&pdev->dev, "Timed out waiting for PF driver.\n");
+ /* Shut down all the garbage mashers on the detention level */
adapter->state = __I40EVF_REMOVE;
+ adapter->aq_required = 0;
+ adapter->aq_pending = 0;
+ i40evf_request_reset(adapter);
+ msleep(20);
+ /* If the FW isn't responding, kick it once, but only once. */
+ if (!i40evf_asq_done(hw)) {
+ i40evf_request_reset(adapter);
+ msleep(20);
+ }
if (adapter->msix_entries) {
i40evf_misc_irq_disable(adapter);
--
1.9.3
next prev parent reply other threads:[~2015-02-09 10:44 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-09 10:43 [net-next 00/15][pull request] Intel Wired LAN Driver Updates 2015-02-09 Jeff Kirsher
2015-02-09 10:43 ` [net-next 01/15] i40e: i40e_fcoe.c: Remove unused function Jeff Kirsher
2015-02-09 10:43 ` [net-next 02/15] i40e: avoid use of uninitialized v_budget in i40e_init_msix Jeff Kirsher
2015-02-09 10:43 ` [net-next 03/15] i40e: delay after VF reset Jeff Kirsher
2015-02-09 10:43 ` [net-next 04/15] i40e: Use even more ARQ descriptors Jeff Kirsher
2015-02-09 10:43 ` [net-next 05/15] i40e: add locking around VF reset Jeff Kirsher
2015-02-09 10:43 ` Jeff Kirsher [this message]
2015-02-09 10:43 ` [net-next 07/15] i40evf: ignore bogus messages from FW Jeff Kirsher
2015-02-09 10:43 ` [net-next 08/15] i40evf: stop the watchdog for shutdown Jeff Kirsher
2015-02-09 10:43 ` [net-next 09/15] i40e: stop the service task at shutdown Jeff Kirsher
2015-02-09 10:43 ` [net-next 10/15] i40evf: Force Tx writeback on ITR Jeff Kirsher
2015-02-09 10:43 ` [net-next 11/15] i40e: fix led blink toggle to enable steady state Jeff Kirsher
2015-02-09 10:43 ` [net-next 12/15] i40e: Fix function header Jeff Kirsher
2015-02-09 10:43 ` [net-next 13/15] i40e: use dev_port for fcoe netdev Jeff Kirsher
2015-02-09 10:44 ` [net-next 14/15] i40e: Enable Loopback for the FCOE vsi as well Jeff Kirsher
2015-02-09 10:44 ` [net-next 15/15] i40e/i40evf: Add call to u64_stats_init to init Jeff Kirsher
2015-02-09 12:09 ` Sergei Shtylyov
2015-02-09 16:45 ` Wyborny, Carolyn
2015-02-09 22:18 ` [net-next 00/15][pull request] Intel Wired LAN Driver Updates 2015-02-09 David Miller
2015-02-10 0:25 ` Jeff Kirsher
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=1423478641-3138-7-git-send-email-jeffrey.t.kirsher@intel.com \
--to=jeffrey.t.kirsher@intel.com \
--cc=davem@davemloft.net \
--cc=jogreene@redhat.com \
--cc=mitch.a.williams@intel.com \
--cc=netdev@vger.kernel.org \
--cc=nhorman@redhat.com \
--cc=sassmann@redhat.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;
as well as URLs for NNTP newsgroup(s).