From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 2FCEAF95E for ; Thu, 9 Feb 2017 15:06:24 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga105.fm.intel.com with ESMTP; 09 Feb 2017 06:06:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,349,1484035200"; d="scan'208";a="818891108" Received: from irsmsx151.ger.corp.intel.com ([163.33.192.59]) by FMSMGA003.fm.intel.com with ESMTP; 09 Feb 2017 06:06:22 -0800 Received: from irsmsx102.ger.corp.intel.com ([169.254.2.230]) by IRSMSX151.ger.corp.intel.com ([169.254.4.20]) with mapi id 14.03.0248.002; Thu, 9 Feb 2017 14:04:28 +0000 From: "Van Haaren, Harry" To: 'Jerin Jacob' CC: "dev@dpdk.org" , "Richardson, Bruce" Thread-Topic: [PATCH v2 02/15] eventdev: add APIs for extended stats Thread-Index: AQHSgFJAIGCmozbBa0aklZNLaMNmCaFbxnwAgAFOnQCAADkHEA== Date: Thu, 9 Feb 2017 14:04:27 +0000 Message-ID: References: <1484580885-148524-1-git-send-email-harry.van.haaren@intel.com> <1485879273-86228-1-git-send-email-harry.van.haaren@intel.com> <1485879273-86228-3-git-send-email-harry.van.haaren@intel.com> <20170206082232.GC25242@localhost.localdomain> <20170207062443.GA12563@localhost.localdomain> In-Reply-To: <20170207062443.GA12563@localhost.localdomain> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiM2ExYjI3MjMtMDRhNS00OTQ0LThlZDctZWEwZDE1ZjUyMDIwIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX1BVQkxJQyJ9XX1dfSwiU3ViamVjdExhYmVscyI6W10sIlRNQ1ZlcnNpb24iOiIxNS45LjYuNiIsIlRydXN0ZWRMYWJlbEhhc2giOiJGbnNCR1dSV0lod21qTlJ2Q3VobXVmTE9xQVgyU2hadzlOUnVIVXJyQUV3PSJ9 x-ctpclassification: CTP_PUBLIC x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2 02/15] eventdev: add APIs for extended stats X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2017 14:06:24 -0000 > -----Original Message----- > From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com] > Sent: Tuesday, February 7, 2017 6:25 AM > To: Van Haaren, Harry > Cc: dev@dpdk.org; Richardson, Bruce > Subject: Re: [PATCH v2 02/15] eventdev: add APIs for extended stats > How about adding the reset function for resetting the selective xstat cou= nters similar to > ethdev? IMO, It will be useful. Agreed, an ethdev like xstats_reset() is useful - will add it. > > > Can you add statistics specific to per event queue and event > > > port?, To improve the cases like below in the application code(taken = from > > > app/test/test_sw_eventdev.c). > > > > > > IMO, it is useful because, > > > - ethdev has similar semantics > > > - majority of the implementations will have port and queue specific s= tatistics counters > > > > I'm not totally sure what you're asking but if I understand correctly, = you're suggesting a > struct based stats API like this? > > > > struct rte_event_dev_port_stats { > > uint64_t rx; > > uint64_t tx; > > ... > > }; > > > > struct rte_event_dev_queue_stats { > > uint64_t rx; > > uint64_t tx; > > ... > > }; > > > > /** a get function to get a specific port's statistics. The *stats* poi= nter is filled in */ > > int rte_event_dev_port_stats_get(dev, uint8_t port_id, struct rte_event= _dev_port_stats > *stats); > > > > /** a get function to get a specific queue's statistics. The *stats* po= inter is filled in */ > > int rte_event_dev_queue_stats_get(dev, uint8_t queue_id, struct rte_eve= nt_dev_queue_stats > *stats); > > > > > > Is this what you meant, or did I misunderstand? >=20 > I meant, queue and port specific "xstat" as each implementation may > have different statistics counters for queue/port. >=20 > Just to share my view, I have modified the exiting proposal. > Thoughts? That seems reasonable to me, thanks for the sample code - 1/2 the work done= ;) Will include in v3. > +enum rte_event_dev_xstats_mode { > + RTE_EVENT_DEV_XSTAT_DEVICE; /* Event device specific global xstat= s */ > + RTE_EVENT_DEV_XSTAT_QUEUE; /* Event queue specific xstats */ > + RTE_EVENT_DEV_XSTAT_PORT; /* Event port specific xstats */ > +}; > + > /** > * Retrieve names of extended statistics of an event device. > * > @@ -1436,9 +1442,11 @@ struct rte_event_dev_xstat_name { > */ > int > rte_event_dev_xstats_names_get(uint8_t dev_id, > + enum rte_event_dev_xstats_mode mode; > struct rte_event_dev_xstat_name *xstat_nam= es, > unsigned int size); >=20 > /** > * Retrieve extended statistics of an event device. > * > @@ -1458,7 +1466,10 @@ rte_event_dev_xstats_names_get(uint8_t dev_id, > * device doesn't support this function. > */ > int > -rte_event_dev_xstats_get(uint8_t dev_id, const unsigned int ids[], > +rte_event_dev_xstats_get(uint8_t dev_id, > + enum rte_event_dev_xstats_mode mode, > + uint8_t queue_port_id; /* valid when RTE_EVENT_D= EV_XSTAT_QUEUE or > RTE_EVENT_DEV_XSTAT_PORT */ > + const unsigned int ids[], > uint64_t values[], unsigned int n); >=20 > /** > @@ -1478,7 +1489,9 @@ rte_event_dev_xstats_get(uint8_t dev_id, const > unsigned int ids[], > * - 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, > +rte_event_dev_xstats_by_name_get(uint8_t dev_id, > + enum rte_event_dev_xstats_mode mode, > + const char *name, > unsigned int *id); > > > > > > > > > > + for (i =3D 0; i < MAX_PORTS; i++) { > > > + char name[32]; > > > + snprintf(name, sizeof(name), "port_%u_rx", i); > > > + stats->port_rx_pkts[i] =3D rte_event_dev_xstats_by_na= me_get( > > > + dev_id, name, &port_rx_pkts_ids[i]); > > > > > > + for (i =3D 0; i < MAX_QIDS; i++) { > > > + char name[32]; > > > + snprintf(name, sizeof(name), "qid_%u_rx", i); > > > + stats->qid_rx_pkts[i] =3D rte_event_dev_xstats_by_nam= e_get( > > > + dev_id, name, &qid_rx_pkts_ids[i]); > > > > >