From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 0952F1B628 for ; Mon, 23 Oct 2017 16:22:29 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from ophirmu@mellanox.com) with ESMTPS (AES256-SHA encrypted); 23 Oct 2017 16:22:25 +0200 Received: from pegasus05.mtr.labs.mlnx (pegasus05.mtr.labs.mlnx [10.210.16.100]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id v9NEMPqK029180; Mon, 23 Oct 2017 17:22:25 +0300 Received: from pegasus05.mtr.labs.mlnx (localhost [127.0.0.1]) by pegasus05.mtr.labs.mlnx (8.14.7/8.14.7) with ESMTP id v9NEMPlp004883; Mon, 23 Oct 2017 14:22:25 GMT Received: (from root@localhost) by pegasus05.mtr.labs.mlnx (8.14.7/8.14.7/Submit) id v9NEMPrJ004882; Mon, 23 Oct 2017 14:22:25 GMT From: Ophir Munk To: Adrien Mazarguil Cc: dev@dpdk.org, Thomas Monjalon , Olga Shern , Matan Azrad Date: Mon, 23 Oct 2017 14:21:58 +0000 Message-Id: <1508768520-4810-6-git-send-email-ophirmu@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1508768520-4810-1-git-send-email-ophirmu@mellanox.com> References: <1508752838-30408-1-git-send-email-ophirmu@mellanox.com> <1508768520-4810-1-git-send-email-ophirmu@mellanox.com> Subject: [dpdk-dev] [PATCH v2 5/7] net/mlx4: remove unnecessary variables in Tx burst X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Oct 2017 14:22:30 -0000 From: Matan Azrad Remove usage of variables which doesn't add new information for performance improvement. Signed-off-by: Matan Azrad --- drivers/net/mlx4/mlx4_rxtx.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/net/mlx4/mlx4_rxtx.c b/drivers/net/mlx4/mlx4_rxtx.c index 014a6d3..e8d9a35 100644 --- a/drivers/net/mlx4/mlx4_rxtx.c +++ b/drivers/net/mlx4/mlx4_rxtx.c @@ -285,8 +285,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; struct mlx4_sq *sq = &txq->msq; @@ -498,8 +496,7 @@ mlx4_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n) MLX4_BIT_WQE_OWN : 0)); sq->head += nr_txbbs; elt->buf = buf; - bytes_sent += buf->pkt_len; - ++elts_comp; + txq->stats.obytes += buf->pkt_len; elts_head = elts_head_next; } /* Take a shortcut if nothing must be sent. */ @@ -507,13 +504,12 @@ mlx4_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n) return 0; /* Increment send statistics counters. */ txq->stats.opackets += i; - txq->stats.obytes += bytes_sent; /* Make sure that descriptors are written before doorbell record. */ rte_wmb(); /* 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; } -- 2.7.4