netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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 01/14] i40e: stop VF rings
Date: Tue, 14 Apr 2015 21:51:38 -0700	[thread overview]
Message-ID: <1429073511-27664-2-git-send-email-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <1429073511-27664-1-git-send-email-jeffrey.t.kirsher@intel.com>

From: Mitch Williams <mitch.a.williams@intel.com>

Explicitly stop the rings belonging to each VF when disabling SR-IOV.
Even though the VFs were gone, and the associated VSIs were removed,
the rings were not stopped, and in some circumstances the hardware would
continue to access the memory formerly used by the rings, causing
memory corruption or DMAR errors, both of which would lead to general
malaise of the kernel.

To relieve this condition, explicitly stop all the rings associated with
each VF before releasing its resources.

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/i40e/i40e_virtchnl_pf.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
index 4d69e1f..9b3fc83 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
@@ -733,6 +733,11 @@ void i40e_free_vfs(struct i40e_pf *pf)
 	while (test_and_set_bit(__I40E_VF_DISABLE, &pf->state))
 		usleep_range(1000, 2000);
 
+	for (i = 0; i < pf->num_alloc_vfs; i++)
+		if (test_bit(I40E_VF_STAT_INIT, &pf->vf[i].vf_states))
+			i40e_vsi_control_rings(pf->vsi[pf->vf[i].lan_vsi_idx],
+					       false);
+
 	/* Disable IOV before freeing resources. This lets any VF drivers
 	 * running in the host get themselves cleaned up before we yank
 	 * the carpet out from underneath their feet.
-- 
1.9.3

  reply	other threads:[~2015-04-15  4:51 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-15  4:51 [net-next 00/14][pull request] Intel Wired LAN Driver Updates 2015-04-14 Jeff Kirsher
2015-04-15  4:51 ` Jeff Kirsher [this message]
2015-04-15  4:51 ` [net-next 02/14] i40evf: fix bad indentation Jeff Kirsher
2015-04-15  4:51 ` [net-next 03/14] i40e: Add support to program FDir SB rules for VF from PF through ethtool Jeff Kirsher
2015-04-15  8:58   ` Or Gerlitz
2015-04-16  1:42     ` Jeff Kirsher
2015-04-15  4:51 ` [net-next 04/14] i40evf: remove aq_pending Jeff Kirsher
2015-04-15  4:51 ` [net-next 05/14] i40e: notify VFs of link state Jeff Kirsher
2015-04-15  4:51 ` [net-next 06/14] i40e: move VF notification routines up Jeff Kirsher
2015-04-15  4:51 ` [net-next 07/14] i40e: For VF reset (VFR and VFLR) add some more delay Jeff Kirsher
2015-04-15  4:51 ` [net-next 08/14] i40e: print FCoE capability reported by the device function Jeff Kirsher
2015-04-15  4:51 ` [net-next 09/14] i40e: enable user dump of internal hardware state Jeff Kirsher
2015-04-15  4:51 ` [net-next 10/14] i40e/i40evf: Save WR_CSR_PROT field from DEV/FUNC capabilities Jeff Kirsher
2015-04-15  4:51 ` [net-next 11/14] i40e: handle possible memory allocation failure Jeff Kirsher
2015-04-15 11:27   ` Sergei Shtylyov
2015-04-15  4:51 ` [net-next 12/14] i40e: get rid of unused locals Jeff Kirsher
2015-04-15  4:51 ` [net-next 13/14] i40e: Use new 40G speeds Jeff Kirsher
2015-04-15  4:51 ` [net-next 14/14] i40e: Bump version to 1.3.2 Jeff Kirsher
2015-04-15 21:45 ` [net-next 00/14][pull request] Intel Wired LAN Driver Updates 2015-04-14 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=1429073511-27664-2-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).