if (next_thread_index != current_thread_index)
{
-
if (drop_on_congestion &&
is_vlib_frame_queue_congested
(frame_queue_index, next_thread_index, fqm->queue_hi_thresh,
n_drop++;
goto next;
}
+ vlib_mains[next_thread_index]->check_frame_queues = 1;
if (hf)
hf->n_vectors = VLIB_FRAME_SIZE - n_left_to_next_thread;
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);
/* Earliest barrier can be closed again */
f64 barrier_no_close_before;
+ /* Need to check the frame queues */
+ volatile uword check_frame_queues;
+
/* RPC requests, main thread only */
uword *pending_rpc_requests;
uword *processing_rpc_requests;