From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 753A0C39C for ; Mon, 3 Aug 2015 19:35:21 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 03 Aug 2015 10:35:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,602,1432623600"; d="scan'208";a="775849820" Received: from kmsmsx154.gar.corp.intel.com ([172.21.73.14]) by fmsmga002.fm.intel.com with ESMTP; 03 Aug 2015 10:35:19 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by KMSMSX154.gar.corp.intel.com (172.21.73.14) with Microsoft SMTP Server (TLS) id 14.3.224.2; Tue, 4 Aug 2015 01:35:17 +0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.45]) by shsmsx102.ccr.corp.intel.com ([169.254.2.126]) with mapi id 14.03.0224.002; Tue, 4 Aug 2015 01:35:16 +0800 From: "Zhang, Helin" To: "Tao, Zhe" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] i40e: Fix the issue when resetting the stats for i40e, the stats information will be lost before next time getting the stats Thread-Index: AQHQug3blWWWc1Q6xUqpC8MKfAYdjp36sD4Q Date: Mon, 3 Aug 2015 17:35:15 +0000 Message-ID: References: <1436422141-29024-1-git-send-email-zhe.tao@intel.com> In-Reply-To: <1436422141-29024-1-git-send-email-zhe.tao@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: 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] i40e: Fix the issue when resetting the stats for i40e, the stats information will be lost before next time getting the stats 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, 03 Aug 2015 17:35:21 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Zhe Tao > Sent: Wednesday, July 8, 2015 11:09 PM > To: dev@dpdk.org > Subject: [dpdk-dev] [PATCH] i40e: Fix the issue when resetting the stats = for i40e, > the stats information will be lost before next time getting the stats Please refer to other for a brief title! Basically the title should be brie= f enough. >=20 > Issue: When calling the reset API to reset all the stats for i40e, all th= e stats will be > untracked before the next time calling get stats API. > Once calling the get stats API it will show all the stats equal zero. >=20 > Changes: Calling the get stats API in the reset API will force the stats_= offset > update immediately >=20 > Signed-off-by: Zhe Tao > --- > drivers/net/i40e/i40e_ethdev.c | 8 ++++++++ > 1 file changed, 8 insertions(+) >=20 > diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethde= v.c > index 5fb6b4c..c9cc317 100644 > --- a/drivers/net/i40e/i40e_ethdev.c > +++ b/drivers/net/i40e/i40e_ethdev.c > @@ -1517,9 +1517,17 @@ static void > i40e_dev_stats_reset(struct rte_eth_dev *dev) { > struct i40e_pf *pf =3D I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private); > + struct rte_eth_stats stat =3D {0}; >=20 > /* It results in reloading the start point of each counter */ > pf->offset_loaded =3D false; > + > + /* > + * need to read the status one time right after reset the offset_loaded = field > + * prevent the stats data loss between the i40e_dev_stats_reset and > i40e_dev_stats_get > + */ > + > + i40e_dev_stats_get(dev, &stat); I'd prefer to call "memset(hw_stats, 0, sizeof(*hw_stats));" as igb/ixgbe d= oes. Please also think of implement the similar reset function for i40evf. Thank you! Helin > } >=20 > static int > -- > 1.9.3