summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorOlivier Matz <olivier.matz@6wind.com>2016-07-11 12:20:28 +0200
committerThomas Monjalon <thomas.monjalon@6wind.com>2016-07-11 19:10:09 +0200
commit4d0c51a85d2b311f0c7ede45e42f3564e489e382 (patch)
tree76ed6ff8d05bfba9ff9b3619133a86ef98f99366 /lib
parent996e86bf2a74b671225d7a59c0d1eddbec881401 (diff)
downloaddpdk-4d0c51a85d2b311f0c7ede45e42f3564e489e382.zip
dpdk-4d0c51a85d2b311f0c7ede45e42f3564e489e382.tar.gz
dpdk-4d0c51a85d2b311f0c7ede45e42f3564e489e382.tar.xz
mempool: fix creation with Xen dom0
Restore the use of 2M hugepages when using Xen Dom0 that was dropped during mempool rework. Fixes: c042ba20674a ("mempool: rework support of Xen dom0") Reported-by: Huilong Xu <huilongx.xu@intel.com> Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/librte_mempool/rte_mempool.c6
1 files changed, 5 insertions, 1 deletions
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;