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 BA843D00F for ; Thu, 19 Apr 2018 18:42:42 +0200 (CEST) Received: from alille-654-1-86-209.w90-58.abo.wanadoo.fr ([90.58.125.209] 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 1f9Cdy-0001Kx-45; Thu, 19 Apr 2018 18:42:47 +0200 Received: by droids-corp.org (sSMTP sendmail emulation); Thu, 19 Apr 2018 18:42:40 +0200 Date: Thu, 19 Apr 2018 18:42:40 +0200 From: Olivier Matz To: Andrew Rybchenko Cc: dev@dpdk.org, "Artem V. Andreev" Message-ID: <20180419164240.dgqwzsc6rubngo3s@platinum> References: <1516713372-10572-1-git-send-email-arybchenko@solarflare.com> <1522080779-25472-1-git-send-email-arybchenko@solarflare.com> <1522080779-25472-3-git-send-email-arybchenko@solarflare.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1522080779-25472-3-git-send-email-arybchenko@solarflare.com> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [dpdk-dev] [PATCH v1 2/6] mempool: implement abstract mempool info API 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: Thu, 19 Apr 2018 16:42:42 -0000 On Mon, Mar 26, 2018 at 05:12:55PM +0100, Andrew Rybchenko wrote: > From: "Artem V. Andreev" > > Primarily, it is intended as a way for the mempool driver to provide > additional information on how it lays up objects inside the mempool. > > Signed-off-by: Artem V. Andreev > Signed-off-by: Andrew Rybchenko I think it's a good idea to have a way to query mempool features or parameters. The approach chosen in this patch looks similar to what we have with ethdev devinfo, right? [...] > /** > + * @warning > + * @b EXPERIMENTAL: this API may change without prior notice. > + * > + * Additional information about the mempool > + */ > +struct rte_mempool_info; > + [...] > +/* wrapper to get additional mempool info */ > +int > +rte_mempool_ops_get_info(const struct rte_mempool *mp, > + struct rte_mempool_info *info) > +{ > + struct rte_mempool_ops *ops; > + > + ops = rte_mempool_get_ops(mp->ops_index); > + > + RTE_FUNC_PTR_OR_ERR_RET(ops->get_info, -ENOTSUP); > + return ops->get_info(mp, info); > +} Thinking in terms of ABI compatibility, it looks that each time we will add or remove a field, it will break the ABI because the info structure will change. Well, it's maybe nitpicking, because most of the time adding a field in info structure goes with adding a field in the mempool struct, which will anyway break the ABI. Another approach is to have a function rte_mempool_info_contig_block_size(mp) whose ABI can be more easily wrapped with VERSION_SYMBOL(). On my side I'm fine with your current approach, especially given how few usages of VERSION_SYMBOL() we can find in DPDK. But in case you feel it's better to have a function...