From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 6D0912B97 for ; Mon, 29 Aug 2016 12:02:16 +0200 (CEST) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga101.fm.intel.com with ESMTP; 29 Aug 2016 03:01:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,596,1464678000"; d="scan'208";a="2229903" Received: from irsmsx103.ger.corp.intel.com ([163.33.3.157]) by fmsmga006.fm.intel.com with ESMTP; 29 Aug 2016 03:01:59 -0700 Received: from irsmsx109.ger.corp.intel.com ([169.254.13.24]) by IRSMSX103.ger.corp.intel.com ([169.254.3.204]) with mapi id 14.03.0248.002; Mon, 29 Aug 2016 11:01:58 +0100 From: "Pattan, Reshma" To: "Horton, Remy" , "thomas.monjalon@6wind.com" CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [RFC PATCH v1] rte: add bit-rate metrics to xstats Thread-Index: AQHR/hf5vrpRZIUfp0q+4YmY6P7la6Bft8Jw Date: Mon, 29 Aug 2016 10:01:57 +0000 Message-ID: <3AEA2BF9852C6F48A459DA490692831F01074DD4@IRSMSX109.ger.corp.intel.com> References: <1472050682-21420-1-git-send-email-remy.horton@intel.com> In-Reply-To: <1472050682-21420-1-git-send-email-remy.horton@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZGZjMmVlYTEtYWRkMi00YjUzLWE4MzAtNmU5MzkyNDRiNGQwIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6ImFoUnJRMFVQMUk0Zlo3dlpSNmVjbXJRZTcxZEJkaFNBU2pYdEVPcjhjWHM9In0= x-ctpclassification: CTP_IC x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [RFC PATCH v1] rte: add bit-rate metrics to xstats 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, 29 Aug 2016 10:02:16 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Remy Horton > Sent: Wednesday, August 24, 2016 3:58 PM > To: thomas.monjalon@6wind.com > Cc: dev@dpdk.org > Subject: [dpdk-dev] [RFC PATCH v1] rte: add bit-rate metrics to xstats >=20 > This patch adds peak and average data-rate metrics to the extended statis= tics. > The intervals used to generate the statistics are controlled by any appli= cation > wishing to make use of these metrics. >=20 > Signed-off-by: Remy Horton > --- > diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.= c index > f62a9ec..71549b4 100644 > static const struct rte_eth_xstats_name_off rte_rxq_stats_strings[] =3D = { > {"packets", offsetof(struct rte_eth_stats, q_ipackets)}, @@ -1499,6 > +1500,7 @@ void rte_eth_stats_reset(uint8_t port_id) { > struct rte_eth_dev *dev; > + struct rte_eth_dev_stats *dev_stats; >=20 > RTE_ETH_VALID_PORTID_OR_RET(port_id); > dev =3D &rte_eth_devices[port_id]; > @@ -1506,6 +1508,19 @@ rte_eth_stats_reset(uint8_t port_id) > RTE_FUNC_PTR_OR_RET(*dev->dev_ops->stats_reset); > (*dev->dev_ops->stats_reset)(dev); > dev->data->rx_mbuf_alloc_failed =3D 0; > + > + /* Clear device running stat counts */ > + dev_stats =3D &dev->data->stats; > + memset(dev_stats->list_ibuckets, 0, > + sizeof(uint64_t) * dev_stats->cnt_buckets); > + memset(dev_stats->list_obuckets, 0, > + sizeof(uint64_t) * dev_stats->cnt_buckets); > + dev_stats->last_ibytes =3D 0; > + dev_stats->last_obytes =3D 0; > + dev_stats->peak_ibytes =3D 0; > + dev_stats->peak_obytes =3D 0; > + dev_stats->total_ibytes =3D 0; > + dev_stats->total_obytes =3D 0; > } >=20 Should the resetting has to be done inside rte_eth_xstats_reset() instead o= f rte_eth_stats_reset()? Thanks, Reshma