Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
vcl: fix error state switch for vcl_handle_mq_event
[vpp.git]
/
src
/
vlib
/
main.h
diff --git
a/src/vlib/main.h
b/src/vlib/main.h
index
c655560
..
94b8c4f
100644
(file)
--- a/
src/vlib/main.h
+++ b/
src/vlib/main.h
@@
-40,6
+40,7
@@
#ifndef included_vlib_main_h
#define included_vlib_main_h
#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>
#include <vppinfra/callback_data.h>
#include <vppinfra/elog.h>
#include <vppinfra/format.h>
@@
-143,6
+144,8
@@
typedef struct vlib_main_t
u32 main_loop_exit_set;
/* Set e.g. in the SIGTERM signal handler, checked in a safe place... */
volatile u32 main_loop_exit_now;
u32 main_loop_exit_set;
/* Set e.g. in the SIGTERM signal handler, checked in a safe place... */
volatile u32 main_loop_exit_now;
+ /* Exit status that will be returned by the process upon exit. */
+ volatile int main_loop_exit_status;
clib_longjmp_t main_loop_exit;
#define VLIB_MAIN_LOOP_EXIT_NONE 0
#define VLIB_MAIN_LOOP_EXIT_PANIC 1
clib_longjmp_t main_loop_exit;
#define VLIB_MAIN_LOOP_EXIT_NONE 0
#define VLIB_MAIN_LOOP_EXIT_PANIC 1
@@
-152,15
+155,6
@@
typedef struct vlib_main_t
/* Error marker to use when exiting main loop. */
clib_error_t *main_loop_error;
/* 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;
/* buffer main structure. */
vlib_buffer_main_t *buffer_main;
@@
-218,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 *);
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)
/* Top of (worker) dispatch loop callback */
void (**volatile worker_thread_main_loop_callbacks)
@@
-281,6
+274,12
@@
typedef struct vlib_global_main_t
/* Name for e.g. syslog. */
char *name;
/* 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);
/* post-mortem callbacks */
void (**post_mortem_callbacks) (void);
@@
-308,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 *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;
_vlib_init_function_list_elt_t *api_init_function_registrations;
vlib_config_function_runtime_t *config_function_registrations;
@@
-377,7
+377,13
@@
always_inline void
vlib_panic_with_error (vlib_main_t * vm, clib_error_t * error)
{
vm->main_loop_error = error;
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...) \
}
#define vlib_panic_with_msg(vm,args...) \
@@
-389,6
+395,8
@@
vlib_panic (vlib_main_t * vm)
vlib_panic_with_error (vm, 0);
}
vlib_panic_with_error (vm, 0);
}
+/* Asynchronously requests exit with the given status. */
+void vlib_exit_with_status (vlib_main_t *vm, int status);
always_inline f64
vlib_internal_node_vector_rate (vlib_main_t * vm)
always_inline f64
vlib_internal_node_vector_rate (vlib_main_t * vm)
@@
-465,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);
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. */
}
/* Main routine. */