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 60F28A2EFC for ; Tue, 17 Sep 2019 05:16:25 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 58F9C1BED7; Tue, 17 Sep 2019 05:16:24 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 232C91BEC7; Tue, 17 Sep 2019 05:16:21 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Sep 2019 20:16:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,515,1559545200"; d="scan'208";a="387420741" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga006.fm.intel.com with ESMTP; 16 Sep 2019 20:16:20 -0700 Received: from fmsmsx123.amr.corp.intel.com (10.18.125.38) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 16 Sep 2019 20:16:19 -0700 Received: from shsmsx106.ccr.corp.intel.com (10.239.4.159) by fmsmsx123.amr.corp.intel.com (10.18.125.38) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 16 Sep 2019 20:16:19 -0700 Received: from shsmsx105.ccr.corp.intel.com ([169.254.11.23]) by SHSMSX106.ccr.corp.intel.com ([169.254.10.86]) with mapi id 14.03.0439.000; Tue, 17 Sep 2019 11:16:17 +0800 From: "Zhang, Qi Z" To: Thierry Herbelot , "dev@dpdk.org" CC: Guo Fengtian , Thomas Monjalon , "stable@dpdk.org" , "Lu, Wenzhuo" , "Ananyev, Konstantin" Thread-Topic: [dpdk-dev] [PATCH 1/1] net/ixgbevf: fix stats update after a PF reset Thread-Index: AQHVaLpAwvvJEQsIAkeurEkDK3zjJ6cvOiBw Date: Tue, 17 Sep 2019 03:16:17 +0000 Message-ID: <039ED4275CED7440929022BC67E7061153D97B33@SHSMSX105.ccr.corp.intel.com> References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOWQ2MjYwNmItOWZiYi00ODg3LTk1MjctZjVlYzA0NTA0NmMxIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiWWQ3Wmg3UllIV29PR1J4aFdZT282NFFHMVNoRGtKQVRLMXE4cU5JYUlXbDlGZW9rTnJJNktyU0pnTFg2WVVZSyJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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" > -----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 >=20 > From: Guo Fengtian >=20 > When PF is set down, in VF, the value of stats register is zero. > So only increase stats when it's non zero. >=20 > Fixes: af75078fece3 ('first public release') > Cc: stable@dpdk.org > Cc: wenzhuo.lu@intel.com > Cc: konstantin.ananyev@intel.com >=20 > Signed-off-by: Guo Fengtian > --- > drivers/net/ixgbe/ixgbe_ethdev.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) >=20 > 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 =3D IXGBE_READ_REG(hw, reg); \ > - cur +=3D (latest - last) & UINT_MAX; \ > + if (latest) \ > + cur +=3D (latest - last) & UINT_MAX; \ There is still a chance that PF is up but the latest reg read returns 0, si= nce it's a cyclic counter, is any way to check the PF status directly? > last =3D latest; \ > } >=20 > @@ -394,7 +395,8 @@ static void ixgbe_l2_tunnel_conf(struct rte_eth_dev > *dev); > u64 new_lsb =3D IXGBE_READ_REG(hw, lsb); \ > u64 new_msb =3D IXGBE_READ_REG(hw, msb); \ > u64 latest =3D ((new_msb << 32) | new_lsb); \ > - cur +=3D (0x1000000000LL + latest - last) & 0xFFFFFFFFFLL; \ > + if (latest) \ > + cur +=3D (0x1000000000LL + latest - last) & 0xFFFFFFFFFLL;\ > last =3D latest; \ > } >=20 > -- > 2.20.1