From: Nelio Laranjeiro Date: Mon, 23 Nov 2015 14:44:41 +0000 (+0100) Subject: mlx4: fix available entries in Tx rings X-Git-Tag: spdx-start~7984 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=cacd65c8bb073fd46eee9b8deed582b01be610e6;p=dpdk.git mlx4: 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: 7fae69eeff13 ("mlx4: new poll mode driver") Signed-off-by: Nelio Laranjeiro Signed-off-by: Adrien Mazarguil --- diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index 3e05373b5e..4f57e2d74d 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);