aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBud Grise <griseb@cisco.com>2016-02-12 10:36:11 -0500
committerDave Barach <openvpp@barachs.net>2016-04-25 13:27:45 +0000
commit68adab9267e6194e96d3ca4c325a9f8dae2e3120 (patch)
treea51edcc6b65b88bcbc9324a0baa6c80345a78c84
parenta30d40d33c308c254414835e116db1d72c204b50 (diff)
Allow the number of elements in a frame queue to be specified per thread.
Change-Id: I026a61a943960dc52539565968a942fbd851da93 Signed-off-by: Todd Foggoa <tfoggoa@cisco.com>
-rw-r--r--vlib/vlib/threads.c7
-rw-r--r--vlib/vlib/threads.h2
2 files changed, 8 insertions, 1 deletions
diff --git a/vlib/vlib/threads.c b/vlib/vlib/threads.c
index a2ab0d84750..32ebdfe761d 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 ce93b2c67cb..f13d3768e42 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;