Hi Pavan,

Some comments in-line:

> -----Original Message-----
> From: Pavan Nikhilesh [mailto:pbhagavat...@caviumnetworks.com]
> Sent: Sunday, March 18, 2018 8:12 AM
> To: jerin.ja...@caviumnetworks.com;
> santosh.shu...@caviumnetworks.com; Carrillo, Erik G
> <erik.g.carri...@intel.com>
> Cc: dev@dpdk.org; Pavan Nikhilesh <pbhagavat...@caviumnetworks.com>
> Subject: [dpdk-dev] [PATCH 1/4] app/eventdev: add event timer adapter as
> a producer
> 
> Add event timer adapter as producer option that can be selected by passing -
> -prod_type_timerdev.
> 
> Signed-off-by: Pavan Nikhilesh <pbhagavat...@caviumnetworks.com>
> ---

<...snipped...>

> diff --git a/app/test-eventdev/test_perf_common.c b/app/test-
> eventdev/test_perf_common.c
> index 59fa0a49e..6ae146d91 100644
> --- a/app/test-eventdev/test_perf_common.c
> +++ b/app/test-eventdev/test_perf_common.c
> @@ -72,6 +72,62 @@ perf_producer(void *arg)
>       return 0;
>  }
> 
> +static inline int
> +perf_event_timer_producer(void *arg)
> +{
> +     struct prod_data *p  = arg;
> +     struct test_perf *t = p->t;
> +     struct evt_options *opt = t->opt;
> +     uint32_t flow_counter = 0;
> +     uint64_t count = 0;
> +     uint64_t arm_latency = 0;
> +     const uint8_t nb_timer_adptrs = opt->nb_timer_adptrs;
> +     const uint32_t nb_flows = t->nb_flows;
> +     const uint64_t nb_timers = opt->nb_timers;
> +     struct rte_mempool *pool = t->pool;
> +     struct perf_elt *m = NULL;
> +     struct rte_event_timer_adapter **adptr = t->timer_adptr;
> +     const struct rte_event_timer tim = {
> +             .ev.op = RTE_EVENT_OP_NEW,
> +             .ev.queue_id = p->queue_id,
> +             .ev.sched_type = t->opt->sched_type_list[0],
> +             .ev.priority = RTE_EVENT_DEV_PRIORITY_NORMAL,
> +             .ev.event_type =  RTE_EVENT_TYPE_TIMER,
> +             .timeout_ticks = opt->optm_bkt_tck_nsec ?
> +                     (opt->nb_bkt_tcks * opt->bkt_tck_nsec) /
> +                     opt->optm_bkt_tck_nsec : opt->nb_bkt_tcks,

We should also initialize .state = RTE_EVENT_TIMER_NOT_ARMED.

Also, would it be better to take the ceiling instead of the floor when scaling 
the ticks with:

((opt->nb_bkt_tcks * opt->bkt_tck_nsec) + opt->optm_bkt_tck_nsec - 1) / 
opt->optm_bkt_tck_nsec

If the fraction is less than one in the current form, then truncation would 
return 0, which at least in the case of the software impl would be treated as 
RTE_EVENT_TIMER_ERROR_TOOEARLY.

Thoughts?

Regards,
Gabriel

Reply via email to