From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerin Jacob Subject: Re: [PATCH v3 05/12] event/octeontx: add event timer stats get and reset Date: Sun, 8 Apr 2018 13:22:57 +0530 Message-ID: <20180408075144.GC6880@jerin> References: <20180216213700.3415-1-pbhagavatula@caviumnetworks.com> <20180403150514.24201-1-pbhagavatula@caviumnetworks.com> <20180403150514.24201-6-pbhagavatula@caviumnetworks.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: santosh.shukla@caviumnetworks.com, erik.g.carrillo@intel.com, dev@dpdk.org To: Pavan Nikhilesh Return-path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0040.outbound.protection.outlook.com [104.47.32.40]) by dpdk.org (Postfix) with ESMTP id 4481D1B41E for ; Sun, 8 Apr 2018 09:53:15 +0200 (CEST) Content-Disposition: inline In-Reply-To: <20180403150514.24201-6-pbhagavatula@caviumnetworks.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" -----Original Message----- > Date: Tue, 3 Apr 2018 20:35:07 +0530 > From: Pavan Nikhilesh > To: jerin.jacob@caviumnetworks.com, santosh.shukla@caviumnetworks.com, > erik.g.carrillo@intel.com > Cc: dev@dpdk.org, Pavan Nikhilesh > Subject: [dpdk-dev] [PATCH v3 05/12] event/octeontx: add event timer stats > get and reset > X-Mailer: git-send-email 2.16.3 > > Add functions to get and reset event timer adapter stats. > > Signed-off-by: Pavan Nikhilesh > --- > drivers/event/octeontx/timvf_evdev.c | 26 ++++++++++++++++++++++++++ > drivers/event/octeontx/timvf_evdev.h | 1 + > 2 files changed, 27 insertions(+) > > diff --git a/drivers/event/octeontx/timvf_evdev.c b/drivers/event/octeontx/timvf_evdev.c > index ccf724115..4db10cdd0 100644 > --- a/drivers/event/octeontx/timvf_evdev.c > +++ b/drivers/event/octeontx/timvf_evdev.c > @@ -281,12 +281,38 @@ timvf_ring_free(struct rte_event_timer_adapter *adptr) > return 0; > } > > + > +static int > +timvf_stats_get(const struct rte_event_timer_adapter *adapter, > + struct rte_event_timer_adapter_stats *stats) > +{ > + struct timvf_ring *timr = adapter->data->adapter_priv; > + uint64_t bkt_cyc = rte_rdtsc() - timr->meta.ring_start_cyc; > + > + stats->evtim_exp_count = timr->meta.tim_arm_cnt; > + stats->ev_enq_count = timr->meta.tim_arm_cnt; We are updating the these counts in fastpath. Right? As an optimization, may be we could take the arguments from vdev to choose to enable "stats" at runtime by making it two function pointers. By default it can be disabled.