DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] eal/arm: replace RTE_BUILD_BUG on non-constant
@ 2024-05-02 14:21 Daniel Gregory
  2024-05-02 16:20 ` Stephen Hemminger
                   ` (4 more replies)
  0 siblings, 5 replies; 20+ messages in thread
From: Daniel Gregory @ 2024-05-02 14:21 UTC (permalink / raw)
  To: Ruifeng Wang; +Cc: dev, Punit Agrawal, Liang Ma, Daniel Gregory

The ARM implementation of rte_pause uses RTE_BUILD_BUG_ON to check
memorder, which is not constant. This causes compile errors when it is
enabled with RTE_ARM_USE_WFE. eg.

../lib/eal/arm/include/rte_pause_64.h: In function ‘rte_wait_until_equal_16’:
../lib/eal/include/rte_common.h:530:56: error: expression in static assertion is not constant
  530 | #define RTE_BUILD_BUG_ON(condition) do { static_assert(!(condition), #condition); } while (0)
      |                                                        ^~~~~~~~~~~~
../lib/eal/arm/include/rte_pause_64.h:156:9: note: in expansion of macro ‘RTE_BUILD_BUG_ON’
  156 |         RTE_BUILD_BUG_ON(memorder != rte_memory_order_acquire &&
      |         ^~~~~~~~~~~~~~~~

This has been the case since the switch to C11 assert (537caad2). Fix
the compile errors by replacing the check with an RTE_ASSERT.

Signed-off-by: Daniel Gregory <daniel.gregory@bytedance.com>
---
 lib/eal/arm/include/rte_pause_64.h | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/lib/eal/arm/include/rte_pause_64.h b/lib/eal/arm/include/rte_pause_64.h
index 5cb8b59056..98e10e91c4 100644
--- a/lib/eal/arm/include/rte_pause_64.h
+++ b/lib/eal/arm/include/rte_pause_64.h
@@ -11,6 +11,7 @@ extern "C" {
 #endif
 
 #include <rte_common.h>
+#include <rte_debug.h>
 
 #ifdef RTE_ARM_USE_WFE
 #define RTE_WAIT_UNTIL_EQUAL_ARCH_DEFINED
@@ -153,7 +154,7 @@ rte_wait_until_equal_16(volatile uint16_t *addr, uint16_t expected,
 {
 	uint16_t value;
 
-	RTE_BUILD_BUG_ON(memorder != rte_memory_order_acquire &&
+	RTE_ASSERT(memorder != rte_memory_order_acquire &&
 		memorder != rte_memory_order_relaxed);
 
 	__RTE_ARM_LOAD_EXC_16(addr, value, memorder)
@@ -172,7 +173,7 @@ rte_wait_until_equal_32(volatile uint32_t *addr, uint32_t expected,
 {
 	uint32_t value;
 
-	RTE_BUILD_BUG_ON(memorder != rte_memory_order_acquire &&
+	RTE_ASSERT(memorder != rte_memory_order_acquire &&
 		memorder != rte_memory_order_relaxed);
 
 	__RTE_ARM_LOAD_EXC_32(addr, value, memorder)
@@ -191,7 +192,7 @@ rte_wait_until_equal_64(volatile uint64_t *addr, uint64_t expected,
 {
 	uint64_t value;
 
-	RTE_BUILD_BUG_ON(memorder != rte_memory_order_acquire &&
+	RTE_ASSERT(memorder != rte_memory_order_acquire &&
 		memorder != rte_memory_order_relaxed);
 
 	__RTE_ARM_LOAD_EXC_64(addr, value, memorder)
-- 
2.39.2


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2024-06-27 15:08 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-02 14:21 [PATCH] eal/arm: replace RTE_BUILD_BUG on non-constant Daniel Gregory
2024-05-02 16:20 ` Stephen Hemminger
2024-05-02 17:44   ` Daniel Gregory
2024-05-02 18:27     ` Stephen Hemminger
2024-05-02 21:48     ` Stephen Hemminger
2024-05-03  9:46       ` Daniel Gregory
2024-05-04  0:56         ` Stephen Hemminger
2024-05-09 11:02           ` Daniel Gregory
2024-05-03 13:32 ` David Marchand
2024-05-03 14:21   ` Daniel Gregory
2024-05-03 18:27 ` [PATCH v2] " Daniel Gregory
2024-05-03 18:30   ` Daniel Gregory
2024-05-04  0:59   ` Stephen Hemminger
2024-06-27 15:08     ` Thomas Monjalon
2024-05-06  9:30   ` Ruifeng Wang
2024-05-11 17:00   ` Wathsala Wathawana Vithanage
2024-05-04  1:02 ` [PATCH] " Stephen Hemminger
2024-05-09 11:11   ` Daniel Gregory
2024-05-09 16:47     ` Tyler Retzlaff
2024-05-11 16:48 ` Wathsala Wathawana Vithanage

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).