summaryrefslogtreecommitdiffstats
path: root/src/vlib/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vlib/main.c')
-rw-r--r--src/vlib/main.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/vlib/main.c b/src/vlib/main.c
index 4dcf63e0f9c..c80aa5ab192 100644
--- a/src/vlib/main.c
+++ b/src/vlib/main.c
@@ -1679,6 +1679,7 @@ vlib_main_or_worker_loop (vlib_main_t * vm, int is_main)
u64 cpu_time_now;
vlib_frame_queue_main_t *fqm;
u32 *last_node_runtime_indices = 0;
+ u32 frame_queue_check_counter = 0;
/* Initialize pending node vector. */
if (is_main)
@@ -1734,8 +1735,26 @@ vlib_main_or_worker_loop (vlib_main_t * vm, int is_main)
if (!is_main)
{
vlib_worker_thread_barrier_check ();
- vec_foreach (fqm, tm->frame_queue_mains)
- vlib_frame_queue_dequeue (vm, fqm);
+ if (PREDICT_FALSE (vm->check_frame_queues +
+ frame_queue_check_counter))
+ {
+ u32 processed = 0;
+
+ if (vm->check_frame_queues)
+ {
+ frame_queue_check_counter = 100;
+ vm->check_frame_queues = 0;
+ }
+
+ vec_foreach (fqm, tm->frame_queue_mains)
+ processed += vlib_frame_queue_dequeue (vm, fqm);
+
+ /* No handoff queue work found? */
+ if (processed)
+ frame_queue_check_counter = 100;
+ else
+ frame_queue_check_counter--;
+ }
if (PREDICT_FALSE (vm->worker_thread_main_loop_callback != 0))
((void (*)(vlib_main_t *)) vm->worker_thread_main_loop_callback)
(vm);