From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ferruh Yigit Subject: Re: [PATCH v2] ethdev: fix xstats retrieve by id API Date: Thu, 12 Oct 2017 20:42:48 +0100 Message-ID: References: <20171011072208.137243-1-lee.daly@intel.com> <20171012133128.51056-1-lee.daly@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: dev@dpdk.org, kubax.kozak@intel.com To: Lee Daly , thomas@monjalon.net Return-path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 603EF1B20B for ; Thu, 12 Oct 2017 21:42:51 +0200 (CEST) In-Reply-To: <20171012133128.51056-1-lee.daly@intel.com> 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 10/12/2017 2:31 PM, Lee Daly wrote: > From: Lee > > Fix xstats functions, rte_eth_xstats_get_names_by_id() > and rte_eth_xstats_get_by_id(), in current implementation > ethdev level reads all xstat values and filters out > the ones requested by the application. This behavior doesn't > benefit from PMD ops and doesn't provide the benefit the > API was created in the first place for. APIs are also unnecessarily > complicated. Both APIs have different returns for the same params. > > In this fix, instead of reading all the stats and finding the > requested value, drivers can provide ops to get selected xstats. > API no longer crashes with certain params, > > rte_eth_get_by_id returned seg fault with > "ids = NULL && values != NULL && n rte_eth_get_names_by_id returned seg fault with > "ids = NULL && values != NULL && n=0” > These now return max number of stats available, matching the other API. > > rte_eth_get_by_id returned seg fault with > "ids != NULL && values = NULL && n This now returns -22,(EINVAL). > > Standardized variable/parameter names between the 2 APIs. > > Overall code complexity reduced. > > Fixes: 79c913a42f0e ("ethdev: retrieve xstats by ID") > Cc: kubax.kozak@intel.com > > Signed-off-by: Lee Daly > Reviewed-by: Ferruh Yigit Applied to dpdk-next-net/master, thanks. Welcome Lee!