[dpdk-dev] [PATCH v1] eal/arm: fix gcc build for 128-bit atomic compare exchange

Joyce Kong Joyce.Kong at arm.com
Thu Jan 21 10:36:15 CET 2021


>-----Original Message-----
>From: David Marchand <david.marchand at redhat.com>
>Sent: Friday, January 15, 2021 11:56 PM
>To: Joyce Kong <Joyce.Kong at arm.com>
>Cc: jerinj at marvell.com; Ruifeng Wang <Ruifeng.Wang at arm.com>; Honnappa
>Nagarahalli <Honnappa.Nagarahalli at arm.com>; dev <dev at dpdk.org>; nd
><nd at arm.com>; dpdk stable <stable at dpdk.org>
>Subject: Re: [PATCH v1] eal/arm: fix gcc build for 128-bit atomic compare
>exchange
>
>On Fri, Jan 15, 2021 at 10:58 AM Joyce Kong <joyce.kong at arm.com> wrote:
>>
>> Compiling with "meson build -Dbuildtype=debug --cross-file
>> config/arm/arm64_thunderx2_linux_gcc" shows the warnings "function
>> returns an aggregate [-Waggregate-return]":
>> ../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h: In function
>> ‘__cas_128_relaxed’:
>> ../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h:81:20:
>> error: function returns an aggregate [-Werror=aggregate-return]
>> __ATOMIC128_CAS_OP(__cas_128_relaxed, "casp")
>>                     ^~~~~~~~~~~~~~~~~
>>
>> Fix the compiling issue by defining __ATOMIC128_CAS_OP as a void
>> function and passing the address pointer into it.
>>
>> Fixes: 7e2c3e17fe2c ("eal/arm64: add 128-bit atomic compare exchange")
>> Cc: stable at dpdk.org
>>
>> Signed-off-by: Joyce Kong <joyce.kong at arm.com>
>
>From my tests, the trigger is when switching to debug.
>The thunderx2 target builds fine for me with debugoptimized.
>I can reproduce the issue too with octeontx2.
>
>What is the common point?
>
>--
>David Marchand

The issue was reported on octeontx2 and discussed in the patch https://patchwork.dpdk.org/patch/84613/, I reproduced the issue on thunderx2.
And this may be because '__cas_128_xxx' returns aggregated data type I think. Returning two separate uint64_t by taking as the pointer may be a solution.


More information about the dev mailing list