[dpdk-dev] [PATCH] fm10k: fix the compilation on big endian platforms
zlu at ezchip.com
Tue Aug 4 02:50:05 CEST 2015
>From: Thomas Monjalon [mailto:thomas.monjalon at 6wind.com]
>Sent: Monday, August 03, 2015 7:39 PM
>To: Chao Zhu
>Cc: dev at dpdk.org; Zhigang Lu
>Subject: Re: [dpdk-dev] [PATCH] fm10k: fix the compilation on big endian
>2015-08-03 19:32, Chao Zhu:
>> On 2015/8/3 17:06, Thomas Monjalon wrote:
>> > 2015-08-03 14:31, Chao Zhu:
>> >> The rte_cpu_to_le_32 function can't be used to define const
>> >> variables because it has different implementation on big endian
>> >> platforms. If doing so, it will cause 'initializer element is not
>> >> constant' compiling error. This patch fixes this problem.
>> >> --- a/drivers/net/fm10k/base/fm10k_tlv.c
>> >> +++ b/drivers/net/fm10k/base/fm10k_tlv.c
>> > You cannot change a base driver file except the osdep header where
>> > FM10K_CPU_TO_LE32 is defined.
>> > I don't understand why it doesn't give you a constant, given this
>> > #define rte_bswap32(x) ((uint32_t)(__builtin_constant_p(x) ? \
>> > rte_constant_bswap32(x) : \
>> > rte_arch_bswap32(x)))
>> > Have you tried CONFIG_RTE_FORCE_INTRINSICS=y ?
>> > It should trigger this definition:
>> > #define rte_bswap32(x) __builtin_bswap32(x)
>> Yes. CONFIG_RTE_FORCE_INTRINSICS=y works on Power Big endian. But if
>> I turn off this, the error happens. Seems rte_constant_bswap32
>> doesn't work on Power8? I'll try to check it.
>The tile arch force intrinsics:
>I don't know wether it was for the same reason.
Not really, the reason Tile arch force intrinsics is to reuse some generic
lib/librte_eal/common/include/generic/, such as
More information about the dev