From mboxrd@z Thu Jan 1 00:00:00 1970 From: santosh Subject: Re: [PATCH v7 7/8] mempool: introduce block size align flag Date: Mon, 2 Oct 2017 14:05:26 +0530 Message-ID: References: <20170907153042.30890-1-santosh.shukla@caviumnetworks.com> <20171001092902.10842-1-santosh.shukla@caviumnetworks.com> <20171001092902.10842-8-santosh.shukla@caviumnetworks.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: thomas@monjalon.net, jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com To: olivier.matz@6wind.com, dev@dpdk.org Return-path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0082.outbound.protection.outlook.com [104.47.32.82]) by dpdk.org (Postfix) with ESMTP id 22C161B197 for ; Mon, 2 Oct 2017 10:35:48 +0200 (CEST) In-Reply-To: <20171001092902.10842-8-santosh.shukla@caviumnetworks.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Olivier, On Sunday 01 October 2017 02:59 PM, Santosh Shukla wrote: > Some mempool hw like octeontx/fpa block, demands block size > (/total_elem_sz) aligned object start address. > > Introducing an MEMPOOL_F_CAPA_BLK_ALIGNED_OBJECTS flag. > If this flag is set: > - Align object start address(vaddr) to a multiple of total_elt_sz. > - Allocate one additional object. Additional object is needed to make > sure that requested 'n' object gets correctly populated. > > Example: > - Let's say that we get 'x' size of memory chunk from memzone. > - And application has requested 'n' object from mempool. > - Ideally, we start using objects at start address 0 to...(x-block_sz) > for n obj. > - Not necessarily first object address i.e. 0 is aligned to block_sz. > - So we derive 'offset' value for block_sz alignment purpose i.e..'off'. > - That 'off' makes sure that start address of object is blk_sz aligned. > - Calculating 'off' may end up sacrificing first block_sz area of > memzone area x. So total number of the object which can fit in the > pool area is n-1, Which is incorrect behavior. > > Therefore we request one additional object (/block_sz area) from memzone > when MEMPOOL_F_CAPA_BLK_ALIGNED_OBJECTS flag is set. > > Signed-off-by: Santosh Shukla > Signed-off-by: Jerin Jacob > Tested-by: Hemant Agrawal > --- early ping, since we needed this -rc1! Thanks.