Allow the number of elements in a frame queue to be specified per thread. 99/699/2
authorBud Grise <[email protected]>
Fri, 12 Feb 2016 15:36:11 +0000 (10:36 -0500)
committerDave Barach <[email protected]>
Mon, 25 Apr 2016 13:27:45 +0000 (13:27 +0000)
Change-Id: I026a61a943960dc52539565968a942fbd851da93
Signed-off-by: Todd Foggoa <[email protected]>
vlib/vlib/threads.c
vlib/vlib/threads.h

index a2ab0d8..32ebdfe 100644 (file)
@@ -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;
 
index ce93b2c..f13d376 100644 (file)
@@ -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;