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: Sun, 19 Feb 2017 18:02:25 +0530 Message-ID: <20170219123224.GC7400@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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: dev@dpdk.org, Bruce Richardson To: Harry van Haaren Return-path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0051.outbound.protection.outlook.com [104.47.36.51]) by dpdk.org (Postfix) with ESMTP id 9BFD72C50 for ; Sun, 19 Feb 2017 13:32:51 +0100 (CET) Content-Disposition: inline In-Reply-To: <1487343252-16092-5-git-send-email-harry.van.haaren@intel.com> 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 Fri, Feb 17, 2017 at 02:53:59PM +0000, Harry van Haaren wrote: > From: Bruce Richardson > > Add in APIs for extended stats so that eventdev implementations can report > out information on their internal state. The APIs are based on, but not > identical to, the equivalent ethdev functions. > > Signed-off-by: Bruce Richardson > Signed-off-by: Harry van Haaren > --- > lib/librte_eventdev/rte_eventdev.c | 78 ++++++++++++++++++ > lib/librte_eventdev/rte_eventdev.h | 118 +++++++++++++++++++++++++++ > lib/librte_eventdev/rte_eventdev_pmd.h | 70 ++++++++++++++++ > lib/librte_eventdev/rte_eventdev_version.map | 4 + > 4 files changed, 270 insertions(+) > + > +/** > + * Retrieve the value of a single stat by requesting it by name. > + * > + * @param dev_id > + * The identifier of the device > + * @param name > + * The stat name to retrieve > + * @param[out] id > + * If non-NULL, the numerical id of the stat will be returned, so that further > + * requests for the stat can be got using rte_eventdev_xstats_get, which will > + * be faster as it doesn't need to scan a list of names for the stat. > + * If the stat cannot be found, the id returned will be (unsigned)-1. > + * @return > + * - positive value or zero: the stat value > + * - negative value: -EINVAL if stat not found, -ENOTSUP if not supported. > + */ > +uint64_t > +rte_event_dev_xstats_by_name_get(uint8_t dev_id, const char *name, > + unsigned int *id); > + > +/** > + * 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. 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 */ Other than above comments, Its looks very good.