From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 43ACAB51C for ; Sun, 15 Feb 2015 04:16:07 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP; 14 Feb 2015 19:16:05 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,579,1418112000"; d="scan'208";a="454796763" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by FMSMGA003.fm.intel.com with ESMTP; 14 Feb 2015 19:01:13 -0800 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id t1F3G275022497; Sun, 15 Feb 2015 11:16:02 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id t1F3G0iO032058; Sun, 15 Feb 2015 11:16:02 +0800 Received: (from cliang18@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t1F3Fxpn032054; Sun, 15 Feb 2015 11:15:59 +0800 From: Cunming Liang To: dev@dpdk.org Date: Sun, 15 Feb 2015 11:15:28 +0800 Message-Id: <1423970145-31985-3-git-send-email-cunming.liang@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1423970145-31985-1-git-send-email-cunming.liang@intel.com> References: <1423791501-1555-1-git-send-email-cunming.liang@intel.com> <1423970145-31985-1-git-send-email-cunming.liang@intel.com> Subject: [dpdk-dev] [PATCH v7 02/19] eal: fix PAGE_SIZE redefine complaint on freebsd 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: Sun, 15 Feb 2015 03:16:08 -0000 Signed-off-by: Cunming Liang --- lib/librte_eal/bsdapp/eal/eal_memory.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/librte_eal/bsdapp/eal/eal_memory.c b/lib/librte_eal/bsdapp/eal/eal_memory.c index 65ee87d..33ebd0f 100644 --- a/lib/librte_eal/bsdapp/eal/eal_memory.c +++ b/lib/librte_eal/bsdapp/eal/eal_memory.c @@ -45,7 +45,7 @@ #include "eal_internal_cfg.h" #include "eal_filesystem.h" -#define PAGE_SIZE (sysconf(_SC_PAGESIZE)) +#define EAL_PAGE_SIZE (sysconf(_SC_PAGESIZE)) /* * Get physical address of any mapped virtual address in the current process. @@ -93,7 +93,8 @@ rte_eal_contigmem_init(void) char physaddr_str[64]; addr = mmap(NULL, hpi->hugepage_sz, PROT_READ|PROT_WRITE, - MAP_SHARED, hpi->lock_descriptor, j * PAGE_SIZE); + MAP_SHARED, hpi->lock_descriptor, + j * EAL_PAGE_SIZE); if (addr == MAP_FAILED) { RTE_LOG(ERR, EAL, "Failed to mmap buffer %u from %s\n", j, hpi->hugedir); @@ -167,7 +168,8 @@ rte_eal_contigmem_attach(void) struct rte_memseg *seg = &mcfg->memseg[i]; addr = mmap(seg->addr, hpi->hugepage_sz, PROT_READ|PROT_WRITE, - MAP_SHARED|MAP_FIXED, fd_hugepage, i * PAGE_SIZE); + MAP_SHARED|MAP_FIXED, fd_hugepage, + i * EAL_PAGE_SIZE); if (addr == MAP_FAILED || addr != seg->addr) { RTE_LOG(ERR, EAL, "Failed to mmap buffer %u from %s\n", i, hpi->hugedir); -- 1.8.1.4