From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id EB3ACA2EDB for ; Mon, 30 Sep 2019 13:01:24 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C9BE7B62; Mon, 30 Sep 2019 13:01:23 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id BD5759E4; Mon, 30 Sep 2019 13:01:21 +0200 (CEST) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Sep 2019 04:01:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,567,1559545200"; d="scan'208";a="204805250" Received: from yexl-server.sh.intel.com (HELO localhost) ([10.67.117.17]) by fmsmga001.fm.intel.com with ESMTP; 30 Sep 2019 04:01:13 -0700 Date: Mon, 30 Sep 2019 18:58:45 +0800 From: Ye Xiaolong To: "Zhang, Qi Z" Cc: Thierry Herbelot , "dev@dpdk.org" , Guo Fengtian , Thomas Monjalon , "stable@dpdk.org" , "Lu, Wenzhuo" , "Ananyev, Konstantin" Message-ID: <20190930105845.GJ112560@intel.com> References: <039ED4275CED7440929022BC67E7061153D97B33@SHSMSX105.ccr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <039ED4275CED7440929022BC67E7061153D97B33@SHSMSX105.ccr.corp.intel.com> User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [dpdk-dev] [PATCH 1/1] net/ixgbevf: fix stats update after a PF reset X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi, Thierry & Fengtian Any update about this patch according to Qi's comment? Thanks, Xiaolong On 09/17, Zhang, Qi Z wrote: > > >> -----Original Message----- >> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Thierry Herbelot >> Sent: Thursday, September 12, 2019 12:01 AM >> To: dev@dpdk.org >> Cc: Guo Fengtian ; Thomas Monjalon >> ; stable@dpdk.org; Lu, Wenzhuo >> ; Ananyev, Konstantin >> >> Subject: [dpdk-dev] [PATCH 1/1] net/ixgbevf: fix stats update after a PF reset >> >> From: Guo Fengtian >> >> When PF is set down, in VF, the value of stats register is zero. >> So only increase stats when it's non zero. >> >> Fixes: af75078fece3 ('first public release') >> Cc: stable@dpdk.org >> Cc: wenzhuo.lu@intel.com >> Cc: konstantin.ananyev@intel.com >> >> Signed-off-by: Guo Fengtian >> --- >> drivers/net/ixgbe/ixgbe_ethdev.c | 6 ++++-- >> 1 file changed, 4 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c >> b/drivers/net/ixgbe/ixgbe_ethdev.c >> index 7eb3d0567b58..27c540f60563 100644 >> --- a/drivers/net/ixgbe/ixgbe_ethdev.c >> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c >> @@ -385,7 +385,8 @@ static void ixgbe_l2_tunnel_conf(struct rte_eth_dev >> *dev); >> #define UPDATE_VF_STAT(reg, last, cur) \ >> { \ >> uint32_t latest = IXGBE_READ_REG(hw, reg); \ >> - cur += (latest - last) & UINT_MAX; \ >> + if (latest) \ >> + cur += (latest - last) & UINT_MAX; \ > >There is still a chance that PF is up but the latest reg read returns 0, since it's a cyclic counter, is any way to check the PF status directly? > >> last = latest; \ >> } >> >> @@ -394,7 +395,8 @@ static void ixgbe_l2_tunnel_conf(struct rte_eth_dev >> *dev); >> u64 new_lsb = IXGBE_READ_REG(hw, lsb); \ >> u64 new_msb = IXGBE_READ_REG(hw, msb); \ >> u64 latest = ((new_msb << 32) | new_lsb); \ >> - cur += (0x1000000000LL + latest - last) & 0xFFFFFFFFFLL; \ >> + if (latest) \ >> + cur += (0x1000000000LL + latest - last) & 0xFFFFFFFFFLL;\ >> last = latest; \ >> } >> >> -- >> 2.20.1 >