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 06/14] i40e: Make VF resets more reliable
Date: Tue,  5 Apr 2016 20:36:01 -0700	[thread overview]
Message-ID: <1459913769-56510-7-git-send-email-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <1459913769-56510-1-git-send-email-jeffrey.t.kirsher@intel.com>

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

Clear the VFLR bit immediately after triggering a reset instead of
waiting until after cleanup is complete. Make sure to trigger a reset
every time, not just if the PF is up.

These changes fix a problem where VF resets would get lost by the PF,
preventing the VF driver from initializing.

Change-ID: I5945cf2884095b7b0554867c64df8617e71d9d29
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
index 150002e..169c256 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
@@ -937,6 +937,10 @@ void i40e_reset_vf(struct i40e_vf *vf, bool flr)
 		wr32(hw, I40E_VPGEN_VFRTRIG(vf->vf_id), reg);
 		i40e_flush(hw);
 	}
+	/* clear the VFLR bit in GLGEN_VFLRSTAT */
+	reg_idx = (hw->func_caps.vf_base_id + vf->vf_id) / 32;
+	bit_idx = (hw->func_caps.vf_base_id + vf->vf_id) % 32;
+	wr32(hw, I40E_GLGEN_VFLRSTAT(reg_idx), BIT(bit_idx));
 
 	if (i40e_quiesce_vf_pci(vf))
 		dev_err(&pf->pdev->dev, "VF %d PCI transactions stuck\n",
@@ -989,10 +993,6 @@ complete_reset:
 	/* tell the VF the reset is done */
 	wr32(hw, I40E_VFGEN_RSTAT1(vf->vf_id), I40E_VFR_VFACTIVE);
 
-	/* clear the VFLR bit in GLGEN_VFLRSTAT */
-	reg_idx = (hw->func_caps.vf_base_id + vf->vf_id) / 32;
-	bit_idx = (hw->func_caps.vf_base_id + vf->vf_id) % 32;
-	wr32(hw, I40E_GLGEN_VFLRSTAT(reg_idx), BIT(bit_idx));
 	i40e_flush(hw);
 	clear_bit(__I40E_VF_DISABLE, &pf->state);
 }
@@ -2296,11 +2296,9 @@ int i40e_vc_process_vflr_event(struct i40e_pf *pf)
 		/* read GLGEN_VFLRSTAT register to find out the flr VFs */
 		vf = &pf->vf[vf_id];
 		reg = rd32(hw, I40E_GLGEN_VFLRSTAT(reg_idx));
-		if (reg & BIT(bit_idx)) {
+		if (reg & BIT(bit_idx))
 			/* i40e_reset_vf will clear the bit in GLGEN_VFLRSTAT */
-			if (!test_bit(__I40E_DOWN, &pf->state))
-				i40e_reset_vf(vf, true);
-		}
+			i40e_reset_vf(vf, true);
 	}
 
 	return 0;
-- 
2.5.5

  parent reply	other threads:[~2016-04-06  3:36 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-06  3:35 [net-next 00/14][pull request] 40GbE Intel Wired LAN Driver Updates 2016-04-05 Jeff Kirsher
2016-04-06  3:35 ` [net-next 01/14] i40e: remove redundant check on vsi->active_vlans Jeff Kirsher
2016-04-06  3:35 ` [net-next 02/14] i40e: Enable Geneve offload for FW API ver > 1.4 for XL710/X710 devices Jeff Kirsher
2016-04-06  3:35 ` [net-next 03/14] i40e: Remove unused variable Jeff Kirsher
2016-04-06  3:35 ` [net-next 04/14] i40evf: Fix VLAN features Jeff Kirsher
2016-04-06  3:36 ` [net-next 05/14] i40e: Add new device ID for X722 Jeff Kirsher
2016-04-06  3:36 ` Jeff Kirsher [this message]
2016-04-06  3:36 ` [net-next 07/14] i40evf: Add longer wait after remove module Jeff Kirsher
2016-04-06  3:36 ` [net-next 08/14] i40e: Disable link polling Jeff Kirsher
2016-04-06  3:36 ` [net-next 09/14] i40evf: Fix get_rss_aq Jeff Kirsher
2016-04-06  3:36 ` [net-next 10/14] i40e: Fix for supported link modes in 10GBaseT PHY's Jeff Kirsher
2016-04-06  3:36 ` [net-next 11/14] i40e: Lower some message levels Jeff Kirsher
2016-04-06  3:36 ` [net-next 12/14] i40e: Request PHY media event at reset time Jeff Kirsher
2016-04-06  3:36 ` [net-next 13/14] i40e/i40evf: Bump patch from 1.5.1 to 1.5.2 Jeff Kirsher
2016-04-06  3:36 ` [net-next 14/14] i40e/i40evf: Fix TSO checksum pseudo-header adjustment Jeff Kirsher
2016-04-06 21:04 ` [net-next 00/14][pull request] 40GbE Intel Wired LAN Driver Updates 2016-04-05 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=1459913769-56510-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).