[dpdk-dev] [PATCH 09/13] examples/eventdev: add all type queue option
Van Haaren, Harry
harry.van.haaren at intel.com
Tue Dec 19 14:18:45 CET 2017
> From: Pavan Nikhilesh [mailto:pbhagavatula at caviumnetworks.com]
> Sent: Thursday, December 7, 2017 8:37 PM
> To: Eads, Gage <gage.eads at intel.com>; jerin.jacobkollanukkaran at cavium.com;
> Van Haaren, Harry <harry.van.haaren at intel.com>; Rao, Nikhil
> <nikhil.rao at intel.com>; hemant.agrawal at nxp.com; Ma, Liang J
> <liang.j.ma at intel.com>
> Cc: dev at dpdk.org; Pavan Nikhilesh <pbhagavatula at caviumnetworks.com>
> 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 <pbhagavatula at caviumnetworks.com>
<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);
More information about the dev
mailing list