From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 5EC7810A3 for ; Tue, 26 Mar 2019 04:31:42 +0100 (CET) X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Mar 2019 20:31:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,271,1549958400"; d="scan'208";a="128654355" Received: from yexl-server.sh.intel.com (HELO localhost) ([10.67.110.206]) by orsmga008.jf.intel.com with ESMTP; 25 Mar 2019 20:31:34 -0700 Date: Tue, 26 Mar 2019 11:27:15 +0800 From: Ye Xiaolong To: Andrew Rybchenko Cc: dev@dpdk.org, David Marchand , Qi Zhang , Karlsson Magnus , Topel Bjorn , Maxime Coquelin , Stephen Hemminger , Ferruh Yigit , Luca Boccassi , Bruce Richardson , Ananyev Konstantin , Olivier Matz Message-ID: <20190326032715.GC48057@intel.com> References: <20190301080947.91086-1-xiaolong.ye@intel.com> <20190325060400.40291-1-xiaolong.ye@intel.com> <20190325060400.40291-4-xiaolong.ye@intel.com> <3ee92f43-eabf-7a97-dc3a-3669023edeff@solarflare.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3ee92f43-eabf-7a97-dc3a-3669023edeff@solarflare.com> User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [dpdk-dev] [PATCH v5 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: , X-List-Received-Date: Tue, 26 Mar 2019 03:31:42 -0000 On 03/25, Andrew Rybchenko wrote: >On 3/25/19 9:03 AM, Xiaolong Ye wrote: >> 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..171ba1057 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 |= RTE_MEMZONE_IOVA_CONTIG; >> + if (mp->flags & MEMPOOL_F_PAGE_ALIGN) >> + align = RTE_MAX(align, (size_t)getpagesize()); >> + >> mz = rte_memzone_reserve_aligned(mz_name, mem_size, >> mp->socket_id, flags, align); >> diff --git a/lib/librte_mempool/rte_mempool.h b/lib/librte_mempool/rte_mempool.h >> index 7c9cd9a2f..75553b36f 100644 >> --- a/lib/librte_mempool/rte_mempool.h >> +++ b/lib/librte_mempool/rte_mempool.h >> @@ -264,6 +264,7 @@ struct rte_mempool { >> #define MEMPOOL_F_POOL_CREATED 0x0010 /**< Internal: pool is created. */ >> #define MEMPOOL_F_NO_IOVA_CONTIG 0x0020 /**< Don't need IOVA contiguous objs. */ >> #define MEMPOOL_F_NO_PHYS_CONTIG MEMPOOL_F_NO_IOVA_CONTIG /* deprecated */ >> +#define MEMPOOL_F_PAGE_ALIGN 0x0040 /**< Chunk's base address is page aligned */ > >For me it sounds like mempool objects should be page aligned since >MEMPOOL_F_NO_SPREAD, MEMPOOL_F_NO_CACHE_ALIGN and >MEMPOOL_F_NO_IOVA_CONTIG say about object properties, not chunk. > >Personally I doubt that the final goal is just having chunk page aligned. Hmm, how about naming it MEMPOOL_CHUNK_F_PAGE_ALIGN? Thanks, Xiaolong > >Andrew. 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 945DBA05D3 for ; Tue, 26 Mar 2019 04:31:45 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8620111A4; Tue, 26 Mar 2019 04:31:44 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 5EC7810A3 for ; Tue, 26 Mar 2019 04:31:42 +0100 (CET) X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Mar 2019 20:31:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,271,1549958400"; d="scan'208";a="128654355" Received: from yexl-server.sh.intel.com (HELO localhost) ([10.67.110.206]) by orsmga008.jf.intel.com with ESMTP; 25 Mar 2019 20:31:34 -0700 Date: Tue, 26 Mar 2019 11:27:15 +0800 From: Ye Xiaolong To: Andrew Rybchenko Cc: dev@dpdk.org, David Marchand , Qi Zhang , Karlsson Magnus , Topel Bjorn , Maxime Coquelin , Stephen Hemminger , Ferruh Yigit , Luca Boccassi , Bruce Richardson , Ananyev Konstantin , Olivier Matz Message-ID: <20190326032715.GC48057@intel.com> References: <20190301080947.91086-1-xiaolong.ye@intel.com> <20190325060400.40291-1-xiaolong.ye@intel.com> <20190325060400.40291-4-xiaolong.ye@intel.com> <3ee92f43-eabf-7a97-dc3a-3669023edeff@solarflare.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline In-Reply-To: <3ee92f43-eabf-7a97-dc3a-3669023edeff@solarflare.com> User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [dpdk-dev] [PATCH v5 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: <20190326032715.SgeUGqipuIbbR-1TOPRVlXLprpjjmGGxMHuKCAxvPvc@z> On 03/25, Andrew Rybchenko wrote: >On 3/25/19 9:03 AM, Xiaolong Ye wrote: >> 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..171ba1057 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 |= RTE_MEMZONE_IOVA_CONTIG; >> + if (mp->flags & MEMPOOL_F_PAGE_ALIGN) >> + align = RTE_MAX(align, (size_t)getpagesize()); >> + >> mz = rte_memzone_reserve_aligned(mz_name, mem_size, >> mp->socket_id, flags, align); >> diff --git a/lib/librte_mempool/rte_mempool.h b/lib/librte_mempool/rte_mempool.h >> index 7c9cd9a2f..75553b36f 100644 >> --- a/lib/librte_mempool/rte_mempool.h >> +++ b/lib/librte_mempool/rte_mempool.h >> @@ -264,6 +264,7 @@ struct rte_mempool { >> #define MEMPOOL_F_POOL_CREATED 0x0010 /**< Internal: pool is created. */ >> #define MEMPOOL_F_NO_IOVA_CONTIG 0x0020 /**< Don't need IOVA contiguous objs. */ >> #define MEMPOOL_F_NO_PHYS_CONTIG MEMPOOL_F_NO_IOVA_CONTIG /* deprecated */ >> +#define MEMPOOL_F_PAGE_ALIGN 0x0040 /**< Chunk's base address is page aligned */ > >For me it sounds like mempool objects should be page aligned since >MEMPOOL_F_NO_SPREAD, MEMPOOL_F_NO_CACHE_ALIGN and >MEMPOOL_F_NO_IOVA_CONTIG say about object properties, not chunk. > >Personally I doubt that the final goal is just having chunk page aligned. Hmm, how about naming it MEMPOOL_CHUNK_F_PAGE_ALIGN? Thanks, Xiaolong > >Andrew.