X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvlib%2Fmain.c;h=e4c4438b5aa54e17bdcbd66160c35f180a220b71;hb=048a4e5a000017d0d632ebf02dcc23d9bf9ccf72;hp=f915aa41b3bce7f37f84742d2c3344e53aae0558;hpb=d47c509af13ddcb80f82aebd25dc4f40cc778a0e;p=vpp.git diff --git a/src/vlib/main.c b/src/vlib/main.c index f915aa41b3b..e4c4438b5aa 100644 --- a/src/vlib/main.c +++ b/src/vlib/main.c @@ -460,7 +460,7 @@ vlib_put_next_frame (vlib_main_t * vm, vlib_frame_t *f; u32 n_vectors_in_frame; - if (vm->buffer_main->callbacks_registered == 0 && CLIB_DEBUG > 0) + if (buffer_main.callbacks_registered == 0 && CLIB_DEBUG > 0) vlib_put_next_frame_validate (vm, r, next_index, n_vectors_left); nf = vlib_node_runtime_get_next_frame (vm, r, next_index); @@ -1276,6 +1276,7 @@ dispatch_process (vlib_main_t * vm, vlib_node_main_t *nm = &vm->node_main; vlib_node_runtime_t *node_runtime = &p->node_runtime; vlib_node_t *node = vlib_get_node (vm, node_runtime->node_index); + u32 old_process_index; u64 t; uword n_vectors, is_suspend; @@ -1291,11 +1292,12 @@ dispatch_process (vlib_main_t * vm, f ? f->n_vectors : 0, /* is_after */ 0); /* Save away current process for suspend. */ + old_process_index = nm->current_process_index; nm->current_process_index = node->runtime_index; n_vectors = vlib_process_startup (vm, p, f); - nm->current_process_index = ~0; + nm->current_process_index = old_process_index; ASSERT (n_vectors != VLIB_PROCESS_RETURN_LONGJMP_RETURN); is_suspend = n_vectors == VLIB_PROCESS_RETURN_LONGJMP_SUSPEND; @@ -1493,13 +1495,12 @@ vlib_main_or_worker_loop (vlib_main_t * vm, int is_main) } /* Process pre-input nodes. */ - if (is_main) - vec_foreach (n, nm->nodes_by_type[VLIB_NODE_TYPE_PRE_INPUT]) - cpu_time_now = dispatch_node (vm, n, - VLIB_NODE_TYPE_PRE_INPUT, - VLIB_NODE_STATE_POLLING, - /* frame */ 0, - cpu_time_now); + vec_foreach (n, nm->nodes_by_type[VLIB_NODE_TYPE_PRE_INPUT]) + cpu_time_now = dispatch_node (vm, n, + VLIB_NODE_TYPE_PRE_INPUT, + VLIB_NODE_STATE_POLLING, + /* frame */ 0, + cpu_time_now); /* Next process input nodes. */ vec_foreach (n, nm->nodes_by_type[VLIB_NODE_TYPE_INPUT]) @@ -1716,6 +1717,12 @@ vlib_main (vlib_main_t * volatile vm, unformat_input_t * input) goto done; } + if ((error = vlib_call_init_function (vm, map_stat_segment_init))) + { + clib_error_report (error); + goto done; + } + /* Register static nodes so that init functions may use them. */ vlib_register_all_static_nodes (vm); @@ -1735,6 +1742,24 @@ vlib_main (vlib_main_t * volatile vm, unformat_input_t * input) goto done; } + if ((error = vlib_call_init_function (vm, vpe_api_init))) + { + clib_error_report (error); + goto done; + } + + if ((error = vlib_call_init_function (vm, vlibmemory_init))) + { + clib_error_report (error); + goto done; + } + + if ((error = vlib_call_init_function (vm, map_api_segment_init))) + { + clib_error_report (error); + goto done; + } + /* See unix/main.c; most likely already set up */ if (vm->init_functions_called == 0) vm->init_functions_called = hash_create (0, /* value bytes */ 0); @@ -1742,9 +1767,8 @@ vlib_main (vlib_main_t * volatile vm, unformat_input_t * input) goto done; /* Create default buffer free list. */ - vlib_buffer_get_or_create_free_list (vm, - VLIB_BUFFER_DEFAULT_FREE_LIST_BYTES, - "default"); + vlib_buffer_create_free_list (vm, VLIB_BUFFER_DEFAULT_FREE_LIST_BYTES, + "default"); nm->timing_wheel = clib_mem_alloc_aligned (sizeof (TWT (tw_timer_wheel)), CLIB_CACHE_LINE_BYTES);