diff mbox

[next,S66,v2,06/11] i40e: remove extraneous loop in i40e_vsi_wait_queues_disabled

Message ID 20170405115103.67374-6-alice.michael@intel.com
State Accepted
Delegated to: Jeff Kirsher
Headers show

Commit Message

Michael, Alice April 5, 2017, 11:50 a.m. UTC
From: Jacob Keller <jacob.e.keller@intel.com>

We can simply check both Tx and Rx queues in a single loop, rather than
repeating the loop twice.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Change-ID: Ic06f26b0e3c2620e0e33c1a2999edda488e647ad
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

Comments

Shannon Nelson April 6, 2017, 4 p.m. UTC | #1
On 4/5/2017 4:50 AM, Alice Michael wrote:
> From: Jacob Keller <jacob.e.keller@intel.com>
>
> We can simply check both Tx and Rx queues in a single loop, rather than
> repeating the loop twice.
>
> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
> Change-ID: Ic06f26b0e3c2620e0e33c1a2999edda488e647ad
> ---
>  drivers/net/ethernet/intel/i40e/i40e_main.c | 10 +++-------
>  1 file changed, 3 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
> index bae5628..da9f0be 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e_main.c
> +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
> @@ -4431,7 +4431,7 @@ static void i40e_pf_unquiesce_all_vsi(struct i40e_pf *pf)
>   * i40e_vsi_wait_queues_disabled - Wait for VSI's queues to be disabled
>   * @vsi: the VSI being configured
>   *
> - * This function waits for the given VSI's queues to be disabled.
> + * Wait until all queues on a given VSI have been disabled.
>   **/
>  static int i40e_vsi_wait_queues_disabled(struct i40e_vsi *vsi)
>  {
> @@ -4440,7 +4440,7 @@ static int i40e_vsi_wait_queues_disabled(struct i40e_vsi *vsi)
>
>  	pf_q = vsi->base_queue;
>  	for (i = 0; i < vsi->num_queue_pairs; i++, pf_q++) {
> -		/* Check and wait for the disable status of the queue */
> +		/* Check and wait for the Tx queue */
>  		ret = i40e_pf_txq_wait(pf, pf_q, false);
>  		if (ret) {
>  			dev_info(&pf->pdev->dev,
> @@ -4448,11 +4448,7 @@ static int i40e_vsi_wait_queues_disabled(struct i40e_vsi *vsi)
>  				 vsi->seid, pf_q);
>  			return ret;
>  		}
> -	}
> -
> -	pf_q = vsi->base_queue;
> -	for (i = 0; i < vsi->num_queue_pairs; i++, pf_q++) {
> -		/* Check and wait for the disable status of the queue */
> +		/* Check and wait for the Tx queue */

s/Tx/Rx/

... but at this point the comments probably aren't even needed as the 
function name makes it rather obvious.

sln

>  		ret = i40e_pf_rxq_wait(pf, pf_q, false);
>  		if (ret) {
>  			dev_info(&pf->pdev->dev,
>
Bowers, AndrewX April 6, 2017, 9:43 p.m. UTC | #2
> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces@lists.osuosl.org] On
> Behalf Of Alice Michael
> Sent: Wednesday, April 5, 2017 4:51 AM
> To: Michael, Alice <alice.michael@intel.com>; intel-wired-
> lan@lists.osuosl.org
> Subject: [Intel-wired-lan] [next S66 v2 06/11] i40e: remove extraneous loop
> in i40e_vsi_wait_queues_disabled
> 
> From: Jacob Keller <jacob.e.keller@intel.com>
> 
> We can simply check both Tx and Rx queues in a single loop, rather than
> repeating the loop twice.
> 
> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
> Change-ID: Ic06f26b0e3c2620e0e33c1a2999edda488e647ad
> ---
>  drivers/net/ethernet/intel/i40e/i40e_main.c | 10 +++-------
>  1 file changed, 3 insertions(+), 7 deletions(-)

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

Patch

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index bae5628..da9f0be 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -4431,7 +4431,7 @@  static void i40e_pf_unquiesce_all_vsi(struct i40e_pf *pf)
  * i40e_vsi_wait_queues_disabled - Wait for VSI's queues to be disabled
  * @vsi: the VSI being configured
  *
- * This function waits for the given VSI's queues to be disabled.
+ * Wait until all queues on a given VSI have been disabled.
  **/
 static int i40e_vsi_wait_queues_disabled(struct i40e_vsi *vsi)
 {
@@ -4440,7 +4440,7 @@  static int i40e_vsi_wait_queues_disabled(struct i40e_vsi *vsi)
 
 	pf_q = vsi->base_queue;
 	for (i = 0; i < vsi->num_queue_pairs; i++, pf_q++) {
-		/* Check and wait for the disable status of the queue */
+		/* Check and wait for the Tx queue */
 		ret = i40e_pf_txq_wait(pf, pf_q, false);
 		if (ret) {
 			dev_info(&pf->pdev->dev,
@@ -4448,11 +4448,7 @@  static int i40e_vsi_wait_queues_disabled(struct i40e_vsi *vsi)
 				 vsi->seid, pf_q);
 			return ret;
 		}
-	}
-
-	pf_q = vsi->base_queue;
-	for (i = 0; i < vsi->num_queue_pairs; i++, pf_q++) {
-		/* Check and wait for the disable status of the queue */
+		/* Check and wait for the Tx queue */
 		ret = i40e_pf_rxq_wait(pf, pf_q, false);
 		if (ret) {
 			dev_info(&pf->pdev->dev,