From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 0D4A4ADF8 for ; Mon, 23 Feb 2015 13:06:42 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP; 23 Feb 2015 04:01:04 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,630,1418112000"; d="scan'208";a="531394887" Received: from irsmsx102.ger.corp.intel.com ([163.33.3.155]) by orsmga003.jf.intel.com with ESMTP; 23 Feb 2015 03:57:41 -0800 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.218]) by IRSMSX102.ger.corp.intel.com ([169.254.2.69]) with mapi id 14.03.0195.001; Mon, 23 Feb 2015 12:06:38 +0000 From: "Dumitrescu, Cristian" To: Stephen Hemminger Thread-Topic: [dpdk-dev] [PATCH v2 4/7] rte_sched: don't clear statistics when read Thread-Index: AQHQTXkzkEvQDJdDT0iTJN9c/PNr7Jz+JQPg Date: Mon, 23 Feb 2015 12:06:38 +0000 Message-ID: <3EB4FA525960D640B5BDFFD6A3D891263231BBC2@IRSMSX108.ger.corp.intel.com> References: <1423116841-19799-4-git-send-email-stephen@networkplumber.org> <20150220115256.7557e716@urahara> <3EB4FA525960D640B5BDFFD6A3D891263231B33C@IRSMSX108.ger.corp.intel.com> <2937997.VuavGYZbL6@xps13> <3EB4FA525960D640B5BDFFD6A3D891263231B3B2@IRSMSX108.ger.corp.intel.com> <20150220175327.742d8676@urahara> In-Reply-To: <20150220175327.742d8676@urahara> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH v2 4/7] rte_sched: don't clear statistics when read 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, 23 Feb 2015 12:06:45 -0000 > -----Original Message----- > From: Stephen Hemminger [mailto:stephen@networkplumber.org] > Sent: Saturday, February 21, 2015 1:53 AM > To: Dumitrescu, Cristian > Cc: Thomas Monjalon; dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v2 4/7] rte_sched: don't clear statistics = when > read >=20 > On Fri, 20 Feb 2015 21:28:55 +0000 > "Dumitrescu, Cristian" wrote: >=20 > > Agree. > > Stephen, how about a run-time solution (I agree it would be much better= , > why did I not consider this in the first place?) of adding a new bool par= ameter > in struct rte_sched_port_params: clear_stats_on_reset? > > Both stats read function get the port handle (struct rte_sched_port *) = as > parameter, so there should be no ripple effect to propagate this flag. >=20 > Why not read_and_clear function if absolutely necessary. I am not sure I understand what you mean. Are you suggesting different set = of stats read functions, one that is read and clear, while the other one is= read without clear? Personally, I think we should avoid proliferating the number of stats funct= ions, I would keep a single set of stats read functions, which can clear th= e stats or not, depending on behaviour configured per rte_sched object at c= reation time. Basically, based on the value of configuration parameter stru= ct rte_sched_params::clear_stats_on_reset, the stats read functions do clea= r the counters or not. In my opinion, this allows a clean init-time selecti= on of the required behaviour, and it also provides backward compatibility. = Any issues with this approach?