From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH] bnx2x: fix undeclared PAGE_SIZE build error Date: Tue, 28 Jul 2015 11:17:45 +0200 Message-ID: <1777834.Cdb59hv0LG@xps13> References: <1438073298-24683-1-git-send-email-zlu@ezchip.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org To: Zhigang Lu Return-path: Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com [209.85.212.181]) by dpdk.org (Postfix) with ESMTP id C65B2C536 for ; Tue, 28 Jul 2015 11:19:09 +0200 (CEST) Received: by wibxm9 with SMTP id xm9so147753040wib.0 for ; Tue, 28 Jul 2015 02:19:09 -0700 (PDT) In-Reply-To: <1438073298-24683-1-git-send-email-zlu@ezchip.com> 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" 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.