[S27,04/15] ice: Rebuild VSI while changing queues
diff mbox series

Message ID 20190808143938.4968-4-anthony.l.nguyen@intel.com
State Under Review
Delegated to: Jeff Kirsher
Headers show
Series
  • Untitled series #124090
Related show

Commit Message

Tony Nguyen Aug. 8, 2019, 2:39 p.m. UTC
From: Md Fahad Iqbal Polash <md.fahad.iqbal.polash@intel.com>

Currently, while the queues are being changed, the driver rebuilds
the VSI only when the netdev is running. However, the driver needs
to rebuild the VSI irrespective of the state of netdev. In this way,
alloc_txq / alloc_rxq fields of the VSI would be updated correctly.

Signed-off-by: Md Fahad Iqbal Polash <md.fahad.iqbal.polash@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_main.c | 19 ++++++-------------
 1 file changed, 6 insertions(+), 13 deletions(-)

Comments

Bowers, AndrewX Aug. 13, 2019, 5:08 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 04/15] ice: Rebuild VSI while changing
> queues
> 
> From: Md Fahad Iqbal Polash <md.fahad.iqbal.polash@intel.com>
> 
> Currently, while the queues are being changed, the driver rebuilds the VSI
> only when the netdev is running. However, the driver needs to rebuild the
> VSI irrespective of the state of netdev. In this way, alloc_txq / alloc_rxq fields
> of the VSI would be updated correctly.
> 
> Signed-off-by: Md Fahad Iqbal Polash <md.fahad.iqbal.polash@intel.com>
> ---
>  drivers/net/ethernet/intel/ice/ice_main.c | 19 ++++++-------------
>  1 file changed, 6 insertions(+), 13 deletions(-)

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

Patch
diff mbox series

diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
index ca5175774f41..e0aa34064283 100644
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -4002,28 +4002,21 @@  int ice_vsi_recfg_qs(struct ice_vsi *vsi, int new_rx, int new_tx)
 		usleep_range(1000, 2000);
 	}
 
+	if (new_tx)
+		vsi->req_txq = new_tx;
+	if (new_rx)
+		vsi->req_rxq = new_rx;
+
 	/* set for the next time the netdev is started */
 	if (!netif_running(vsi->netdev)) {
-		if (new_tx)
-			vsi->req_txq = new_tx;
-		if (new_rx)
-			vsi->req_rxq = new_rx;
-
+		ice_vsi_rebuild(vsi, false);
 		dev_dbg(&pf->pdev->dev, "Link is down, queue count change happens when link is brought up\n");
 		goto done;
 	}
 
 	ice_vsi_close(vsi);
-
-	if (new_tx)
-		vsi->req_txq = new_tx;
-
-	if (new_rx)
-		vsi->req_rxq = new_rx;
-
 	ice_vsi_rebuild(vsi, false);
 	ice_pf_dcb_recfg(pf);
-
 	ice_vsi_open(vsi);
 done:
 	clear_bit(__ICE_CFG_BUSY, pf->state);