X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvpp%2Fvnet%2Fmain.c;h=b330f60fafe6d9cdf984f802d197473df1e9fc65;hb=ceab7882f8016c2407a4383f87277bad069885b1;hp=a252b84663a1b40a174c4de36f6e92b92707e7a2;hpb=ca80025805230b34daa10fc1eb16600080c2a54f;p=vpp.git diff --git a/src/vpp/vnet/main.c b/src/vpp/vnet/main.c index a252b84663a..b330f60fafe 100644 --- a/src/vpp/vnet/main.c +++ b/src/vpp/vnet/main.c @@ -18,13 +18,15 @@ #include #include #include - +#include #include static void vpe_main_init (vlib_main_t * vm) { + void vat_plugin_hash_create (void); + if (CLIB_DEBUG > 0) vlib_unix_cli_set_prompt ("DBGvpp# "); else @@ -33,22 +35,22 @@ vpe_main_init (vlib_main_t * vm) /* Turn off network stack components which we don't want */ vlib_mark_init_function_complete (vm, srp_init); + /* + * Create the binary api plugin hashes before loading plugins + */ + vat_plugin_hash_create (); } +/* + * Default path for runtime data + */ +char *vlib_default_runtime_dir = "vpp"; + /* * Load plugins from /usr/lib/vpp_plugins by default */ char *vlib_plugin_path = "/usr/lib/vpp_plugins"; - -void * -vnet_get_handoff_structure (void) -{ - static vnet_plugin_handoff_t _rv, *rv = &_rv; - - rv->vnet_main = vnet_get_main (); - rv->ethernet_main = ðernet_main; - return (void *) rv; -} +char *vlib_plugin_app_version = VPP_BUILD_VER; int main (int argc, char *argv[]) @@ -59,7 +61,6 @@ main (int argc, char *argv[]) uword main_heap_size = (1ULL << 30); u8 *sizep; u32 size; - void vlib_set_get_handoff_structure_cb (void *cb); #if __x86_64__ CLIB_UNUSED (const char *msg) @@ -203,10 +204,6 @@ defaulted: { vm->init_functions_called = hash_create (0, /* value bytes */ 0); vpe_main_init (vm); -#if DPDK == 0 - unix_physmem_init (vm, 0 /* fail_if_physical_memory_not_present */ ); -#endif - vlib_set_get_handoff_structure_cb (&vnet_get_handoff_structure); return vlib_unix_main (argc, argv); } else @@ -261,11 +258,13 @@ plugin_path_config (vlib_main_t * vm, unformat_input_t * input) VLIB_CONFIG_FUNCTION (plugin_path_config, "plugin_path"); void vl_msg_api_post_mortem_dump (void); +void elog_post_mortem_dump (void); void os_panic (void) { vl_msg_api_post_mortem_dump (); + elog_post_mortem_dump (); abort (); } @@ -288,12 +287,21 @@ os_exit (int code) recursion_block = 1; vl_msg_api_post_mortem_dump (); + elog_post_mortem_dump (); vhost_user_unmap_all (); abort (); } exit (code); } +#ifdef BARRIER_TRACING +void +vl_msg_api_barrier_trace_context (const char *context) +{ + vlib_worker_threads[0].barrier_context = context; +} +#endif + void vl_msg_api_barrier_sync (void) { @@ -328,6 +336,12 @@ test_crash_command_fn (vlib_main_t * vm, { u64 *p = (u64 *) 0xdefec8ed; + ELOG_TYPE_DECLARE (e) = + { + .format = "deliberate crash: touching %x",.format_args = "i4",}; + + elog (&vm->elog_main, &e, 0xdefec8ed); + *p = 0xdeadbeef; /* Not so much... */