From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olivier Matz Subject: Re: [PATCH v6 0/5] Extended xstats API in ethdev library to allow grouping of stats Date: Mon, 24 Apr 2017 14:32:11 +0200 Message-ID: <20170424143211.3e7db919@platinum> References: <1491928644-10383-2-git-send-email-michalx.k.jastrzebski@intel.com> <1492095568-20993-1-git-send-email-kubax.kozak@intel.com> <2191902.oqd7qsnxNQ@xps> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Kuba Kozak , dev@dpdk.org, harry.van.haaren@intel.com, deepak.k.jain@intel.com To: Thomas Monjalon Return-path: Received: from mail-wm0-f42.google.com (mail-wm0-f42.google.com [74.125.82.42]) by dpdk.org (Postfix) with ESMTP id 6AFB72B9B for ; Mon, 24 Apr 2017 14:32:14 +0200 (CEST) Received: by mail-wm0-f42.google.com with SMTP id u65so21643682wmu.1 for ; Mon, 24 Apr 2017 05:32:14 -0700 (PDT) In-Reply-To: <2191902.oqd7qsnxNQ@xps> 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, On Thu, 20 Apr 2017 22:31:35 +0200, Thomas Monjalon wrote: > 13/04/2017 16:59, Kuba Kozak: > > Extended xstats API in ethdev library to allow grouping of stats logically > > so they can be retrieved per logical grouping managed by the application. > > Changed existing functions rte_eth_xstats_get_names and rte_eth_xstats_get > > to use a new list of arguments: array of ids and array of values. > > ABI versioning mechanism was used to support backward compatibility. > > Introduced two new functions rte_eth_xstats_get_all and > > rte_eth_xstats_get_names_all which keeps functionality of the previous > > ones (respectively rte_eth_xstats_get and rte_eth_xstats_get_names) > > but use new API inside. Both functions marked as deprecated. > > Introduced new function: rte_eth_xstats_get_id_by_name to retrieve > > xstats ids by its names. > > Extended functionality of proc_info application: > > --xstats-name NAME: to display single xstat value by NAME > > Updated test-pmd application to use new API. > > Applied, thanks I'm adapting my application to the upcoming dpdk 17.05. I see several problems with this patchset: - the API of rte_eth_xstats_get() and rte_eth_xstats_get_names() has been modified, and from what I see it was not announced. It looks that ABI is preserved however. - the new functions rte_eth_xstats_get_all() and rte_eth_xstats_get_names_all() are marked as deprecated, which looks strange for new functions. About the new api: int rte_eth_xstats_get(uint8_t port_id, uint64_t *ids, uint64_t *values, unsigned int n); int rte_eth_xstats_get_names(uint8_t port_id, struct rte_eth_xstat_name *xstats_names, unsigned int size, uint64_t *ids); - the argument "id" is not at the same place - why having "size" in one function and "n" in the second (it was renamed in the patch)? - the argument "id" should be const - a table of uint64_t is returned in place of the struct rte_eth_xstat table: if no ids are given, the driver cannot return partial or disordered stats anymore. See 513c78ae3fd6 ("ethdev: fix extended statistics name index") So, I wonder if it wouldn't be more simple to keep the old API intact (it would avoid unannounced breakage). The new feature can be implemented in an additional API: rte_eth_xstats_get_by_id(uint8_t port_id, const uint64_t *ids, uint64_t *values, unsigned int size) rte_eth_xstats_get_names_by_id(uint8_t port_id, const uint64_t *ids, struct rte_eth_xstat_name *xstats_names, unsigned int size) Or: rte_eth_xstats_get_by_id(uint8_t port_id, const uint64_t *ids, struct rte_eth_xstat *values, unsigned int size) rte_eth_xstats_get_names_by_id(uint8_t port_id, const uint64_t *ids, struct rte_eth_xstat_name *xstats_names, unsigned int size) (which would allow to deprecate the old API, but I'm not sure we need to) Can we fix that for 17.05? Regards, Olivier