From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 009264558B; Tue, 16 Jul 2024 00:53:17 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BB02340274; Tue, 16 Jul 2024 00:53:17 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mails.dpdk.org (Postfix) with ESMTP id 4CBD840041 for ; Tue, 16 Jul 2024 00:53:16 +0200 (CEST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0E7961063; Mon, 15 Jul 2024 15:53:41 -0700 (PDT) Received: from ampere-altra-2-1.usa.Arm.com (ampere-altra-2-1.usa.arm.com [10.118.91.158]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id B12BF3F762; Mon, 15 Jul 2024 15:53:15 -0700 (PDT) From: Wathsala Vithanage To: dev@dpdk.org, Ruifeng Wang Cc: nd@arm.com, Wathsala Vithanage , Dhruv Tripathi Subject: [PATCH v3 1/4] eal: expand the availability of WFE and related instructions Date: Mon, 15 Jul 2024 22:53:02 +0000 Message-Id: <20240715225305.18563-1-wathsala.vithanage@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240604044401.3577707-1-wathsala.vithanage@arm.com> References: <20240604044401.3577707-1-wathsala.vithanage@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The availability of __RTE_ARM_WFE, __RTE_ARM_SEV, __RTE_ARM_SEVL, and __RTE_ARM_LOAD_EXC_* macros for other applications, such as PMD power management, should not depend on the choice of use of these instructions in rte_wait_until_equal_N functions. Therefore, this patch moves these macros out of control of the RTE_WAIT_UNTIL_EQUAL_ARCH_DEFINED macro. Signed-off-by: Wathsala Vithanage Reviewed-by: Dhruv Tripathi --- lib/eal/arm/include/rte_pause_64.h | 4 ++-- lib/eal/arm/rte_cpuflags.c | 4 ++-- lib/eal/arm/rte_power_intrinsics.c | 9 ++++----- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/lib/eal/arm/include/rte_pause_64.h b/lib/eal/arm/include/rte_pause_64.h index 9e2dbf3531..8224f09ba7 100644 --- a/lib/eal/arm/include/rte_pause_64.h +++ b/lib/eal/arm/include/rte_pause_64.h @@ -24,8 +24,6 @@ static inline void rte_pause(void) asm volatile("yield" ::: "memory"); } -#ifdef RTE_WAIT_UNTIL_EQUAL_ARCH_DEFINED - /* Send a local event to quit WFE. */ #define __RTE_ARM_SEVL() { asm volatile("sevl" : : : "memory"); } @@ -148,6 +146,8 @@ static inline void rte_pause(void) __RTE_ARM_LOAD_EXC_128(src, dst, memorder) \ } +#ifdef RTE_WAIT_UNTIL_EQUAL_ARCH_DEFINED + static __rte_always_inline void rte_wait_until_equal_16(volatile uint16_t *addr, uint16_t expected, rte_memory_order memorder) diff --git a/lib/eal/arm/rte_cpuflags.c b/lib/eal/arm/rte_cpuflags.c index 7ba4f8ba97..29884c285f 100644 --- a/lib/eal/arm/rte_cpuflags.c +++ b/lib/eal/arm/rte_cpuflags.c @@ -163,7 +163,7 @@ void rte_cpu_get_intrinsics_support(struct rte_cpu_intrinsics *intrinsics) { memset(intrinsics, 0, sizeof(*intrinsics)); -#ifdef RTE_ARM_USE_WFE +#ifdef RTE_ARCH_64 intrinsics->power_monitor = 1; -#endif +#endif /* RTE_ARCH_64 */ } diff --git a/lib/eal/arm/rte_power_intrinsics.c b/lib/eal/arm/rte_power_intrinsics.c index f54cf59e80..b0056cce8b 100644 --- a/lib/eal/arm/rte_power_intrinsics.c +++ b/lib/eal/arm/rte_power_intrinsics.c @@ -17,7 +17,7 @@ rte_power_monitor(const struct rte_power_monitor_cond *pmc, { RTE_SET_USED(tsc_timestamp); -#ifdef RTE_ARM_USE_WFE +#ifdef RTE_ARCH_64 const unsigned int lcore_id = rte_lcore_id(); uint64_t cur_value; @@ -57,7 +57,7 @@ rte_power_monitor(const struct rte_power_monitor_cond *pmc, RTE_SET_USED(pmc); return -ENOTSUP; -#endif +#endif /* RTE_ARCH_64 */ } /** @@ -81,13 +81,12 @@ rte_power_monitor_wakeup(const unsigned int lcore_id) { RTE_SET_USED(lcore_id); -#ifdef RTE_ARM_USE_WFE +#ifdef RTE_ARCH_64 __RTE_ARM_SEV() - return 0; #else return -ENOTSUP; -#endif +#endif /* RTE_ARCH_64 */ } int -- 2.34.1