From: Wei Dai Date: Tue, 25 Oct 2016 15:01:11 +0000 (+0200) Subject: mempool: fix search of maximum contiguous pages X-Git-Tag: spdx-start~5498 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=1e975578bc30a84547b62bd682b03f8f08bf3a38;p=dpdk.git mempool: fix search of maximum contiguous pages paddr[i] + pg_sz always points to the start physical address of the 2nd page after pddr[i], so only up to 2 pages can be combinded to be used. With this revision, more than 2 pages can be used. Fixes: 84121f197187 ("mempool: store memory chunks in a list") Signed-off-by: Wei Dai Signed-off-by: Olivier Matz --- diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c index 71017e1d49..e94e56fcce 100644 --- a/lib/librte_mempool/rte_mempool.c +++ b/lib/librte_mempool/rte_mempool.c @@ -428,7 +428,7 @@ rte_mempool_populate_phys_tab(struct rte_mempool *mp, char *vaddr, /* populate with the largest group of contiguous pages */ for (n = 1; (i + n) < pg_num && - paddr[i] + pg_sz == paddr[i+n]; n++) + paddr[i + n - 1] + pg_sz == paddr[i + n]; n++) ; ret = rte_mempool_populate_phys(mp, vaddr + i * pg_sz,