From mboxrd@z Thu Jan 1 00:00:00 1970 From: Remy Horton Subject: Re: [RFC PATCH v1 2/3] drivers/net/ixgbe: change xstats to use integers Date: Tue, 03 May 2016 13:22:53 +0100 Message-ID: <5728981D.2020003@intel.com> References: <1460731462-21229-1-git-send-email-remy.horton@intel.com> <1460731462-21229-3-git-send-email-remy.horton@intel.com> <34cbe07723f64e9f926666164d9d5319@XCH-RCD-016.cisco.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit To: "David Harton (dharton)" , "dev@dpdk.org" , Helin Zhang Return-path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 7FFEC37AF for ; Tue, 3 May 2016 14:23:01 +0200 (CEST) In-Reply-To: <34cbe07723f64e9f926666164d9d5319@XCH-RCD-016.cisco.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 29/04/2016 14:43, David Harton (dharton) wrote: [..] >> + /* RX Priority Stats */ >> + for (stat = 0; stat < IXGBE_NB_RXQ_PRIO_STATS; stat++) { >> + for (i = 0; i < 8; i++) { > > 8 seems magical. Is there a constant somewhere that can be used? Not that I'm aware of. I've made it a #define as a small cleanup. >> +static int ixgbevf_dev_xstats_names(__rte_unused struct rte_eth_dev *dev, >> + struct rte_eth_xstats_name *ptr_names, __rte_unused unsigned limit) >> +{ >> + unsigned i; >> + >> + if (limit < IXGBEVF_NB_XSTATS) > > Think this check has to be removed since rte_eth_xstats_count() calls with > limit == 0. Well spotted. It should only error-out if ptr_names is non-NULL. As an aside, I am wondering whether getting stats counts should itself be a seperate driver hook. ..Remy