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 D720642DE6; Thu, 6 Jul 2023 11:20:46 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C343942DB8; Thu, 6 Jul 2023 11:20:46 +0200 (CEST) Received: from forward500a.mail.yandex.net (forward500a.mail.yandex.net [178.154.239.80]) by mails.dpdk.org (Postfix) with ESMTP id 54E4842DB3 for ; Thu, 6 Jul 2023 11:20:45 +0200 (CEST) Received: from mail-nwsmtp-smtp-production-main-68.vla.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-68.vla.yp-c.yandex.net [IPv6:2a02:6b8:c0f:99b:0:640:5ae0:0]) by forward500a.mail.yandex.net (Yandex) with ESMTP id ACBF75EDAE; Thu, 6 Jul 2023 12:20:44 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-68.vla.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id cKQ4knBDX8c0-hJV90bzC; Thu, 06 Jul 2023 12:20:43 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1688635244; bh=oYRbmNzkfqxskwmR6wotiynRbGlik6xf653VXM1v3rk=; h=From:In-Reply-To:Cc:Date:References:To:Subject:Message-ID; b=kAJ88qPO6upzSyuePSxYw9bSKcxyC0Ku3d6EPYVn2v5DewpVMm8M5f7vUVas5YkbE 7BGDyOdXrDON5wEsgw5vuJ4go9bi6zytNqlqc/aQI43HuMg5ChVjjAODm1ya9YOtmV VNsW68En1mOo06qNEXaudbqzCCfP0T1rzftLSsJc= Authentication-Results: mail-nwsmtp-smtp-production-main-68.vla.yp-c.yandex.net; dkim=pass header.i=@yandex.ru Message-ID: <37f1659e-38b0-da4f-17ad-fc860f8654fa@yandex.ru> Date: Thu, 6 Jul 2023 10:20:37 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH v11 2/2] net/i40e: replace put function Content-Language: en-US To: Kamalakshitha Aligeri , honnappa.nagarahalli@arm.com, bruce.richardson@intel.com, beilei.xing@intel.com, Ruifeng.Wang@arm.com, Feifei.Wang2@arm.com, mb@smartsharesystems.com, konstantin.ananyev@huawei.com, thomas@monjalon.net, olivier.matz@6wind.com, andrew.rybchenko@oktetlabs.ru Cc: dev@dpdk.org, nd@arm.com References: <20230224181059.338206-2-kamalakshitha.aligeri@arm.com> <20230705171808.865924-1-kamalakshitha.aligeri@arm.com> <20230705171808.865924-2-kamalakshitha.aligeri@arm.com> From: Konstantin Ananyev In-Reply-To: <20230705171808.865924-2-kamalakshitha.aligeri@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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 05/07/2023 18:18, Kamalakshitha Aligeri пишет: > Integrated zero-copy put API in mempool cache in i40e PMD. > On Ampere Altra server, l3fwd single core's performance improves by 5% > with the new API > > Signed-off-by: Kamalakshitha Aligeri > Reviewed-by: Ruifeng Wang > Reviewed-by: Feifei Wang > --- > .mailmap | 1 + > drivers/net/i40e/i40e_rxtx_vec_common.h | 27 ++++++++++++++++++++----- > 2 files changed, 23 insertions(+), 5 deletions(-) > > diff --git a/.mailmap b/.mailmap > index a9f4f28fba..2581d0efe7 100644 > --- a/.mailmap > +++ b/.mailmap > @@ -677,6 +677,7 @@ Kai Ji > Kaiwen Deng > Kalesh AP > Kamalakannan R > +Kamalakshitha Aligeri > Kamil Bednarczyk > Kamil Chalupnik > Kamil Rytarowski > diff --git a/drivers/net/i40e/i40e_rxtx_vec_common.h b/drivers/net/i40e/i40e_rxtx_vec_common.h > index fe1a6ec75e..35cdb31b2e 100644 > --- a/drivers/net/i40e/i40e_rxtx_vec_common.h > +++ b/drivers/net/i40e/i40e_rxtx_vec_common.h > @@ -95,18 +95,35 @@ i40e_tx_free_bufs(struct i40e_tx_queue *txq) > > n = txq->tx_rs_thresh; > > - /* first buffer to free from S/W ring is at index > - * tx_next_dd - (tx_rs_thresh-1) > - */ > + /* first buffer to free from S/W ring is at index > + * tx_next_dd - (tx_rs_thresh-1) > + */ > txep = &txq->sw_ring[txq->tx_next_dd - (n - 1)]; > > if (txq->offloads & RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE) { > + struct rte_mempool *mp = txep[0].mbuf->pool; > + struct rte_mempool_cache *cache = rte_mempool_default_cache(mp, rte_lcore_id()); > + void **cache_objs; > + > + if (unlikely(!cache)) > + goto fallback; > + > + cache_objs = rte_mempool_cache_zc_put_bulk(cache, mp, n); > + if (unlikely(!cache_objs)) > + goto fallback; > + > for (i = 0; i < n; i++) { > - free[i] = txep[i].mbuf; > + cache_objs[i] = txep[i].mbuf; > /* no need to reset txep[i].mbuf in vector path */ > } > - rte_mempool_put_bulk(free[0]->pool, (void **)free, n); > goto done; > + > +fallback: > + for (i = 0; i < n; i++) > + free[i] = txep[i].mbuf; > + rte_mempool_generic_put(mp, (void **)free, n, cache); > + goto done; > + > } > > m = rte_pktmbuf_prefree_seg(txep[0].mbuf); > -- Acked-by: Konstantin Ananyev > 2.25.1 >