From mboxrd@z Thu Jan 1 00:00:00 1970 From: Remy Horton Subject: Re: [RFC PATCH v1] rte: add bit-rate metrics to xstats Date: Mon, 29 Aug 2016 12:19:39 +0100 Message-ID: <90dee8fb-c523-6bca-78e1-bf07bc7a0740@intel.com> References: <1472050682-21420-1-git-send-email-remy.horton@intel.com> <3AEA2BF9852C6F48A459DA490692831F01074DD4@IRSMSX109.ger.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org To: "Pattan, Reshma" , thomas.monjalon@6wind.com Return-path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 9EF022B97 for ; Mon, 29 Aug 2016 13:19:42 +0200 (CEST) In-Reply-To: <3AEA2BF9852C6F48A459DA490692831F01074DD4@IRSMSX109.ger.corp.intel.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/08/2016 11:01, Pattan, Reshma wrote: [..] >> @@ -1506,6 +1508,19 @@ rte_eth_stats_reset(uint8_t port_id) [..] >> + /* Clear device running stat counts */ >> + dev_stats = &dev->data->stats; >> + memset(dev_stats->list_ibuckets, 0, >> + sizeof(uint64_t) * dev_stats->cnt_buckets); >> + memset(dev_stats->list_obuckets, 0, >> + sizeof(uint64_t) * dev_stats->cnt_buckets); >> + dev_stats->last_ibytes = 0; >> + dev_stats->last_obytes = 0; >> + dev_stats->peak_ibytes = 0; >> + dev_stats->peak_obytes = 0; >> + dev_stats->total_ibytes = 0; >> + dev_stats->total_obytes = 0; > Should the resetting has to be done inside rte_eth_xstats_reset() instead of rte_eth_stats_reset()? The bit-rate metrics are calculated from rte_eth_stats values rather than xstats values, which is why I put the reset here rather than in rte_eth_xstats_reset(). However this ought to be a moot point. I think it is a bug that rte_eth_xstats_reset() only calls rte_eth_stats_reset() if the driver doesn't implement xstats_reset, as the xstats output includes all the rte_eth_stats values unconditonally.