[v13,4/5] net/thunderx: use new API to save cycles on aarch64
diff mbox series

Message ID 1573162528-16230-5-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/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>
Acked-by: Jerin Jacob <jerinj@marvell.com>
---
 drivers/net/thunderx/Makefile     | 1 +
 drivers/net/thunderx/meson.build  | 1 +
 drivers/net/thunderx/nicvf_rxtx.c | 3 +--
 3 files changed, 3 insertions(+), 2 deletions(-)

Patch
diff mbox series

diff --git a/drivers/net/thunderx/Makefile b/drivers/net/thunderx/Makefile
index e6bf497..9e0de10 100644
--- a/drivers/net/thunderx/Makefile
+++ b/drivers/net/thunderx/Makefile
@@ -10,6 +10,7 @@  include $(RTE_SDK)/mk/rte.vars.mk
 LIB = librte_pmd_thunderx_nicvf.a
 
 CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -DALLOW_EXPERIMENTAL_API
 
 LDLIBS += -lm
 LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
diff --git a/drivers/net/thunderx/meson.build b/drivers/net/thunderx/meson.build
index 69819a9..23d9458 100644
--- a/drivers/net/thunderx/meson.build
+++ b/drivers/net/thunderx/meson.build
@@ -4,6 +4,7 @@ 
 subdir('base')
 objs = [base_objs]
 
+allow_experimental_apis = true
 sources = files('nicvf_rxtx.c',
 		'nicvf_ethdev.c',
 		'nicvf_svf.c'
diff --git a/drivers/net/thunderx/nicvf_rxtx.c b/drivers/net/thunderx/nicvf_rxtx.c
index 1c42874..90a6098 100644
--- a/drivers/net/thunderx/nicvf_rxtx.c
+++ b/drivers/net/thunderx/nicvf_rxtx.c
@@ -385,8 +385,7 @@  nicvf_fill_rbdr(struct nicvf_rxq *rxq, int to_fill)
 		ltail++;
 	}
 
-	while (__atomic_load_n(&rbdr->tail, __ATOMIC_RELAXED) != next_tail)
-		rte_pause();
+	rte_wait_until_equal_32(&rbdr->tail, next_tail, __ATOMIC_RELAXED);
 
 	__atomic_store_n(&rbdr->tail, ltail, __ATOMIC_RELEASE);
 	nicvf_addr_write(door, to_fill);