From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tony Lu Subject: Re: [PATCH] bnx2x: fix undeclared PAGE_SIZE build error Date: Wed, 29 Jul 2015 09:10:47 +0800 Message-ID: <002a01d0c99b$7acb6bd0$70624370$@com> References: <1438073298-24683-1-git-send-email-zlu@ezchip.com> <1777834.Cdb59hv0LG@xps13> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org To: 'Thomas Monjalon' Return-path: Received: from emea01-am1-obe.outbound.protection.outlook.com (mail-am1on0087.outbound.protection.outlook.com [157.56.112.87]) by dpdk.org (Postfix) with ESMTP id 3C25AC534 for ; Wed, 29 Jul 2015 03:11:21 +0200 (CEST) In-Reply-To: <1777834.Cdb59hv0LG@xps13> Content-Language: zh-cn List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" >-----Original Message----- >From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com] >Sent: Tuesday, July 28, 2015 5:18 PM >To: Zhigang Lu >Cc: dev@dpdk.org >Subject: Re: [dpdk-dev] [PATCH] bnx2x: fix undeclared PAGE_SIZE build error > >2015-07-28 16:48, Zhigang Lu: >> This patch fixes a build error caused by undeclared PAGE_SIZE when >> compiling for non-X86 arches. On some arches, PAGE_SIZE is not fixed >> so that header files do not define it. A better way to get it is via >> sysconf(3) or getpagesize(2). >> >> Fixes: 540a211084a7 ("bnx2x: driver core") > >Thanks for fixing it. > >> +#define PAGE_SIZE (sysconf(_SC_PAGESIZE)) > >To avoid conflict with system headers, it would be better to prefix the constant. >Ideally, we should add RTE_PAGESIZE in EAL and cleanup every usage of >sysconf(_SC_PAGESIZE) and getpagesize. Agree, good idea.