From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerin Jacob Subject: Re: [PATCH v3 04/17] eventdev: add APIs for extended stats Date: Mon, 20 Feb 2017 18:04:50 +0530 Message-ID: <20170220123449.GA28438@localhost.localdomain> References: <1485879273-86228-1-git-send-email-harry.van.haaren@intel.com> <1487343252-16092-1-git-send-email-harry.van.haaren@intel.com> <1487343252-16092-5-git-send-email-harry.van.haaren@intel.com> <20170219123224.GC7400@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "dev@dpdk.org" , "Richardson, Bruce" To: "Van Haaren, Harry" Return-path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0068.outbound.protection.outlook.com [104.47.40.68]) by dpdk.org (Postfix) with ESMTP id A00F82C24 for ; Mon, 20 Feb 2017 13:35:11 +0100 (CET) Content-Disposition: inline In-Reply-To: List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Mon, Feb 20, 2017 at 12:12:35PM +0000, Van Haaren, Harry wrote: > > -----Original Message----- > > From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com] > > Sent: Sunday, February 19, 2017 12:32 PM > > To: Van Haaren, Harry > > Cc: dev@dpdk.org; Richardson, Bruce > > Subject: Re: [PATCH v3 04/17] eventdev: add APIs for extended stats > > > > > > +/** > > > + * Reset the values of the xstats on the whole device. > > > + * > > > + * @param dev_id > > > + * The identifier of the device > > > + * @return > > > + * - zero: successfully reset the statistics to zero > > > + * - negative value: -EINVAL invalid dev_id, -ENOTSUP if not supported. > > > + */ > > > +int > > > +rte_event_dev_xstats_reset(uint8_t dev_id); > > > > I think it would be useful to selectively reset the specific counter if > > needed. > > > Ok - I like the simplicity of a single reset() covering the whole eventdev, so that the stats should be consistent. No objection to changing the API, as applications can do a full reset using the "partial" reset API if they require. > > > > something like below(Just to share my thought in C code) > > > > int > > rte_event_dev_xstats_reset(uint8_t dev_id, > > enum rte_event_dev_xstats_mode mode/* INT_MAX to specify all xstats on the whole device */ > > const unsigned int ids /* UINT_MAX to specify all the ids on the specific mode */ > > > The other functions that take a mode require a "queue_port_id" to select the component (port number or queue id number). I'll add the parameter. > > Also I don't like the INT_MAX solution, as the enum type doesn't have to be INT, it can be char or uintX_t - compiler and CFLAGS can be used to change the enum type IIRC. > > The ids parameter is an array in the xstats_get() functions, allowing multiple ids to be retrieved in one call. This also allows a NULL parameter to indicate all. I think this suits better than a single int id, and UINT_MAX for all. > > > TL;DR: I'm suggesting > > int > rte_event_dev_xstats_reset(uint8_t dev_id, > enum rte_event_dev_xstats_mode mode, /* device, port or queue */ > int16_t queue_port_id, /* Queue or Port to reset. -1 resets all of *mode* ports or queues. */ > const uint32_t ids[]); /* NULL array indicates to reset all stats */ > > Thoughts? looks good to me. > > > > Other than above comments, Its looks very good. > > Thanks for review!