diff options
author | Damjan Marion <damarion@cisco.com> | 2020-09-17 09:54:07 +0200 |
---|---|---|
committer | Andrew Yourtchenko <ayourtch@gmail.com> | 2020-09-24 12:15:52 +0000 |
commit | dccf863d79ee59ff1e86b3b308671648a1d5642c (patch) | |
tree | 35e2a6bbc9d2727de757d6b35518fc02907c216e /src/vlib | |
parent | cc4f3d9102f250628ccceb644682b33fc8d878ad (diff) |
vppinfra: allow handoff to main thread
Type: improvement
Change-Id: If2e907967c9b75997b581ff0c058bd5c15e823f5
Signed-off-by: Damjan Marion <damarion@cisco.com>
(cherry picked from commit f6e6c788070e1421bbe7b10d449d9b65918ba561)
Diffstat (limited to 'src/vlib')
-rw-r--r-- | src/vlib/main.c | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/src/vlib/main.c b/src/vlib/main.c index bada9bcfdff..bfe97953a03 100644 --- a/src/vlib/main.c +++ b/src/vlib/main.c @@ -1771,28 +1771,26 @@ vlib_main_or_worker_loop (vlib_main_t * vm, int is_main) } if (!is_main) + vlib_worker_thread_barrier_check (); + + if (PREDICT_FALSE (vm->check_frame_queues + frame_queue_check_counter)) { - vlib_worker_thread_barrier_check (); - if (PREDICT_FALSE (vm->check_frame_queues + - frame_queue_check_counter)) - { - u32 processed = 0; + u32 processed = 0; - if (vm->check_frame_queues) - { - frame_queue_check_counter = 100; - vm->check_frame_queues = 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); + 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--; - } + /* No handoff queue work found? */ + if (processed) + frame_queue_check_counter = 100; + else + frame_queue_check_counter--; } if (PREDICT_FALSE (vec_len (vm->worker_thread_main_loop_callbacks))) |