From 68adab9267e6194e96d3ca4c325a9f8dae2e3120 Mon Sep 17 00:00:00 2001 From: Bud Grise Date: Fri, 12 Feb 2016 10:36:11 -0500 Subject: Allow the number of elements in a frame queue to be specified per thread. Change-Id: I026a61a943960dc52539565968a942fbd851da93 Signed-off-by: Todd Foggoa --- vlib/vlib/threads.c | 7 ++++++- vlib/vlib/threads.h | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'vlib') diff --git a/vlib/vlib/threads.c b/vlib/vlib/threads.c index a2ab0d84..32ebdfe7 100644 --- a/vlib/vlib/threads.c +++ b/vlib/vlib/threads.c @@ -631,7 +631,12 @@ static clib_error_t * start_workers (vlib_main_t * vm) continue; /* Allocate "to-worker-N" frame queue */ - fq = vlib_frame_queue_alloc (FRAME_QUEUE_NELTS); + if (tr->frame_queue_nelts) { + fq = vlib_frame_queue_alloc (tr->frame_queue_nelts); + } else { + fq = vlib_frame_queue_alloc (FRAME_QUEUE_NELTS); + } + vec_validate (vlib_frame_queues, worker_thread_index); vlib_frame_queues[worker_thread_index] = fq; diff --git a/vlib/vlib/threads.h b/vlib/vlib/threads.h index ce93b2c6..f13d3768 100644 --- a/vlib/vlib/threads.h +++ b/vlib/vlib/threads.h @@ -37,6 +37,8 @@ typedef struct vlib_thread_registration_ { int fixed_count; u32 count; int no_data_structure_clone; + u32 frame_queue_nelts; + /* All threads of this type run on pthreads */ int use_pthreads; u32 first_index; -- cgit 1.2.3-korg