summaryrefslogtreecommitdiffstats
path: root/src/vlib/main.c
diff options
context:
space:
mode:
authorDave Barach <dbarach@cisco.com>2019-03-11 09:57:38 -0400
committerDamjan Marion <dmarion@me.com>2019-03-12 19:09:47 +0000
commit80965f599aa90288c8c139e7e3a31726b89eb9a4 (patch)
tree3348fcd6811634676a4159cd0b4512f0bd1b91ea /src/vlib/main.c
parent26ea14eeade802b8b4993f60506f2b5c9b976433 (diff)
Perf tune handoff queue polling
Change-Id: I5cfa0f6eee67156bf87907fcf8a39f16d68a0905 Signed-off-by: Dave Barach <dave@barachs.net>
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);