summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatan Azrad <matan@mellanox.com>2017-11-10 08:27:18 +0000
committerThomas Monjalon <thomas@monjalon.net>2017-11-11 15:54:16 +0100
commit46d7b08b9162e6c896a9fa2b29b362ce7e8b1be8 (patch)
treeb44f646921a121f20332c8dc31a9be01f832272a
parent9a82633c27cdfbc33e34876dff41abdbfa71bb97 (diff)
downloaddpdk-46d7b08b9162e6c896a9fa2b29b362ce7e8b1be8.zip
dpdk-46d7b08b9162e6c896a9fa2b29b362ce7e8b1be8.tar.gz
dpdk-46d7b08b9162e6c896a9fa2b29b362ce7e8b1be8.tar.xz
net/mlx4: fix missing stamp during Tx completion
After processing completed packets, the owner bit of each TXBB comprised in its WQEs must be invalidated. The loop stops short of processing the last WQE. Fixes: c3c977bbecbd ("net/mlx4: add Tx bypassing Verbs") Signed-off-by: Matan Azrad <matan@mellanox.com> Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
-rw-r--r--drivers/net/mlx4/mlx4_rxtx.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/net/mlx4/mlx4_rxtx.c b/drivers/net/mlx4/mlx4_rxtx.c
index 06f57cc..2bfa8b1 100644
--- a/drivers/net/mlx4/mlx4_rxtx.c
+++ b/drivers/net/mlx4/mlx4_rxtx.c
@@ -336,6 +336,7 @@ mlx4_txq_complete(struct txq *txq, const unsigned int elts_n,
{
unsigned int elts_comp = txq->elts_comp;
unsigned int elts_tail = txq->elts_tail;
+ unsigned int sq_tail = sq->tail;
struct mlx4_cq *cq = &txq->mcq;
volatile struct mlx4_cqe *cqe;
uint32_t cons_index = cq->cons_index;
@@ -372,13 +373,13 @@ mlx4_txq_complete(struct txq *txq, const unsigned int elts_n,
rte_be_to_cpu_16(cqe->wqe_index) & sq->txbb_cnt_mask;
do {
/* Free next descriptor. */
- nr_txbbs +=
+ sq_tail += nr_txbbs;
+ nr_txbbs =
mlx4_txq_stamp_freed_wqe(sq,
- (sq->tail + nr_txbbs) & sq->txbb_cnt_mask,
- !!((sq->tail + nr_txbbs) & sq->txbb_cnt));
+ sq_tail & sq->txbb_cnt_mask,
+ !!(sq_tail & sq->txbb_cnt));
pkts++;
- } while (((sq->tail + nr_txbbs) & sq->txbb_cnt_mask) !=
- new_index);
+ } while ((sq_tail & sq->txbb_cnt_mask) != new_index);
cons_index++;
} while (1);
if (unlikely(pkts == 0))
@@ -386,7 +387,7 @@ mlx4_txq_complete(struct txq *txq, const unsigned int elts_n,
/* Update CQ. */
cq->cons_index = cons_index;
*cq->set_ci_db = rte_cpu_to_be_32(cq->cons_index & MLX4_CQ_DB_CI_MASK);
- sq->tail = sq->tail + nr_txbbs;
+ sq->tail = sq_tail + nr_txbbs;
/* Update the list of packets posted for transmission. */
elts_comp -= pkts;
assert(elts_comp <= txq->elts_comp);