From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id DB3E16CCC for ; Thu, 13 Oct 2016 11:46:28 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga105.jf.intel.com with ESMTP; 13 Oct 2016 02:46:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,339,1473145200"; d="scan'208";a="1053237135" Received: from amohindr-mobl4.ger.corp.intel.com (HELO [10.252.25.204]) ([10.252.25.204]) by fmsmga001.fm.intel.com with ESMTP; 13 Oct 2016 02:46:26 -0700 To: Wei Dai , dev@dpdk.org, jianfeng.tan@intel.com, Olivier MATZ References: <1476351445-18102-1-git-send-email-wei.dai@intel.com> From: Sergio Gonzalez Monroy Message-ID: Date: Thu, 13 Oct 2016 10:46:25 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <1476351445-18102-1-git-send-email-wei.dai@intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] mempool: fix search of maximum contiguous pages 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: Thu, 13 Oct 2016 09:46:29 -0000 +Olivier On 13/10/2016 10:37, Wei Dai wrote: > 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 > --- > lib/librte_mempool/rte_mempool.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c > index 71017e1..e3e254a 100644 > --- a/lib/librte_mempool/rte_mempool.c > +++ b/lib/librte_mempool/rte_mempool.c > @@ -426,9 +426,12 @@ rte_mempool_populate_phys_tab(struct rte_mempool *mp, char *vaddr, > > for (i = 0; i < pg_num && mp->populated_size < mp->size; i += n) { > > + phys_addr_t paddr_next; > + paddr_next = paddr[i] + pg_sz; > + > /* populate with the largest group of contiguous pages */ > for (n = 1; (i + n) < pg_num && > - paddr[i] + pg_sz == paddr[i+n]; n++) > + paddr_next == paddr[i+n]; n++, paddr_next += pg_sz) > ; > > ret = rte_mempool_populate_phys(mp, vaddr + i * pg_sz,