[dpdk-dev] [PATCH 4/4] mempool: fix creation with Xen Dom0

Olivier Matz olivier.matz at 6wind.com
Mon Jul 11 12:20:28 CEST 2016


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 <olivier.matz at 6wind.com>
---
 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



More information about the dev mailing list