From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from proxy.6wind.com (host.76.145.23.62.rev.coltfrance.com [62.23.145.76]) by dpdk.org (Postfix) with ESMTP id ACA952BA1 for ; Mon, 11 Jul 2016 12:20:38 +0200 (CEST) Received: from glumotte.dev.6wind.com (unknown [10.16.0.195]) by proxy.6wind.com (Postfix) with ESMTP id 459DA27D67; Mon, 11 Jul 2016 12:20:38 +0200 (CEST) From: Olivier Matz To: dev@dpdk.org, huilongx.xu@intel.com, waterman.cao@intel.com, yuanhan.liu@intel.com, weichunx.chen@intel.com, yu.y.liu@intel.com Cc: thomas.monjalon@6wind.com Date: Mon, 11 Jul 2016 12:20:28 +0200 Message-Id: <1468232428-24088-5-git-send-email-olivier.matz@6wind.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1468232428-24088-1-git-send-email-olivier.matz@6wind.com> References: <1468232428-24088-1-git-send-email-olivier.matz@6wind.com> Subject: [dpdk-dev] [PATCH 4/4] mempool: fix creation with Xen Dom0 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, 11 Jul 2016 10:20:38 -0000 Restore the use of 2M hugepages when using Xen Dom0 that was dropped during mempool rework. Fixes: c042ba20674a ("mempool: rework support of Xen dom0") Signed-off-by: Olivier Matz --- lib/librte_mempool/rte_mempool.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c index d78d02b..6ec0906 100644 --- a/lib/librte_mempool/rte_mempool.c +++ b/lib/librte_mempool/rte_mempool.c @@ -524,7 +524,11 @@ rte_mempool_populate_default(struct rte_mempool *mp) if (mp->nb_mem_chunks != 0) return -EEXIST; - if (rte_eal_has_hugepages()) { + if (rte_xen_dom0_supported()) { + pg_sz = RTE_PGSIZE_2M; + pg_shift = rte_bsf32(pg_sz); + align = pg_sz; + } else if (rte_eal_has_hugepages()) { pg_shift = 0; /* not needed, zone is physically contiguous */ pg_sz = 0; align = RTE_CACHE_LINE_SIZE; -- 2.8.1