From mboxrd@z Thu Jan 1 00:00:00 1970 From: Igor Russkikh Subject: Re: [PATCH net v2 7/9] net: aquantia: Reset driver level statistics to zero on initialization Date: Tue, 12 Dec 2017 12:46:42 +0300 Message-ID: References: <99425adad58a8ed133edc1a2b5ec8fec70e56e36.1512994559.git.igor.russkikh@aquantia.com> <20171211155156.GK28672@lunn.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: "David S . Miller" , netdev@vger.kernel.org, David Arcari , Pavel Belous , Nadezhda Krupnina , Simon Edelhaus To: Andrew Lunn Return-path: Received: from mail-bl2nam02on0089.outbound.protection.outlook.com ([104.47.38.89]:44672 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750853AbdLLJq5 (ORCPT ); Tue, 12 Dec 2017 04:46:57 -0500 In-Reply-To: <20171211155156.GK28672@lunn.ch> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: >> --- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c >> +++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c >> @@ -344,6 +344,13 @@ static int hw_atl_a0_hw_init(struct aq_hw_s *self, >> hw_atl_a0_hw_rss_set(self, &aq_nic_cfg->aq_rss); >> hw_atl_a0_hw_rss_hash_set(self, &aq_nic_cfg->aq_rss); >> >> + /* Read initial hardware counters >> + * and reset current in-driver statistics >> + */ >> + hw_atl_utils_update_stats(self); >> + memset(&PHAL_ATLANTIC_A0->curr_stats, 0, >> + sizeof(PHAL_ATLANTIC_A0->curr_stats)); >> + >> err = aq_hw_err_from_flags(self); >> if (err < 0) >> goto err_exit; > Hi Igor > > It looks like this is called on pm state change? Does this mean that > resume will zero the statistics? That is probably not what you want. > > You should probably only clear the statics in the probe function. > Hi Andrew, thanks for the review. It seems you are right and this'll reset stats on PM state. I'll revalidate this and come back with updated patch. BR, Igor