DPDK patches and discussions
 help / color / mirror / Atom feed
* Re: [dpdk-dev] [RFC v2 3/5] ring: use wfe to wait for ring tail update on aarch64
@ 2019-07-20  6:50 Pavan Nikhilesh Bhagavatula
  0 siblings, 0 replies; 2+ messages in thread
From: Pavan Nikhilesh Bhagavatula @ 2019-07-20  6:50 UTC (permalink / raw)
  To: Gavin Hu, dev; +Cc: nd



>-----Original Message-----
>From: dev <dev-bounces@dpdk.org> On Behalf Of Gavin Hu
>Sent: Wednesday, July 3, 2019 2:29 PM
>To: dev@dpdk.org
>Cc: nd@arm.com
>Subject: [dpdk-dev] [RFC v2 3/5] ring: use wfe to wait for ring tail
>update on aarch64

>Instead of polling for tail to be updated, use wfe instruction.
>
>Signed-off-by: Gavin Hu <gavin.hu@arm.com>
>Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
>Reviewed-by: Steve Capper <steve.capper@arm.com>
>Reviewed-by: Ola Liljedahl <ola.liljedahl@arm.com>
>Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>

Tested on octeontx2 board and noticed  2-5% perf improvement

Tested-by: Pavan Nikhilesh <pbhagavatula@marvell.com>

>---
> lib/librte_ring/rte_ring_c11_mem.h | 4 ++--
> lib/librte_ring/rte_ring_generic.h | 3 +--
> 2 files changed, 3 insertions(+), 4 deletions(-)
>
>2.7.4


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [dpdk-dev] [RFC v2 3/5] ring: use wfe to wait for ring tail update on aarch64
  2019-06-30 16:21 ` [dpdk-dev] [RFC " Gavin Hu
@ 2019-07-03  8:58   ` Gavin Hu
  0 siblings, 0 replies; 2+ messages in thread
From: Gavin Hu @ 2019-07-03  8:58 UTC (permalink / raw)
  To: dev; +Cc: nd

Instead of polling for tail to be updated, use wfe instruction.

Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Steve Capper <steve.capper@arm.com>
Reviewed-by: Ola Liljedahl <ola.liljedahl@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 lib/librte_ring/rte_ring_c11_mem.h | 4 ++--
 lib/librte_ring/rte_ring_generic.h | 3 +--
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/lib/librte_ring/rte_ring_c11_mem.h b/lib/librte_ring/rte_ring_c11_mem.h
index 0fb73a3..037811e 100644
--- a/lib/librte_ring/rte_ring_c11_mem.h
+++ b/lib/librte_ring/rte_ring_c11_mem.h
@@ -2,6 +2,7 @@
  *
  * Copyright (c) 2017,2018 HXT-semitech Corporation.
  * Copyright (c) 2007-2009 Kip Macy kmacy@freebsd.org
+ * Copyright (c) 2019 Arm Limited
  * All rights reserved.
  * Derived from FreeBSD's bufring.h
  * Used as BSD-3 Licensed with permission from Kip Macy.
@@ -21,8 +22,7 @@ update_tail(struct rte_ring_headtail *ht, uint32_t old_val, uint32_t new_val,
 	 * we need to wait for them to complete
 	 */
 	if (!single)
-		while (unlikely(ht->tail != old_val))
-			rte_pause();
+		rte_wait_until_equal32(&ht->tail, old_val, __ATOMIC_RELAXED);
 
 	__atomic_store_n(&ht->tail, new_val, __ATOMIC_RELEASE);
 }
diff --git a/lib/librte_ring/rte_ring_generic.h b/lib/librte_ring/rte_ring_generic.h
index 953cdbb..570765c 100644
--- a/lib/librte_ring/rte_ring_generic.h
+++ b/lib/librte_ring/rte_ring_generic.h
@@ -23,8 +23,7 @@ update_tail(struct rte_ring_headtail *ht, uint32_t old_val, uint32_t new_val,
 	 * we need to wait for them to complete
 	 */
 	if (!single)
-		while (unlikely(ht->tail != old_val))
-			rte_pause();
+		rte_wait_until_equal32(&ht->tail, old_val, __ATOMIC_RELAXED);
 
 	ht->tail = new_val;
 }
-- 
2.7.4


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-07-20  6:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-20  6:50 [dpdk-dev] [RFC v2 3/5] ring: use wfe to wait for ring tail update on aarch64 Pavan Nikhilesh Bhagavatula
  -- strict thread matches above, loose matches on Subject: below --
2019-07-03  8:58 [dpdk-dev] [RFC v2 0/5] use WFE for locks and ring " Gavin Hu
2019-06-30 16:21 ` [dpdk-dev] [RFC " Gavin Hu
2019-07-03  8:58   ` [dpdk-dev] [RFC v2 3/5] ring: use wfe to wait for ring tail update " Gavin Hu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).