-----Original Message-----
> Date: Tue,  3 Apr 2018 20:35:07 +0530
> From: Pavan Nikhilesh <pbhagavat...@caviumnetworks.com>
> To: jerin.ja...@caviumnetworks.com, santosh.shu...@caviumnetworks.com,
>  erik.g.carri...@intel.com
> Cc: dev@dpdk.org, Pavan Nikhilesh <pbhagavat...@caviumnetworks.com>
> 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 <pbhagavat...@caviumnetworks.com>
> ---
>  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.

Reply via email to