From mboxrd@z Thu Jan 1 00:00:00 1970 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) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP; 29 Aug 2016 04:19:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,596,1464678000"; d="scan'208";a="162014843" Received: from rhorton-mobl.ger.corp.intel.com (HELO [163.33.230.67]) ([163.33.230.67]) by fmsmga004.fm.intel.com with ESMTP; 29 Aug 2016 04:19:41 -0700 To: "Pattan, Reshma" , thomas.monjalon@6wind.com References: <1472050682-21420-1-git-send-email-remy.horton@intel.com> <3AEA2BF9852C6F48A459DA490692831F01074DD4@IRSMSX109.ger.corp.intel.com> Cc: dev@dpdk.org From: Remy Horton Organization: Intel Shannon Limited Message-ID: <90dee8fb-c523-6bca-78e1-bf07bc7a0740@intel.com> Date: Mon, 29 Aug 2016 12:19:39 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <3AEA2BF9852C6F48A459DA490692831F01074DD4@IRSMSX109.ger.corp.intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [RFC PATCH v1] rte: add bit-rate metrics to xstats X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Aug 2016 11:19:43 -0000 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.