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 B099EA00E6 for ; Thu, 21 Mar 2019 15:24:14 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DBC041B4F7; Thu, 21 Mar 2019 15:24:13 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 2B6D01B4EB for ; Thu, 21 Mar 2019 15:24:11 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Mar 2019 07:24:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,253,1549958400"; d="scan'208";a="153833501" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga002.fm.intel.com with ESMTP; 21 Mar 2019 07:24:11 -0700 Received: from fmsmsx119.amr.corp.intel.com (10.18.124.207) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 21 Mar 2019 07:24:08 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX119.amr.corp.intel.com (10.18.124.207) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 21 Mar 2019 07:24:07 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.134]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.158]) with mapi id 14.03.0415.000; Thu, 21 Mar 2019 22:23:47 +0800 From: "Zhang, Qi Z" To: "Ananyev, Konstantin" , "Ye, Xiaolong" , "dev@dpdk.org" CC: "Karlsson, Magnus" , "Topel, Bjorn" , "Ye, Xiaolong" Thread-Topic: [dpdk-dev] [PATCH v3 3/5] lib/mempool: allow page size aligned mempool Thread-Index: AQHU3+6A2cB9f/LSl06epXCaxqOsUaYWHfRg Date: Thu, 21 Mar 2019 14:23:47 +0000 Message-ID: <039ED4275CED7440929022BC67E706115335089E@SHSMSX103.ccr.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> <2601191342CEEE43887BDE71AB977258013655E515@irsmsx105.ger.corp.intel.com> In-Reply-To: <2601191342CEEE43887BDE71AB977258013655E515@irsmsx105.ger.corp.intel.com> Accept-Language: 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: [10.239.127.40] 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: <20190321142347.yYPMLL2dpU94_toXi0M9l5K6a7McL85bzA1X9GzcFyY@z> > -----Original Message----- > From: Ananyev, Konstantin > Sent: Thursday, March 21, 2019 10:01 PM > To: Ye, Xiaolong ; dev@dpdk.org > Cc: Zhang, Qi Z ; Karlsson, Magnus > ; Topel, Bjorn ; Ye, > Xiaolong > Subject: RE: [dpdk-dev] [PATCH v3 3/5] lib/mempool: allow page size align= ed > mempool >=20 >=20 >=20 > > -----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 mempool > > > > Allow create a mempool with page size aligned base address. > > > > 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(+) > > > > diff --git a/lib/librte_mempool/rte_mempool.c > > b/lib/librte_mempool/rte_mempool.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; > > > > + if (mp->flags & MEMPOOL_F_PAGE_ALIGN) > > + align =3D getpagesize(); > > + >=20 > Might be a bit safer: > pg_sz =3D getpagesize(); > align =3D RTE_MAX(align, pg_sz); >=20 > BTW, why do you need it always default page size aligned? > Is it for 'external' memory allocation or even for eal hugepages too? this help us to enable zero copy between xdp umem to mbuf. af_xdp umem require 2K chunk size and also aligned on 2K address,=20 Qi > Konstantin >=20 > > mz =3D rte_memzone_reserve_aligned(mz_name, mem_size, > > mp->socket_id, flags, align); > >