From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.droids-corp.org (zoll.droids-corp.org [94.23.50.67]) by dpdk.org (Postfix) with ESMTP id 342D61AFFC for ; Mon, 19 Mar 2018 18:06:19 +0100 (CET) Received: from lfbn-lil-1-702-109.w81-254.abo.wanadoo.fr ([81.254.39.109] helo=droids-corp.org) by mail.droids-corp.org with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1exyF9-00074R-Pp; Mon, 19 Mar 2018 18:06:50 +0100 Received: by droids-corp.org (sSMTP sendmail emulation); Mon, 19 Mar 2018 18:06:11 +0100 Date: Mon, 19 Mar 2018 18:06:11 +0100 From: Olivier Matz To: Andrew Rybchenko Cc: dev@dpdk.org Message-ID: <20180319170611.bhwvmompxjfw3cdt@platinum> 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=us-ascii Content-Disposition: inline In-Reply-To: <1520696382-16400-4-git-send-email-arybchenko@solarflare.com> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [dpdk-dev] [PATCH v1 3/9] mempool: remove callback to get capabilities 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: Mon, 19 Mar 2018 17:06:19 -0000 On Sat, Mar 10, 2018 at 03:39:36PM +0000, 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 Looks fine... > --- a/drivers/mempool/octeontx/rte_mempool_octeontx.c > +++ b/drivers/mempool/octeontx/rte_mempool_octeontx.c > @@ -126,14 +126,29 @@ octeontx_fpavf_get_count(const struct rte_mempool *mp) > return octeontx_fpa_bufpool_free_count(pool); > } > > -static int > -octeontx_fpavf_get_capabilities(const struct rte_mempool *mp, > - unsigned int *flags) > +static ssize_t > +octeontx_fpavf_calc_mem_size(const struct rte_mempool *mp, > + uint32_t obj_num, uint32_t pg_shift, > + size_t *min_chunk_size, size_t *align) > { > - RTE_SET_USED(mp); > - *flags |= (MEMPOOL_F_CAPA_PHYS_CONTIG | > - MEMPOOL_F_CAPA_BLK_ALIGNED_OBJECTS); > - return 0; > + ssize_t mem_size; > + > + /* > + * Simply need space for one more object to be able to > + * fullfil alignment requirements. > + */ ...ah, just one typo: fullfil -> fulfil or fulfill