eal/ppc64: add support for rte pause
diff mbox series

Message ID 20181007061857.29451-1-jerin.jacob@caviumnetworks.com
State Accepted, archived
Delegated to: Thomas Monjalon
Headers show
Series
  • eal/ppc64: add support for rte pause
Related show

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues

Commit Message

Jerin Jacob Oct. 7, 2018, 6:18 a.m. UTC
Add support for rte_pause() implementation for ppc64.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---

The reference implementation for Linux's cpu_relax() for ppc64 is at
https://elixir.bootlin.com/linux/latest/source/arch/powerpc/include/asm/processor.h#L440

---
 lib/librte_eal/common/include/arch/ppc_64/rte_pause.h | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Thomas Monjalon Oct. 26, 2018, 12:41 p.m. UTC | #1
07/10/2018 08:18, Jerin Jacob:
> Add support for rte_pause() implementation for ppc64.
> 
> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>

Acked-by: Chao Zhu <chaozhu@linux.vnet.ibm.com>

Applied, thanks

Patch
diff mbox series

diff --git a/lib/librte_eal/common/include/arch/ppc_64/rte_pause.h b/lib/librte_eal/common/include/arch/ppc_64/rte_pause.h
index 8bd835764..16e47ce22 100644
--- a/lib/librte_eal/common/include/arch/ppc_64/rte_pause.h
+++ b/lib/librte_eal/common/include/arch/ppc_64/rte_pause.h
@@ -9,10 +9,17 @@ 
 extern "C" {
 #endif
 
+#include "rte_atomic.h"
+
 #include "generic/rte_pause.h"
 
 static inline void rte_pause(void)
 {
+	/* Set hardware multi-threading low priority */
+	asm volatile("or 1,1,1");
+	/* Set hardware multi-threading medium priority */
+	asm volatile("or 2,2,2");
+	rte_compiler_barrier();
 }
 
 #ifdef __cplusplus