From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com [209.85.212.174]) by dpdk.org (Postfix) with ESMTP id 68799C3C4 for ; Mon, 3 Aug 2015 13:39:59 +0200 (CEST) Received: by wibxm9 with SMTP id xm9so117324456wib.0 for ; Mon, 03 Aug 2015 04:39:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=dpAbY/NqUw8vA3/eDYcFAQhKOcx/cnmBYNKRbELw3+Q=; b=kBbe/2eIOL7lzy3uBkOxLpmKVeMU4zOOXeIl7lhCIZEE+RaR12pdvxj4RIIXIM1VNY xp/SUfSgln2ej+kuRpjfDESElT9ZPXUyb6c3CRNyQ4nAl7cpLLt5H8PUPDl3yVlfWvL7 qp7qOQudoa5ptfwiIk3yD0Bvk7ObvAOhIdhJpMdweX0aVtTxvDQBM4hV2eKNns1DV0i1 sE9aLZVEbZON30SgBbpc0eqJpntRc6j7LsO9NLaNtm8Xio4RhhQDlnjAB3dbofJkRWtb RHrk9Uav+sBhuSeISmipuKRELhaZCbgjIqs3qd+T3NtFRrbfpFLfMazw4clXfh8gl2+I YosQ== X-Gm-Message-State: ALoCoQlIJiGrqOEKEP/P8/6bakXVBndnSJJ3GHe4FqGOHeOh3dSojVL3dz1xnhadX8au8D39q4wS X-Received: by 10.194.191.164 with SMTP id gz4mr33111537wjc.21.1438601999035; Mon, 03 Aug 2015 04:39:59 -0700 (PDT) Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by smtp.gmail.com with ESMTPSA id kb1sm22471016wjc.24.2015.08.03.04.39.57 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Aug 2015 04:39:58 -0700 (PDT) From: Thomas Monjalon To: Chao Zhu Date: Mon, 03 Aug 2015 13:38:44 +0200 Message-ID: <16563190.8TBxXSHCrU@xps13> Organization: 6WIND User-Agent: KMail/4.14.8 (Linux/4.0.4-2-ARCH; KDE/4.14.8; x86_64; ; ) In-Reply-To: <55BF5161.3000904@linux.vnet.ibm.com> References: <1438583517-19035-1-git-send-email-chaozhu@linux.vnet.ibm.com> <1533915.C0IUmFEqd8@xps13> <55BF5161.3000904@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH] fm10k: fix the compilation on big endian platforms X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Aug 2015 11:39:59 -0000 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.