From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id AB484A00E6 for ; Thu, 21 Mar 2019 15:00:57 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D3D891B4CD; Thu, 21 Mar 2019 15:00:56 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 8BA741B4CB for ; Thu, 21 Mar 2019 15:00:54 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Mar 2019 07:00:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,253,1549958400"; d="scan'208";a="143978859" Received: from irsmsx110.ger.corp.intel.com ([163.33.3.25]) by orsmga002.jf.intel.com with ESMTP; 21 Mar 2019 07:00:52 -0700 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.210]) by irsmsx110.ger.corp.intel.com ([169.254.15.102]) with mapi id 14.03.0415.000; Thu, 21 Mar 2019 14:00:51 +0000 From: "Ananyev, Konstantin" To: "Ye, Xiaolong" , "dev@dpdk.org" CC: "Zhang, Qi Z" , "Karlsson, Magnus" , "Topel, Bjorn" , "Ye, Xiaolong" Thread-Topic: [dpdk-dev] [PATCH v3 3/5] lib/mempool: allow page size aligned mempool Thread-Index: AQHU38fN2SUnPv+yIU+lFbJrG52FQaYWG0nQ Date: Thu, 21 Mar 2019 14:00:51 +0000 Message-ID: <2601191342CEEE43887BDE71AB977258013655E515@irsmsx105.ger.corp.intel.com> References: <20190301080947.91086-1-xiaolong.ye@intel.com> <20190321091845.78495-1-xiaolong.ye@intel.com> <20190321091845.78495-4-xiaolong.ye@intel.com> In-Reply-To: <20190321091845.78495-4-xiaolong.ye@intel.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNDBhY2I3OWUtYTMwNy00NjYyLTliYmUtNTkzMDk1N2VhZjM3IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiZEpiVU1cL3YrazRyVE91VktFMTNjMCtkSjhpNndEQ0FmR3VmdWdRN20wK01uMG14U21jT1k2QkZRR0RcL0t1S3U4In0= x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v3 3/5] lib/mempool: allow page size aligned mempool X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Message-ID: <20190321140051.6hprohmhfFptMnEN_M9__CHY-GItw9fiBtYZ3N_Q3LE@z> > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Xiaolong Ye > Sent: Thursday, March 21, 2019 9:19 AM > To: dev@dpdk.org > Cc: Zhang, Qi Z ; Karlsson, Magnus ; Topel, Bjorn ; Ye, > Xiaolong > Subject: [dpdk-dev] [PATCH v3 3/5] lib/mempool: allow page size aligned m= empool >=20 > Allow create a mempool with page size aligned base address. >=20 > Signed-off-by: Qi Zhang > Signed-off-by: Xiaolong Ye > --- > lib/librte_mempool/rte_mempool.c | 3 +++ > lib/librte_mempool/rte_mempool.h | 1 + > 2 files changed, 4 insertions(+) >=20 > diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_me= mpool.c > index 683b216f9..33ab6a2b4 100644 > --- a/lib/librte_mempool/rte_mempool.c > +++ b/lib/librte_mempool/rte_mempool.c > @@ -543,6 +543,9 @@ rte_mempool_populate_default(struct rte_mempool *mp) > if (try_contig) > flags |=3D RTE_MEMZONE_IOVA_CONTIG; >=20 > + if (mp->flags & MEMPOOL_F_PAGE_ALIGN) > + align =3D getpagesize(); > + Might be a bit safer: pg_sz =3D getpagesize(); align =3D RTE_MAX(align, pg_sz); BTW, why do you need it always default page size aligned? Is it for 'external' memory allocation or even for eal hugepages too? Konstantin > mz =3D rte_memzone_reserve_aligned(mz_name, mem_size, > mp->socket_id, flags, align); >=20