[dpdk-dev] [PATCH v2] app/eventdev: add option to set global dequeue tmo
Jerin Jacob Kollanukkaran
jerinj at marvell.com
Thu Mar 28 06:26:23 CET 2019
On Wed, 2019-03-27 at 17:07 +0000, Pavan Nikhilesh Bhagavatula wrote:
> From: Pavan Nikhilesh <pbhagavatula at marvell.com>
>
> Add option to provide a global dequeue timeout that is used to create
> the eventdev.
> The dequeue timeout provided will be common across all the worker
> ports. If the eventdev hardware supports power management through
> dequeue timeout then this option can be used for verifying power
> demands at various packet rates.
>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula at marvell.com>
> ---
>
> +
> + rte_event_dev_info_get(opt->dev_id, &info);
> + if (opt->deq_tmo_nsec) {
> + if (opt->deq_tmo_nsec < info.min_dequeue_timeout_ns) {
> + opt->deq_tmo_nsec =
> info.min_dequeue_timeout_ns;
> + evt_info("dequeue_timeout_ns too low, using
> %d",
> + opt->deq_tmo_nsec);
> + }
> + if (opt->deq_tmo_nsec > info.max_dequeue_timeout_ns) {
> + opt->deq_tmo_nsec =
> info.max_dequeue_timeout_ns;
> + evt_info("dequeue_timeout_ns too high, using
> %d",
> + opt->deq_tmo_nsec);
> + }
> + }
This code is repeating in multiple palaces, Move this as a function as
use everywhere. Other than this, it looks good to me.
More information about the dev
mailing list