diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/vnet/session/session.c | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/src/vnet/session/session.c b/src/vnet/session/session.c index c447557f8b0..c24a95fd9a6 100644 --- a/src/vnet/session/session.c +++ b/src/vnet/session/session.c @@ -1656,8 +1656,7 @@ void session_queue_run_on_main_thread (vlib_main_t * vm) { ASSERT (vlib_get_thread_index () == 0); - vlib_process_signal_event_mt (vm, session_queue_process_node.index, - SESSION_Q_PROCESS_RUN_ON_MAIN, 0); + vlib_node_set_interrupt_pending (vm, session_queue_node.index); } static clib_error_t * @@ -1749,35 +1748,41 @@ session_manager_main_disable (vlib_main_t * vm) void session_node_enable_disable (u8 is_en) { + u8 mstate = is_en ? VLIB_NODE_STATE_INTERRUPT : VLIB_NODE_STATE_DISABLED; u8 state = is_en ? VLIB_NODE_STATE_POLLING : VLIB_NODE_STATE_DISABLED; - vlib_thread_main_t *vtm = vlib_get_thread_main (); - u8 have_workers = vtm->n_threads != 0; + session_main_t *sm = &session_main; + vlib_main_t *vm; + vlib_node_t *n; + int n_vlibs, i; - foreach_vlib_main () + n_vlibs = vlib_get_n_threads (); + for (i = 0; i < n_vlibs; i++) { - if (have_workers && ii == 0) + vm = vlib_get_main_by_index (i); + /* main thread with workers and not polling */ + if (i == 0 && n_vlibs > 1) { + vlib_node_set_state (vm, session_queue_node.index, mstate); if (is_en) { - vlib_node_set_state (this_vlib_main, - session_queue_process_node.index, state); - vlib_node_t *n = vlib_get_node ( - this_vlib_main, session_queue_process_node.index); - vlib_start_process (this_vlib_main, n->runtime_index); + vlib_node_set_state (vm, session_queue_process_node.index, + state); + n = vlib_get_node (vm, session_queue_process_node.index); + vlib_start_process (vm, n->runtime_index); } else { - vlib_process_signal_event_mt (this_vlib_main, + vlib_process_signal_event_mt (vm, session_queue_process_node.index, SESSION_Q_PROCESS_STOP, 0); } - if (!session_main.poll_main) + if (!sm->poll_main) continue; } - vlib_node_set_state (this_vlib_main, session_queue_node.index, state); + vlib_node_set_state (vm, session_queue_node.index, state); } - if (session_main.use_private_rx_mqs) + if (sm->use_private_rx_mqs) application_enable_rx_mqs_nodes (is_en); } |