From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7E7E9A0546; Thu, 27 May 2021 10:17:31 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 50B92410F5; Thu, 27 May 2021 10:17:28 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mails.dpdk.org (Postfix) with ESMTP id C2D9B410F0 for ; Thu, 27 May 2021 10:17:27 +0200 (CEST) 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 458E413A1; Thu, 27 May 2021 01:17:27 -0700 (PDT) Received: from net-x86-dell-8268.shanghai.arm.com (net-x86-dell-8268.shanghai.arm.com [10.169.210.132]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 716093F73B; Thu, 27 May 2021 01:17:25 -0700 (PDT) From: Feifei Wang To: Beilei Xing Cc: dev@dpdk.org, nd@arm.com, Feifei Wang , Ruifeng Wang Date: Thu, 27 May 2021 16:17:13 +0800 Message-Id: <20210527081714.1367611-2-feifei.wang2@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210527081714.1367611-1-feifei.wang2@arm.com> References: <20210527081714.1367611-1-feifei.wang2@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v1 1/2] net/i40e: improve performance for scalar Tx 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 Sender: "dev" For i40e scalar Tx path, if implement FAST_FREE_MBUF mode, it means per-queue all mbufs come from the same mempool and have refcnt = 1. Thus we can use bulk free of the buffers when mbuf fast free mode is enabled. For scalar path in arm platform: In n1sdp, performance is improved by 7.8%; In thunderx2, performance is improved by 6.7%. For scalar path in x86 platform, performance is improved by 6%. Suggested-by: Ruifeng Wang Signed-off-by: Feifei Wang --- drivers/net/i40e/i40e_rxtx.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c index 6c58decece..fe7b20f750 100644 --- a/drivers/net/i40e/i40e_rxtx.c +++ b/drivers/net/i40e/i40e_rxtx.c @@ -1295,6 +1295,7 @@ i40e_tx_free_bufs(struct i40e_tx_queue *txq) { struct i40e_tx_entry *txep; uint16_t i; + struct rte_mbuf *free[RTE_I40E_TX_MAX_FREE_BUF_SZ]; if ((txq->tx_ring[txq->tx_next_dd].cmd_type_offset_bsz & rte_cpu_to_le_64(I40E_TXD_QW1_DTYPE_MASK)) != @@ -1308,9 +1309,11 @@ i40e_tx_free_bufs(struct i40e_tx_queue *txq) if (txq->offloads & DEV_TX_OFFLOAD_MBUF_FAST_FREE) { for (i = 0; i < txq->tx_rs_thresh; ++i, ++txep) { - rte_mempool_put(txep->mbuf->pool, txep->mbuf); + free[i] = txep->mbuf; txep->mbuf = NULL; } + rte_mempool_put_bulk(free[0]->pool, (void **)free, + txq->tx_rs_thresh); } else { for (i = 0; i < txq->tx_rs_thresh; ++i, ++txep) { rte_pktmbuf_free_seg(txep->mbuf); -- 2.25.1