[v13,5/5] event/opdl: use new API to save cycles on aarch64
diff mbox series

Message ID 1573162528-16230-6-git-send-email-david.marchand@redhat.com
State New
Delegated to: David Marchand
Headers show
Series
  • use WFE for aarch64
Related show

Checks

Context Check Description
ci/Intel-compilation fail Compilation issues
ci/travis-robot success Travis build: passed
ci/checkpatch success coding style OK

Commit Message

David Marchand Nov. 7, 2019, 9:35 p.m. UTC
From: Gavin Hu <gavin.hu@arm.com>

Use the new API to wait in low power state instead of continuous
polling to save CPU cycles and power.

Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
---
 drivers/event/opdl/Makefile    | 1 +
 drivers/event/opdl/meson.build | 1 +
 drivers/event/opdl/opdl_ring.c | 5 ++---
 3 files changed, 4 insertions(+), 3 deletions(-)

Patch
diff mbox series

diff --git a/drivers/event/opdl/Makefile b/drivers/event/opdl/Makefile
index bf50a60..72ef07d 100644
--- a/drivers/event/opdl/Makefile
+++ b/drivers/event/opdl/Makefile
@@ -9,6 +9,7 @@  LIB = librte_pmd_opdl_event.a
 # build flags
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 # for older GCC versions, allow us to initialize an event using
 # designated initializers.
 ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)
diff --git a/drivers/event/opdl/meson.build b/drivers/event/opdl/meson.build
index 1fe034e..e67b164 100644
--- a/drivers/event/opdl/meson.build
+++ b/drivers/event/opdl/meson.build
@@ -1,6 +1,7 @@ 
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Luca Boccassi <bluca@debian.org>
 
+allow_experimental_apis = true
 sources = files(
 	'opdl_evdev.c',
 	'opdl_evdev_init.c',
diff --git a/drivers/event/opdl/opdl_ring.c b/drivers/event/opdl/opdl_ring.c
index 06fb5b3..c8d19fe 100644
--- a/drivers/event/opdl/opdl_ring.c
+++ b/drivers/event/opdl/opdl_ring.c
@@ -16,6 +16,7 @@ 
 #include <rte_memcpy.h>
 #include <rte_memory.h>
 #include <rte_memzone.h>
+#include <rte_atomic.h>
 
 #include "opdl_ring.h"
 #include "opdl_log.h"
@@ -474,9 +475,7 @@  opdl_ring_input_multithread(struct opdl_ring *t, const void *entries,
 	/* If another thread started inputting before this one, but hasn't
 	 * finished, we need to wait for it to complete to update the tail.
 	 */
-	while (unlikely(__atomic_load_n(&s->shared.tail, __ATOMIC_ACQUIRE) !=
-			old_head))
-		rte_pause();
+	rte_wait_until_equal_32(&s->shared.tail, old_head, __ATOMIC_ACQUIRE);
 
 	__atomic_store_n(&s->shared.tail, old_head + num_entries,
 			__ATOMIC_RELEASE);