From 6ffb7c61899eb782416cbd2f117042a583f189f7 Mon Sep 17 00:00:00 2001 From: Damjan Marion Date: Fri, 26 Mar 2021 13:06:13 +0100 Subject: vlib: introduce vlib_get_main_by_index(), vlib_get_n_threads() Type: improvement Change-Id: If3da7d4338470912f37ff1794620418d928fb77f Signed-off-by: Damjan Marion --- src/vlib/buffer_node.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/vlib/buffer_node.h') diff --git a/src/vlib/buffer_node.h b/src/vlib/buffer_node.h index 0fa18d6dde2..17eb54e48be 100644 --- a/src/vlib/buffer_node.h +++ b/src/vlib/buffer_node.h @@ -545,7 +545,8 @@ vlib_buffer_enqueue_to_thread (vlib_main_t * vm, u32 frame_queue_index, { hf->n_vectors = VLIB_FRAME_SIZE; vlib_put_frame_queue_elt (hf); - vlib_mains[current_thread_index]->check_frame_queues = 1; + vlib_get_main_by_index (current_thread_index)->check_frame_queues = + 1; current_thread_index = ~0; ptd->handoff_queue_elt_by_thread_index[next_thread_index] = 0; hf = 0; @@ -574,7 +575,7 @@ vlib_buffer_enqueue_to_thread (vlib_main_t * vm, u32 frame_queue_index, if (1 || hf->n_vectors == hf->last_n_vectors) { vlib_put_frame_queue_elt (hf); - vlib_mains[i]->check_frame_queues = 1; + vlib_get_main_by_index (i)->check_frame_queues = 1; ptd->handoff_queue_elt_by_thread_index[i] = 0; } else -- cgit 1.2.3-korg