> From: Pavan Nikhilesh [mailto:[email protected]]
> Sent: Thursday, December 7, 2017 8:37 PM
> To: Eads, Gage <[email protected]>; [email protected];
> Van Haaren, Harry <[email protected]>; Rao, Nikhil
> <[email protected]>; [email protected]; Ma, Liang J
> <[email protected]>
> Cc: [email protected]; Pavan Nikhilesh <[email protected]>
> Subject: [PATCH 09/13] examples/eventdev: add all type queue option
>
> Added configurable option to make queue type as all type queues i.e.
> RTE_EVENT_QUEUE_CFG_ALL_TYPES based on event dev capability
> RTE_EVENT_DEV_CAP_QUEUE_ALL_TYPES.
>
> This can be enabled by supplying '-a' as a cmdline argument.
>
> Signed-off-by: Pavan Nikhilesh <[email protected]>
<snip>
> @@ -494,9 +608,15 @@ opt_check(void)
> void
> set_worker_tx_setup_data(struct setup_data *caps, bool burst)
> {
> - if (burst)
> + uint8_t atq = cdata.all_type_queues ? 1 : 0;
> +
> + if (burst && atq)
> + caps->worker_loop = worker_do_tx_burst_atq;
> + if (burst && !atq)
> caps->worker_loop = worker_do_tx_burst;
> - if (!burst)
> + if (!burst && atq)
> + caps->worker_loop = worker_do_tx_atq;
> + if (!burst && !atq)
> caps->worker_loop = worker_do_tx;
This doesn't scale - we can't keep &&-ing in new options. Refactoring and
calling a function per burst / non-burst suggested, perhaps something like:
if(burst)
caps->worker_loop = get_worker_loop_burst(atq);
else
caps->worker_loop = get_worker_loop_single(atq);