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 125A668D9; Tue, 25 Oct 2016 17:01:24 +0200 (CEST) Received: from glumotte.dev.6wind.com (unknown [10.16.0.195]) by proxy.6wind.com (Postfix) with ESMTP id E0B1725C29; Tue, 25 Oct 2016 17:01:20 +0200 (CEST) From: Olivier Matz To: dev@dpdk.org, wei.dai@intel.com Cc: sergio.gonzalez.monroy@intel.com, jianfeng.tan@intel.com, thomas.monjalon@6wind.com, stable@dpdk.org Date: Tue, 25 Oct 2016 17:01:11 +0200 Message-Id: <1477407671-21019-1-git-send-email-olivier.matz@6wind.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1476351445-18102-1-git-send-email-wei.dai@intel.com> References: <1476351445-18102-1-git-send-email-wei.dai@intel.com> Subject: [dpdk-stable] [PATCH v2] mempool: fix search of maximum contiguous pages X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Oct 2016 15:01:24 -0000 From: Wei Dai 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 --- lib/librte_mempool/rte_mempool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c index 71017e1..e94e56f 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, -- 2.8.1