[PATCH] eal/arm: replace RTE_BUILD_BUG on non-constant
Wathsala Wathawana Vithanage
wathsala.vithanage at arm.com
Sat May 11 18:48:56 CEST 2024
> Subject: [PATCH] eal/arm: replace RTE_BUILD_BUG on non-constant
>
> 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.
Use of wfe based rte_wait_until_equal_ implementations had performance issues
when used in lock free data structures like rte_ring.
To prevent these functions from getting included RTE_ARM_USE_WFE was
introduced some time back and this issue has been hiding so far because of that.
Solution looks good to me.
>
> ../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 at bytedance.com>
Acked-by: Wathsala Vithanage <wathsala.vithanage at arm.com>
More information about the dev
mailing list