From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 139917E23 for ; Wed, 3 Dec 2014 18:34:47 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP; 03 Dec 2014 09:05:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,862,1389772800"; d="scan'208";a="424581412" Received: from bricha3-mobl3.ger.corp.intel.com ([10.243.20.33]) by FMSMGA003.fm.intel.com with SMTP; 03 Dec 2014 07:30:14 -0800 Received: by (sSMTP sendmail emulation); Wed, 03 Dec 2014 15:40:30 +0025 Date: Wed, 3 Dec 2014 15:40:29 +0000 From: Bruce Richardson To: Michael Qiu Message-ID: <20141203154029.GA6340@bricha3-MOBL3> References: <1417329845-7482-1-git-send-email-michael.qiu@intel.com> <1417594223-2573-1-git-send-email-michael.qiu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1417594223-2573-1-git-send-email-michael.qiu@intel.com> Organization: Intel Shannon Ltd. User-Agent: Mutt/1.5.23 (2014-03-12) Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v2] Fix two compile issues with i686 platform 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: Wed, 03 Dec 2014 17:34:49 -0000 On Wed, Dec 03, 2014 at 04:10:23PM +0800, Michael Qiu wrote: > lib/librte_eal/linuxapp/eal/eal_memory.c:324:4: error: comparison > is always false due to limited range of data type [-Werror=type-limits] > || (hugepage_sz == RTE_PGSIZE_16G)) { > ^ > cc1: all warnings being treated as errors > > lib/librte_eal/linuxapp/eal/eal.c(461): error #2259: non-pointer > conversion from "long long" to "void *" may lose significant bits > RTE_PTR_ALIGN_CEIL((uintptr_t)addr, RTE_PGSIZE_16M); > > This was introuduced by commit b77b5639: > mem: add huge page sizes for IBM Power > > The root cause is that size_t and uintptr_t are 32-bit in i686 > platform, but RTE_PGSIZE_16M and RTE_PGSIZE_16G are always 64-bit. > > Define RTE_PGSIZE_16G only in 64 bit platform to avoid > this issue. > > Signed-off-by: Michael Qiu Minor comment below. Acked-by: Bruce Richardson > --- > app/test/test_memzone.c | 18 ++++++++++++------ > lib/librte_eal/common/eal_common_memzone.c | 2 ++ > lib/librte_eal/common/include/rte_memory.h | 14 ++++++++------ > lib/librte_eal/linuxapp/eal/eal_memory.c | 12 +++++------- > 4 files changed, 27 insertions(+), 19 deletions(-) > ... snip ... > --- a/lib/librte_eal/common/include/rte_memory.h > +++ b/lib/librte_eal/common/include/rte_memory.h > @@ -53,12 +53,14 @@ extern "C" { > #endif > > enum rte_page_sizes { > - RTE_PGSIZE_4K = 1ULL << 12, > - RTE_PGSIZE_2M = 1ULL << 21, > - RTE_PGSIZE_1G = 1ULL << 30, > - RTE_PGSIZE_64K = 1ULL << 16, > - RTE_PGSIZE_16M = 1ULL << 24, > - RTE_PGSIZE_16G = 1ULL << 34 > + RTE_PGSIZE_4K = 1UL << 12, > + RTE_PGSIZE_2M = 1UL << 21, > + RTE_PGSIZE_1G = 1UL << 30, > + RTE_PGSIZE_64K = 1UL << 16, > + RTE_PGSIZE_16M = 1UL << 24, > +#ifdef RTE_ARCH_64 > + RTE_PGSIZE_16G = 1ULL << 34 you don't need the "LL" here as long type is 64-bits on 64-bit systems. Changing it to 1UL << 34 will keep all entries consistent.