From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerin Jacob Subject: [PATCH] eal/ppc64: add support for rte pause Date: Sun, 7 Oct 2018 11:48:57 +0530 Message-ID: <20181007061857.29451-1-jerin.jacob@caviumnetworks.com> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 8bit Cc: dev@dpdk.org, thomas@monjalon.net, gowrishankar.m@linux.vnet.ibm.com, ola.liljedahl@arm.com, Jerin Jacob To: Chao Zhu Return-path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0073.outbound.protection.outlook.com [104.47.36.73]) by dpdk.org (Postfix) with ESMTP id 4F64D2C28 for ; Sun, 7 Oct 2018 08:20:03 +0200 (CEST) List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Add support for rte_pause() implementation for ppc64. Signed-off-by: Jerin Jacob --- 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(+) 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 -- 2.19.0