From: Nelio Laranjeiro Date: Mon, 23 Nov 2015 14:44:48 +0000 (+0100) Subject: mlx5: fix available entries in Tx rings X-Git-Tag: spdx-start~7983 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=4f52bbfb0e1aa91ea388db10abda78eab7b0b1df;p=dpdk.git mlx5: fix available entries in Tx rings 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: 2e22920b85d9 ("mlx5: support non-scattered Tx and Rx") Signed-off-by: Nelio Laranjeiro Signed-off-by: Adrien Mazarguil --- diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c index eb6c9f77a9..fa5e6480bb 100644 --- a/drivers/net/mlx5/mlx5_rxtx.c +++ b/drivers/net/mlx5/mlx5_rxtx.c @@ -436,7 +436,6 @@ mlx5_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; @@ -446,7 +445,7 @@ mlx5_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);