On Thu, May 2, 2024 at 4:22 PM Daniel Gregory
<daniel.greg...@bytedance.com> wrote:
>
> 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.greg...@bytedance.com>

- RTE_BUILD_BUG_ON() should not be used indeed.
IIRC, this issue was introduced with 875f350924b8 ("eal: add a new
helper for wait until scheme").
Please add a corresponding Fixes: tag in next revision.

Rather than use RTE_ASSERT(), you can simply revert to a assert()
call, like what was done before this change (and this is what is done
for the non WFE/generic implementation too, see
lib/eal/include/generic/rte_pause.h).


- This ARM specific implementation should take a rte_memory_order type
instead of a int type for the memorder input variable.
This was missed in 1ec6a845b5cb ("eal: use stdatomic API in public headers").

Could you send a fix for this small issue too?


Thanks!

-- 
David Marchand

Reply via email to