[S27,03/15] ice: Always notify FW of VF reset
diff mbox series

Message ID 20190808143938.4968-3-anthony.l.nguyen@intel.com
State Under Review
Delegated to: Jeff Kirsher
Headers show
Series
  • [S27,01/15] ice: Limit Max TCs on devices with more than 4 ports
Related show

Commit Message

Tony Nguyen Aug. 8, 2019, 2:39 p.m. UTC
From: Mitch Williams <mitch.a.williams@intel.com>

The call to ice_dis_vsi_txq() acts as the notification to the firmware
that the VF is being reset. Because of this, we need to make this call
every time we reset, regardless of whatever else we do to stop the tx
queues.

Without this change, VF resets would fail to complete on interfaces that
were up and running.

Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
---
 .../net/ethernet/intel/ice/ice_virtchnl_pf.c  | 25 ++++++++++++-------
 1 file changed, 16 insertions(+), 9 deletions(-)

Comments

Bowers, AndrewX Aug. 13, 2019, 5:07 p.m. UTC | #1
> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces@osuosl.org] On
> Behalf Of Tony Nguyen
> Sent: Thursday, August 8, 2019 7:39 AM
> To: intel-wired-lan@lists.osuosl.org
> Subject: [Intel-wired-lan] [PATCH S27 03/15] ice: Always notify FW of VF
> reset
> 
> From: Mitch Williams <mitch.a.williams@intel.com>
> 
> The call to ice_dis_vsi_txq() acts as the notification to the firmware that the
> VF is being reset. Because of this, we need to make this call every time we
> reset, regardless of whatever else we do to stop the tx queues.
> 
> Without this change, VF resets would fail to complete on interfaces that
> were up and running.
> 
> Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
> ---
>  .../net/ethernet/intel/ice/ice_virtchnl_pf.c  | 25 ++++++++++++-------
>  1 file changed, 16 insertions(+), 9 deletions(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>

Patch
diff mbox series

diff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c
index b93324e9f4bc..c58e3e3212df 100644
--- a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c
@@ -1074,9 +1074,16 @@  bool ice_reset_all_vfs(struct ice_pf *pf, bool is_vflr)
 	for (v = 0; v < pf->num_alloc_vfs; v++)
 		ice_trigger_vf_reset(&pf->vf[v], is_vflr);
 
-	for (v = 0; v < pf->num_alloc_vfs; v++)
-		if (test_bit(ICE_VF_STATE_QS_ENA, pf->vf[v].vf_states))
-			ice_dis_vf_qs(&pf->vf[v]);
+	for (v = 0; v < pf->num_alloc_vfs; v++) {
+		struct ice_vsi *vsi;
+
+		vf = &pf->vf[v];
+		vsi = pf->vsi[vf->lan_vsi_idx];
+		if (test_bit(ICE_VF_STATE_QS_ENA, vf->vf_states))
+			ice_dis_vf_qs(vf);
+		ice_dis_vsi_txq(vsi->port_info, vsi->idx, 0, 0, NULL, NULL,
+				NULL, ICE_VF_RESET, vf->vf_id, NULL);
+	}
 
 	/* HW requires some time to make sure it can flush the FIFO for a VF
 	 * when it resets it. Poll the VPGEN_VFRSTAT register for each VF in
@@ -1171,12 +1178,12 @@  static bool ice_reset_vf(struct ice_vf *vf, bool is_vflr)
 
 	if (test_bit(ICE_VF_STATE_QS_ENA, vf->vf_states))
 		ice_dis_vf_qs(vf);
-	else
-		/* Call Disable LAN Tx queue AQ call even when queues are not
-		 * enabled. This is needed for successful completion of VFR
-		 */
-		ice_dis_vsi_txq(vsi->port_info, vsi->idx, 0, 0, NULL, NULL,
-				NULL, ICE_VF_RESET, vf->vf_id, NULL);
+
+	/* Call Disable LAN Tx queue AQ whether or not queues are
+	 * enabled. This is needed for successful completion of VFR.
+	 */
+	ice_dis_vsi_txq(vsi->port_info, vsi->idx, 0, 0, NULL, NULL,
+			NULL, ICE_VF_RESET, vf->vf_id, NULL);
 
 	hw = &pf->hw;
 	/* poll VPGEN_VFRSTAT reg to make sure