From patchwork Mon Dec 20 05:50:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Feifei Wang X-Patchwork-Id: 105271 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B5703A034C; Mon, 20 Dec 2021 06:50:55 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F231241154; Mon, 20 Dec 2021 06:50:52 +0100 (CET) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mails.dpdk.org (Postfix) with ESMTP id 9A72341151 for ; Mon, 20 Dec 2021 06:50:51 +0100 (CET) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 13D8D1042; Sun, 19 Dec 2021 21:50:51 -0800 (PST) Received: from net-x86-dell-8268.shanghai.arm.com (net-x86-dell-8268.shanghai.arm.com [10.169.210.123]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 3FA173F5A1; Sun, 19 Dec 2021 21:50:49 -0800 (PST) From: Feifei Wang To: Beilei Xing Cc: dev@dpdk.org, nd@arm.com, Feifei Wang , Ruifeng Wang Subject: [PATCH 1/3] net/i40e: reduce redundant store operation Date: Mon, 20 Dec 2021 13:50:37 +0800 Message-Id: <20211220055039.4035627-2-feifei.wang2@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211220055039.4035627-1-feifei.wang2@arm.com> References: <20211220055039.4035627-1-feifei.wang2@arm.com> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org For free buffer operation in i40e driver, it is unnecessary to store 'NULL' into txep.mbuf. This is because when putting mbuf into Tx queue, tx_tail is the sentinel. And when doing tx_free, tx_next_dd is the sentinel. In all processes, mbuf==NULL is not a condition in check. Thus reset of mbuf is unnecessary and can be omitted. Signed-off-by: Feifei Wang Reviewed-by: Ruifeng Wang --- drivers/net/i40e/i40e_rxtx.c | 3 --- drivers/net/i40e/i40e_rxtx_vec_common.h | 1 - 2 files changed, 4 deletions(-) diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c index e4cb33dc3c..4de2be53e6 100644 --- a/drivers/net/i40e/i40e_rxtx.c +++ b/drivers/net/i40e/i40e_rxtx.c @@ -1344,7 +1344,6 @@ i40e_tx_free_bufs(struct i40e_tx_queue *txq) for (j = 0; j != k; j += RTE_I40E_TX_MAX_FREE_BUF_SZ) { for (i = 0; i < RTE_I40E_TX_MAX_FREE_BUF_SZ; ++i, ++txep) { free[i] = txep->mbuf; - txep->mbuf = NULL; } rte_mempool_put_bulk(free[0]->pool, (void **)free, RTE_I40E_TX_MAX_FREE_BUF_SZ); @@ -1354,14 +1353,12 @@ i40e_tx_free_bufs(struct i40e_tx_queue *txq) if (m) { for (i = 0; i < m; ++i, ++txep) { free[i] = txep->mbuf; - txep->mbuf = NULL; } rte_mempool_put_bulk(free[0]->pool, (void **)free, m); } } else { for (i = 0; i < txq->tx_rs_thresh; ++i, ++txep) { rte_pktmbuf_free_seg(txep->mbuf); - txep->mbuf = NULL; } } diff --git a/drivers/net/i40e/i40e_rxtx_vec_common.h b/drivers/net/i40e/i40e_rxtx_vec_common.h index f9a7f46550..26deb59fc4 100644 --- a/drivers/net/i40e/i40e_rxtx_vec_common.h +++ b/drivers/net/i40e/i40e_rxtx_vec_common.h @@ -103,7 +103,6 @@ i40e_tx_free_bufs(struct i40e_tx_queue *txq) if (txq->offloads & RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE) { for (i = 0; i < n; i++) { free[i] = txep[i].mbuf; - txep[i].mbuf = NULL; } rte_mempool_put_bulk(free[0]->pool, (void **)free, n); goto done;