[dpdk-dev] i40e: fix i40e_reset_tx_queue cmd_type_offset_bsz init

Message ID 20141001220021.19571.38617.stgit@jrharri1-fbsd.ch.intel.com (mailing list archive)
State Accepted, archived
Headers

Commit Message

Harris, James R Oct. 1, 2014, 10 p.m. UTC
  Fix the descriptor initialization loop, so that it initializes
the i40e_tx_desc::cmd_type_offset_bsz for the correct index
into the tx_ring array.

Previously it would use the index once to initialize the txd
local variable, then again when setting cmd_type_offset_bsz.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
---
 lib/librte_pmd_i40e/i40e_rxtx.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Zhang, Helin Oct. 9, 2014, 3:29 a.m. UTC | #1
Acked-by: Helin Zhang <helin.zhang@intel.com>


Thanks to James for the good catch!

> -----Original Message-----

> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Jim Harris

> Sent: Thursday, October 2, 2014 6:00 AM

> To: dev@dpdk.org

> Subject: [dpdk-dev] [PATCH] i40e: fix i40e_reset_tx_queue

> cmd_type_offset_bsz init

> 

> Fix the descriptor initialization loop, so that it initializes the

> i40e_tx_desc::cmd_type_offset_bsz for the correct index into the tx_ring array.

> 

> Previously it would use the index once to initialize the txd local variable, then

> again when setting cmd_type_offset_bsz.

> 

> Signed-off-by: Jim Harris <james.r.harris@intel.com>

> ---

>  lib/librte_pmd_i40e/i40e_rxtx.c |    2 +-

>  1 file changed, 1 insertion(+), 1 deletion(-)

> 

> diff --git a/lib/librte_pmd_i40e/i40e_rxtx.c b/lib/librte_pmd_i40e/i40e_rxtx.c

> index 7c5b6a8..2b53677 100644

> --- a/lib/librte_pmd_i40e/i40e_rxtx.c

> +++ b/lib/librte_pmd_i40e/i40e_rxtx.c

> @@ -2072,7 +2072,7 @@ i40e_reset_tx_queue(struct i40e_tx_queue *txq)

>  	for (i = 0; i < txq->nb_tx_desc; i++) {

>  		volatile struct i40e_tx_desc *txd = &txq->tx_ring[i];

> 

> -		txd[i].cmd_type_offset_bsz =

> +		txd->cmd_type_offset_bsz =

>  			rte_cpu_to_le_64(I40E_TX_DESC_DTYPE_DESC_DONE);

>  		txe[i].mbuf =  NULL;

>  		txe[i].last_id = i;
  
Thomas Monjalon Oct. 9, 2014, 7:07 p.m. UTC | #2
> > Fix the descriptor initialization loop, so that it initializes the
> > i40e_tx_desc::cmd_type_offset_bsz for the correct index into the tx_ring array.
> > 
> > Previously it would use the index once to initialize the txd local variable, then
> > again when setting cmd_type_offset_bsz.
> > 
> > Signed-off-by: Jim Harris <james.r.harris@intel.com>
> 
> Acked-by: Helin Zhang <helin.zhang@intel.com>
> 
> Thanks to James for the good catch!

Applied

Thanks
  

Patch

diff --git a/lib/librte_pmd_i40e/i40e_rxtx.c b/lib/librte_pmd_i40e/i40e_rxtx.c
index 7c5b6a8..2b53677 100644
--- a/lib/librte_pmd_i40e/i40e_rxtx.c
+++ b/lib/librte_pmd_i40e/i40e_rxtx.c
@@ -2072,7 +2072,7 @@  i40e_reset_tx_queue(struct i40e_tx_queue *txq)
 	for (i = 0; i < txq->nb_tx_desc; i++) {
 		volatile struct i40e_tx_desc *txd = &txq->tx_ring[i];
 
-		txd[i].cmd_type_offset_bsz =
+		txd->cmd_type_offset_bsz =
 			rte_cpu_to_le_64(I40E_TX_DESC_DTYPE_DESC_DONE);
 		txe[i].mbuf =  NULL;
 		txe[i].last_id = i;