All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Lu <zlu@ezchip.com>
To: 'Thomas Monjalon' <thomas.monjalon@6wind.com>,
	'Chao Zhu' <chaozhu@linux.vnet.ibm.com>
Cc: dev@dpdk.org
Subject: Re: [PATCH] fm10k: fix the compilation on big endian platforms
Date: Tue, 4 Aug 2015 08:50:05 +0800	[thread overview]
Message-ID: <000101d0ce4f$8abc5140$a034f3c0$@com> (raw)
In-Reply-To: <16563190.8TBxXSHCrU@xps13>

>-----Original Message-----
>From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
>Sent: Monday, August 03, 2015 7:39 PM
>To: Chao Zhu
>Cc: dev@dpdk.org; Zhigang Lu
>Subject: Re: [dpdk-dev] [PATCH] fm10k: fix the compilation on big endian
>platforms
>
>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
definition:
>> >
>> > #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:
>
http://dpdk.org/browse/dpdk/tree/config/defconfig_tile-tilegx-linuxapp-gcc
>#n39
>
http://dpdk.org/browse/dpdk/tree/lib/librte_eal/common/include/arch/tile
>/rte_byteorder.h#n36
>I don't know wether it was for the same reason.

Not really, the reason Tile arch force intrinsics is to reuse some generic
functions in
lib/librte_eal/common/include/generic/, such as
rte_atomic16_cmpset()
rte_atomic16_inc()
rte_spinlock_lock()
....

Thanks
-Zhigang

  reply	other threads:[~2015-08-04  0:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-03  6:31 [PATCH] fm10k: fix the compilation on big endian platforms Chao Zhu
2015-08-03  6:31 ` Chao Zhu
2015-08-03  9:06   ` Thomas Monjalon
2015-08-03 11:32     ` Chao Zhu
2015-08-03 11:38       ` Thomas Monjalon
2015-08-04  0:50         ` Tony Lu [this message]
2015-08-03  8:53 ` Thomas Monjalon
2015-08-03  9:02   ` Chao Zhu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='000101d0ce4f$8abc5140$a034f3c0$@com' \
    --to=zlu@ezchip.com \
    --cc=chaozhu@linux.vnet.ibm.com \
    --cc=dev@dpdk.org \
    --cc=thomas.monjalon@6wind.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.