From: Nelio Laranjeiro <nelio.laranje...@6wind.com> The number of available entries in TX rings is taken before performing completion, effectively making rings smaller than they are and causing TX performance issues under load.
Fixes: 7fae69eeff13 ("mlx4: new poll mode driver") Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro at 6wind.com> Signed-off-by: Adrien Mazarguil <adrien.mazarguil at 6wind.com> --- drivers/net/mlx4/mlx4.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index 3e05373..4f57e2d 100644 --- a/drivers/net/mlx4/mlx4.c +++ b/drivers/net/mlx4/mlx4.c @@ -1306,7 +1306,6 @@ mlx4_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n) { struct txq *txq = (struct txq *)dpdk_txq; unsigned int elts_head = txq->elts_head; - const unsigned int elts_tail = txq->elts_tail; const unsigned int elts_n = txq->elts_n; unsigned int elts_comp_cd = txq->elts_comp_cd; unsigned int elts_comp = 0; @@ -1316,7 +1315,7 @@ mlx4_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n) assert(elts_comp_cd != 0); txq_complete(txq); - max = (elts_n - (elts_head - elts_tail)); + max = (elts_n - (elts_head - txq->elts_tail)); if (max > elts_n) max -= elts_n; assert(max >= 1); -- 2.1.0