[v3,1/2] net/i40e: replace put function

Message ID 20230213181826.145685-2-kamalakshitha.aligeri@arm.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series Integrated mempool cache zero-copy API's |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/iol-testing fail build patch failure

Commit Message

Kamalakshitha Aligeri Feb. 13, 2023, 6:18 p.m. UTC
  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 <kamalakshitha.aligeri@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Feifei Wang <feifei.wang2@arm.com>
---
Link: http://patches.dpdk.org/project/dpdk/patch/20230213122437.122858-1-mb@smartsharesystems.com/

 .mailmap                                |  1 +
 drivers/net/i40e/i40e_rxtx_vec_common.h | 27 ++++++++++++++++++++-----
 2 files changed, 23 insertions(+), 5 deletions(-)

--
2.25.1
  

Comments

Morten Brørup Feb. 14, 2023, 8:50 a.m. UTC | #1
> From: Kamalakshitha Aligeri [mailto:kamalakshitha.aligeri@arm.com]
> Sent: Monday, 13 February 2023 19.18
> 
> 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 <kamalakshitha.aligeri@arm.com>
> Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
> Reviewed-by: Feifei Wang <feifei.wang2@arm.com>
> ---
> Link: http://patches.dpdk.org/project/dpdk/patch/20230213122437.122858-
> 1-mb@smartsharesystems.com/

Reviewed-by: Morten Brørup <mb@smartsharesystems.com>
  
Wenzhuo Lu Feb. 17, 2023, 2:02 a.m. UTC | #2
Hi Kamalakshitha,

> -----Original Message-----
> From: Kamalakshitha Aligeri <kamalakshitha.aligeri@arm.com>
> Sent: Tuesday, February 14, 2023 2:18 AM
> To: Zhang, Yuying <yuying.zhang@intel.com>; Xing, Beilei
> <beilei.xing@intel.com>; Matz, Olivier <olivier.matz@6wind.com>;
> andrew.rybchenko@oktetlabs.ru; Richardson, Bruce
> <bruce.richardson@intel.com>; mb@smartsharesystems.com;
> konstantin.ananyev@huawei.com; Honnappa.Nagarahalli@arm.com;
> ruifeng.wang@arm.com; feifei.wang2@arm.com
> Cc: dev@dpdk.org; nd@arm.com; Kamalakshitha Aligeri
> <kamalakshitha.aligeri@arm.com>
> Subject: [PATCH v3 1/2] net/i40e: replace put function
> 
> 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 <kamalakshitha.aligeri@arm.com>
> Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
> Reviewed-by: Feifei Wang <feifei.wang2@arm.com>
We're trying to check the performance improvement. But met compile failure. The same as CI reported, http://mails.dpdk.org/archives/test-report/2023-February/353245.html.
  
Morten Brørup Feb. 17, 2023, 7:52 a.m. UTC | #3
> From: Lu, Wenzhuo [mailto:wenzhuo.lu@intel.com]
> Sent: Friday, 17 February 2023 03.03
> 
> Hi Kamalakshitha,
> 
> > From: Kamalakshitha Aligeri <kamalakshitha.aligeri@arm.com>
> > Sent: Tuesday, February 14, 2023 2:18 AM
> >
> > 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 <kamalakshitha.aligeri@arm.com>
> > Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
> > Reviewed-by: Feifei Wang <feifei.wang2@arm.com>
> We're trying to check the performance improvement. But met compile
> failure. The same as CI reported, http://mails.dpdk.org/archives/test-
> report/2023-February/353245.html.

It depends on this patch:
https://patchwork.dpdk.org/project/dpdk/patch/20230213122437.122858-1-mb@smartsharesystems.com/

Does anyone know how to formally add such a dependency to the patch description, so the CI can understand it?
  
Ferruh Yigit Feb. 17, 2023, 10:05 a.m. UTC | #4
On 2/17/2023 7:52 AM, Morten Brørup wrote:
>> From: Lu, Wenzhuo [mailto:wenzhuo.lu@intel.com]
>> Sent: Friday, 17 February 2023 03.03
>>
>> Hi Kamalakshitha,
>>
>>> From: Kamalakshitha Aligeri <kamalakshitha.aligeri@arm.com>
>>> Sent: Tuesday, February 14, 2023 2:18 AM
>>>
>>> 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 <kamalakshitha.aligeri@arm.com>
>>> Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
>>> Reviewed-by: Feifei Wang <feifei.wang2@arm.com>
>> We're trying to check the performance improvement. But met compile
>> failure. The same as CI reported, http://mails.dpdk.org/archives/test-
>> report/2023-February/353245.html.
> 
> It depends on this patch:
> https://patchwork.dpdk.org/project/dpdk/patch/20230213122437.122858-1-mb@smartsharesystems.com/
> 
> Does anyone know how to formally add such a dependency to the patch description, so the CI can understand it?
> 

Hi Morten,

This has been discussed in the past and a syntax defined:
https://doc.dpdk.org/guides/contributing/patches.html#patch-dependencies

But the problem is CI not implemented it yet, it was in the CI backlog
last time I remember but I don't know current status. @Aaron may know.
  
Morten Brørup Feb. 17, 2023, 11:24 a.m. UTC | #5
> From: Ferruh Yigit [mailto:ferruh.yigit@amd.com]
> Sent: Friday, 17 February 2023 11.05
> 
> On 2/17/2023 7:52 AM, Morten Brørup wrote:
> >> From: Lu, Wenzhuo [mailto:wenzhuo.lu@intel.com]
> >> Sent: Friday, 17 February 2023 03.03
> >>
> >> Hi Kamalakshitha,
> >>
> >>> From: Kamalakshitha Aligeri <kamalakshitha.aligeri@arm.com>
> >>> Sent: Tuesday, February 14, 2023 2:18 AM
> >>>
> >>> 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
> <kamalakshitha.aligeri@arm.com>
> >>> Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
> >>> Reviewed-by: Feifei Wang <feifei.wang2@arm.com>
> >> We're trying to check the performance improvement. But met compile
> >> failure. The same as CI reported,
> http://mails.dpdk.org/archives/test-
> >> report/2023-February/353245.html.
> >
> > It depends on this patch:
> > https://patchwork.dpdk.org/project/dpdk/patch/20230213122437.122858-
> 1-mb@smartsharesystems.com/
> >
> > Does anyone know how to formally add such a dependency to the patch
> description, so the CI can understand it?
> >
> 
> Hi Morten,
> 
> This has been discussed in the past and a syntax defined:
> https://doc.dpdk.org/guides/contributing/patches.html#patch-
> dependencies

So for this patch, Kamalakshitha should add the tag:

Depends-on: series-26984 ("[v9] mempool cache: add zero-copy get and put functions")

> 
> But the problem is CI not implemented it yet, it was in the CI backlog
> last time I remember but I don't know current status. @Aaron may know.
  
Aaron Conole Feb. 17, 2023, 2:25 p.m. UTC | #6
Morten Brørup <mb@smartsharesystems.com> writes:

>> From: Ferruh Yigit [mailto:ferruh.yigit@amd.com]
>> Sent: Friday, 17 February 2023 11.05
>> 
>> On 2/17/2023 7:52 AM, Morten Brørup wrote:
>> >> From: Lu, Wenzhuo [mailto:wenzhuo.lu@intel.com]
>> >> Sent: Friday, 17 February 2023 03.03
>> >>
>> >> Hi Kamalakshitha,
>> >>
>> >>> From: Kamalakshitha Aligeri <kamalakshitha.aligeri@arm.com>
>> >>> Sent: Tuesday, February 14, 2023 2:18 AM
>> >>>
>> >>> 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
>> <kamalakshitha.aligeri@arm.com>
>> >>> Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
>> >>> Reviewed-by: Feifei Wang <feifei.wang2@arm.com>
>> >> We're trying to check the performance improvement. But met compile
>> >> failure. The same as CI reported,
>> http://mails.dpdk.org/archives/test-
>> >> report/2023-February/353245.html.
>> >
>> > It depends on this patch:
>> > https://patchwork.dpdk.org/project/dpdk/patch/20230213122437.122858-
>> 1-mb@smartsharesystems.com/
>> >
>> > Does anyone know how to formally add such a dependency to the patch
>> description, so the CI can understand it?
>> >
>> 
>> Hi Morten,
>> 
>> This has been discussed in the past and a syntax defined:
>> https://doc.dpdk.org/guides/contributing/patches.html#patch-
>> dependencies
>
> So for this patch, Kamalakshitha should add the tag:
>
> Depends-on: series-26984 ("[v9] mempool cache: add zero-copy get and put functions")

I think just:

Depends-on: series-26984

In the first patch, or cover letter.  That said, I did a quick test and
the 0day bot should support it now.

>> 
>> But the problem is CI not implemented it yet, it was in the CI backlog
>> last time I remember but I don't know current status. @Aaron may know.
  
Aaron Conole Feb. 17, 2023, 2:25 p.m. UTC | #7
Ferruh Yigit <ferruh.yigit@amd.com> writes:

> On 2/17/2023 7:52 AM, Morten Brørup wrote:
>>> From: Lu, Wenzhuo [mailto:wenzhuo.lu@intel.com]
>>> Sent: Friday, 17 February 2023 03.03
>>>
>>> Hi Kamalakshitha,
>>>
>>>> From: Kamalakshitha Aligeri <kamalakshitha.aligeri@arm.com>
>>>> Sent: Tuesday, February 14, 2023 2:18 AM
>>>>
>>>> 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 <kamalakshitha.aligeri@arm.com>
>>>> Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
>>>> Reviewed-by: Feifei Wang <feifei.wang2@arm.com>
>>> We're trying to check the performance improvement. But met compile
>>> failure. The same as CI reported, http://mails.dpdk.org/archives/test-
>>> report/2023-February/353245.html.
>> 
>> It depends on this patch:
>> https://patchwork.dpdk.org/project/dpdk/patch/20230213122437.122858-1-mb@smartsharesystems.com/
>> 
>> Does anyone know how to formally add such a dependency to the patch
>> description, so the CI can understand it?
>> 
>
> Hi Morten,
>
> This has been discussed in the past and a syntax defined:
> https://doc.dpdk.org/guides/contributing/patches.html#patch-dependencies
>
> But the problem is CI not implemented it yet, it was in the CI backlog
> last time I remember but I don't know current status. @Aaron may know.

I believe it is implemented in 0day and UNH bots.  Not 100% certain on
the UNH side.
  

Patch

diff --git a/.mailmap b/.mailmap
index 75884b6fe2..05a42edbcf 100644
--- a/.mailmap
+++ b/.mailmap
@@ -670,6 +670,7 @@  Kai Ji <kai.ji@intel.com>
 Kaiwen Deng <kaiwenx.deng@intel.com>
 Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
 Kamalakannan R <kamalakannan.r@intel.com>
+Kamalakshitha Aligeri <kamalakshitha.aligeri@arm.com>
 Kamil Bednarczyk <kamil.bednarczyk@intel.com>
 Kamil Chalupnik <kamilx.chalupnik@intel.com>
 Kamil Rytarowski <kamil.rytarowski@caviumnetworks.com>
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);