aboutsummaryrefslogtreecommitdiffstats
path: root/src/vlib/main.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/vlib/main.h')
-rw-r--r--src/vlib/main.h28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/vlib/main.h b/src/vlib/main.h
index a16f603f467..94b8c4fa954 100644
--- a/src/vlib/main.h
+++ b/src/vlib/main.h
@@ -40,6 +40,7 @@
#ifndef included_vlib_main_h
#define included_vlib_main_h
+#include <vppinfra/clib.h>
#include <vppinfra/callback_data.h>
#include <vppinfra/elog.h>
#include <vppinfra/format.h>
@@ -154,15 +155,6 @@ typedef struct vlib_main_t
/* Error marker to use when exiting main loop. */
clib_error_t *main_loop_error;
- /* Start of the heap. */
- void *heap_base;
-
- /* Truncated version, to create frame indices */
- void *heap_aligned_base;
-
- /* Size of the heap */
- uword heap_size;
-
/* buffer main structure. */
vlib_buffer_main_t *buffer_main;
@@ -220,7 +212,6 @@ typedef struct vlib_main_t
volatile u32 queue_signal_pending;
volatile u32 api_queue_nonempty;
void (*queue_signal_callback) (struct vlib_main_t *);
- u8 **argv;
/* Top of (worker) dispatch loop callback */
void (**volatile worker_thread_main_loop_callbacks)
@@ -283,6 +274,12 @@ typedef struct vlib_global_main_t
/* Name for e.g. syslog. */
char *name;
+ /* full path to main executable */
+ char *exec_path;
+
+ /* command line arguments */
+ u8 **argv;
+
/* post-mortem callbacks */
void (**post_mortem_callbacks) (void);
@@ -310,6 +307,7 @@ typedef struct vlib_global_main_t
_vlib_init_function_list_elt_t *main_loop_enter_function_registrations;
_vlib_init_function_list_elt_t *main_loop_exit_function_registrations;
_vlib_init_function_list_elt_t *worker_init_function_registrations;
+ _vlib_init_function_list_elt_t *num_workers_change_function_registrations;
_vlib_init_function_list_elt_t *api_init_function_registrations;
vlib_config_function_runtime_t *config_function_registrations;
@@ -379,7 +377,13 @@ always_inline void
vlib_panic_with_error (vlib_main_t * vm, clib_error_t * error)
{
vm->main_loop_error = error;
- clib_longjmp (&vm->main_loop_exit, VLIB_MAIN_LOOP_EXIT_PANIC);
+ if (vm->main_loop_exit_set)
+ clib_longjmp (&vm->main_loop_exit, VLIB_MAIN_LOOP_EXIT_PANIC);
+ else
+ {
+ clib_warning ("panic: %U", format_clib_error, error);
+ abort ();
+ }
}
#define vlib_panic_with_msg(vm,args...) \
@@ -469,7 +473,7 @@ vlib_main_init ()
vgm->init_functions_called = hash_create (0, /* value bytes */ 0);
vm = clib_mem_alloc_aligned (sizeof (*vm), CLIB_CACHE_LINE_BYTES);
- vec_add1 (vgm->vlib_mains, vm);
+ vec_add1_ha (vgm->vlib_mains, vm, 0, CLIB_CACHE_LINE_BYTES);
}
/* Main routine. */