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)
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);
vec_validate (vm->processing_rpc_requests, 0);
_vec_len (vm->processing_rpc_requests) = 0;
+ if ((error = vlib_call_all_config_functions (vm, input, 0 /* is_early */ )))
+ goto done;
+
+ /* Call all main loop enter functions. */
+ {
+ clib_error_t *sub_error;
+ sub_error = vlib_call_all_main_loop_enter_functions (vm);
+ if (sub_error)
+ clib_error_report (sub_error);
+ }
+
switch (clib_setjmp (&vm->main_loop_exit, VLIB_MAIN_LOOP_EXIT_NONE))
{
case VLIB_MAIN_LOOP_EXIT_NONE:
goto done;
}
- if ((error = vlib_call_all_config_functions (vm, input, 0 /* is_early */ )))
- goto done;
-
- /* Call all main loop enter functions. */
- {
- clib_error_t *sub_error;
- sub_error = vlib_call_all_main_loop_enter_functions (vm);
- if (sub_error)
- clib_error_report (sub_error);
- }
-
vlib_main_loop (vm);
done: