From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 57F5E58EC for ; Thu, 13 Oct 2016 11:59:57 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga104.fm.intel.com with ESMTP; 13 Oct 2016 02:59:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,339,1473145200"; d="scan'208";a="1044109513" Received: from irsmsx152.ger.corp.intel.com ([163.33.192.66]) by orsmga001.jf.intel.com with ESMTP; 13 Oct 2016 02:59:56 -0700 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.196]) by IRSMSX152.ger.corp.intel.com ([169.254.6.13]) with mapi id 14.03.0248.002; Thu, 13 Oct 2016 10:59:43 +0100 From: "Ananyev, Konstantin" To: "Ananyev, Konstantin" , "Dai, Wei" , "dev@dpdk.org" , "Gonzalez Monroy, Sergio" , "Tan, Jianfeng" , "Dai, Wei" Thread-Topic: [dpdk-dev] [PATCH] mempool: fix search of maximum contiguous pages Thread-Index: AQHSJTXDPD+WrgnpgEuIs8aklR5rf6CmI7QggAACadA= Date: Thu, 13 Oct 2016 09:59:43 +0000 Message-ID: <2601191342CEEE43887BDE71AB9772583F0C11A5@irsmsx105.ger.corp.intel.com> References: <1476351445-18102-1-git-send-email-wei.dai@intel.com> <2601191342CEEE43887BDE71AB9772583F0C1178@irsmsx105.ger.corp.intel.com> In-Reply-To: <2601191342CEEE43887BDE71AB9772583F0C1178@irsmsx105.ger.corp.intel.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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:59:57 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Ananyev, Konstantin > Sent: Thursday, October 13, 2016 10:54 AM > To: Dai, Wei ; dev@dpdk.org; Gonzalez Monroy, Sergio <= sergio.gonzalez.monroy@intel.com>; Tan, Jianfeng > ; Dai, Wei > Subject: Re: [dpdk-dev] [PATCH] mempool: fix search of maximum contiguous= pages >=20 > Hi >=20 > > > > 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 =3D 0; i < pg_num && mp->populated_size < mp->size; i +=3D n) = { > > > > + phys_addr_t paddr_next; > > + paddr_next =3D paddr[i] + pg_sz; > > + > > /* populate with the largest group of contiguous pages */ > > for (n =3D 1; (i + n) < pg_num && > > - paddr[i] + pg_sz =3D=3D paddr[i+n]; n++) > > + paddr_next =3D=3D paddr[i+n]; n++, paddr_next +=3D pg_sz) > > ; >=20 > Good catch. > Why not just paddr[i + n - 1] !=3D paddr[i + n]? Sorry, I meant 'paddr[i + n - 1] + pg_sz =3D=3D paddr[i+n]' off course. > Then you don't need extra variable (paddr_next) here. > Konstantin >=20 > > > > ret =3D rte_mempool_populate_phys(mp, vaddr + i * pg_sz, > > -- > > 2.7.4