From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Rybchenko Subject: Re: [PATCH v1 3/9] mempool: remove callback to get capabilities Date: Wed, 14 Mar 2018 19:12:27 +0300 Message-ID: <72792bc9-8e64-9a18-ce6c-ffd6777f1748@solarflare.com> References: <1516713372-10572-1-git-send-email-arybchenko@solarflare.com> <1520696382-16400-1-git-send-email-arybchenko@solarflare.com> <1520696382-16400-4-git-send-email-arybchenko@solarflare.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit Cc: Olivier MATZ To: "Burakov, Anatoly" , Return-path: Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [67.231.154.164]) by dpdk.org (Postfix) with ESMTP id 2604C6833 for ; Wed, 14 Mar 2018 17:12:36 +0100 (CET) In-Reply-To: Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 03/14/2018 05:40 PM, Burakov, Anatoly wrote: > On 10-Mar-18 3:39 PM, Andrew Rybchenko wrote: >> The callback was introduced to let generic code to know octeontx >> mempool driver requirements to use single physically contiguous >> memory chunk to store all objects and align object address to >> total object size. Now these requirements are met using a new >> callbacks to calculate required memory chunk size and to populate >> objects using provided memory chunk. >> >> These capability flags are not used anywhere else. >> >> Restricting capabilities to flags is not generic and likely to >> be insufficient to describe mempool driver features. If required >> in the future, API which returns structured information may be >> added. >> >> Signed-off-by: Andrew Rybchenko >> --- > > Just a general comment - it is not enough to describe minimum memchunk > requirements. With memory hotplug patchset that's hopefully getting > merged in 18.05, memzones will no longer be guaranteed to be > IOVA-contiguous. So, if a driver requires its mempool to not only be > populated from a single memzone, but a single *physically contiguous* > memzone, going by only callbacks will not do, because whether or not > something should be a single memzone says nothing about whether this > memzone has to also be IOVA-contiguous. > > So i believe this needs to stay in one form or another. > > (also it would be nice to have a flag that a user could pass to > mempool_create that would force memzone reservation be > IOVA-contiguous, but that's a topic for another conversation. prime > user for this would be KNI.) I think that min_chunk_size should be treated as IOVA-contiguous. So, we have 4 levels:  - MEMPOOL_F_NO_PHYS_CONTIG (min_chunk_size == 0) -- IOVA-congtiguous is not required at all  - no MEMPOOL_F_NO_PHYS_CONTIG (min_chunk_size == total_obj_size) -- object should be IOVA-contiguous  - min_chunk_size > total_obj_size  -- group of objects should be IOVA-contiguous  - min_chunk_size == -- all objects should be IOVA-contiguous If so, how allocation should be implemented?  1. if (min_chunk_size > min_page_size)     a. try all contiguous     b. if cannot, do by mem_chunk_size contiguous  2. else allocate non-contiguous -- Andrew.