From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 17BF95687 for ; Wed, 14 Sep 2016 16:10:27 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP; 14 Sep 2016 07:10:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,334,1470726000"; d="scan'208";a="1050172909" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.117]) ([10.237.220.117]) by orsmga002.jf.intel.com with ESMTP; 14 Sep 2016 07:10:25 -0700 To: Wei Zhao1 , dev@dpdk.org, Helin Zhang , Jingjing Wu References: <1470708472-39154-1-git-send-email-wei.zhao1@intel.com> From: Ferruh Yigit Message-ID: Date: Wed, 14 Sep 2016 15:10:25 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <1470708472-39154-1-git-send-email-wei.zhao1@intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v3] net/i40e: fix Rx statistic inconsistent 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: Wed, 14 Sep 2016 14:10:28 -0000 On 8/9/2016 3:07 AM, Wei Zhao1 wrote: > rx_good_bytes and rx_good_packets statistic is inconsistent when port > stopped,ipackets statistic is minus the discard packets but rx_bytes > statistic not,but i40e has no statistic of discard bytes.So we check > "dev_started" flag, if the port is started we do the statistic work,if > stopped we don't.We can avoid the statistic inconsistent > problem by this way. > > Fixes: 9aace75fc82e ("i40e: fix statistics") > > Signed-off-by: Wei Zhao1 > --- > drivers/net/i40e/i40e_ethdev.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c > index d0aeb70..47ed6e9 100644 > --- a/drivers/net/i40e/i40e_ethdev.c > +++ b/drivers/net/i40e/i40e_ethdev.c > @@ -2315,7 +2315,8 @@ i40e_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) > unsigned i; > > /* call read registers - updates values, now write them to struct */ > - i40e_read_stats_registers(pf, hw); > + if (dev->data->dev_started == 1) > + i40e_read_stats_registers(pf, hw); > > stats->ipackets = pf->main_vsi->eth_stats.rx_unicast + > pf->main_vsi->eth_stats.rx_multicast + > @@ -2494,7 +2495,8 @@ i40e_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats, > if (n < count) > return count; > > - i40e_read_stats_registers(pf, hw); > + if (dev->data->dev_started == 1) > + i40e_read_stats_registers(pf, hw); > > if (xstats == NULL) > return 0; > +cc i40e maintainers, can you please review the code?