From: Matan Azrad Date: Thu, 2 Nov 2017 16:42:48 +0000 (+0000) Subject: net/mlx4: remove duplicate handling in Tx burst X-Git-Tag: spdx-start~950 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=4d8e284df295741e4b30d96ac0552b7b8669a3f0;p=dpdk.git net/mlx4: remove duplicate handling in Tx burst Remove usage of variable which count the packets for completion and doesn't add more information than packets counter. Remove no space in elements ring check which is already covered by regular Tx flow. Signed-off-by: Matan Azrad Acked-by: Adrien Mazarguil --- diff --git a/drivers/net/mlx4/mlx4_rxtx.c b/drivers/net/mlx4/mlx4_rxtx.c index e0afbea201..abd125facf 100644 --- a/drivers/net/mlx4/mlx4_rxtx.c +++ b/drivers/net/mlx4/mlx4_rxtx.c @@ -256,7 +256,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_n = txq->elts_n; - unsigned int elts_comp = 0; unsigned int bytes_sent = 0; unsigned int i; unsigned int max; @@ -272,8 +271,6 @@ mlx4_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n) assert(max <= elts_n); /* Always leave one free entry in the ring. */ --max; - if (max == 0) - return 0; if (max > pkts_n) max = pkts_n; for (i = 0; (i != max); ++i) { @@ -472,7 +469,6 @@ mlx4_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n) sq->head += nr_txbbs; elt->buf = buf; bytes_sent += buf->pkt_len; - ++elts_comp; elts_head = elts_head_next; } /* Take a shortcut if nothing must be sent. */ @@ -486,7 +482,7 @@ mlx4_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n) /* Ring QP doorbell. */ rte_write32(txq->msq.doorbell_qpn, txq->msq.db); txq->elts_head = elts_head; - txq->elts_comp += elts_comp; + txq->elts_comp += i; return i; }