40 #ifndef included_vlib_main_h 41 #define included_vlib_main_h 55 #ifndef VLIB_ELOG_MAIN_LOOP 56 #define VLIB_ELOG_MAIN_LOOP 0 83 #define VLIB_LOG2_MAIN_LOOPS_PER_STATS_UPDATE 7 88 #define VLIB_MAIN_LOOP_EXIT_NONE 0 89 #define VLIB_MAIN_LOOP_EXIT_PANIC 1 91 #define VLIB_MAIN_LOOP_EXIT_CLI 2 194 f64 limit = t + wait;
200 #define vlib_time_code(vm,body) \ 203 _t[0] = vlib_time_now (vm); \ 204 do { body; } while (0); \ 205 _t[1] = vlib_time_now (vm); \ 206 clib_warning ("%.7e", _t[1] - _t[0]); \ 209 #define vlib_wait_with_timeout(vm,suspend_time,timeout_time,test) \ 211 uword __vlib_wait_with_timeout = 0; \ 212 f64 __vlib_wait_time = 0; \ 213 while (! (__vlib_wait_with_timeout = (test)) \ 214 && __vlib_wait_time < (timeout_time)) \ 216 vlib_process_suspend (vm, suspend_time); \ 217 __vlib_wait_time += suspend_time; \ 219 __vlib_wait_with_timeout; \ 229 #define vlib_panic_with_msg(vm,args...) \ 230 vlib_panic_with_error (vm, clib_error_return (0, args)) 272 return n == 0 ? 0 : (
f64) v / (
f64) n;
280 u32 i, c, n, v, is_wrap;
void(* os_punt_frame)(struct vlib_main_t *vm, struct vlib_node_runtime_t *node, vlib_frame_t *frame)
sll srl srl sll sra u16x4 i
u32 vector_counts_per_main_loop[2]
_vlib_init_function_list_elt_t * init_function_registrations
static void(BVT(clib_bihash)*h, BVT(clib_bihash_value)*v)
always_inline f64 clib_time_now_internal(clib_time_t *c, u64 n)
vlib_one_time_waiting_process_t * procs_waiting_for_mc_stream_join
vlib_physmem_main_t physmem_main
_vlib_init_function_list_elt_t * main_loop_exit_function_registrations
always_inline f64 vlib_last_vectors_per_main_loop_as_f64(vlib_main_t *vm)
vlib_buffer_main_t * buffer_main
void clib_longjmp(clib_longjmp_t *save, uword return_value)
_vlib_init_function_list_elt_t * api_init_function_registrations
u32 main_loop_vectors_processed
always_inline void vlib_panic(vlib_main_t *vm)
#define VLIB_LOG2_MAIN_LOOPS_PER_STATS_UPDATE
elog_event_type_t * error_elog_event_types
u64 cpu_time_main_loop_start
u32 node_counts_per_main_loop[2]
always_inline f64 clib_time_now(clib_time_t *c)
vlib_error_main_t error_main
struct vlib_main_t vlib_main_t
always_inline void vlib_time_wait(vlib_main_t *vm, f64 wait)
elog_event_type_t * node_return_elog_event_types
always_inline f64 vlib_last_vector_length_per_node(vlib_main_t *vm)
u32 vlib_app_num_thread_stacks_needed(void)
uword * init_functions_called
volatile u32 queue_signal_pending
#define VLIB_MAIN_LOOP_EXIT_PANIC
int vlib_main(vlib_main_t *vm, unformat_input_t *input)
always_inline u32 vlib_last_vectors_per_main_loop(vlib_main_t *vm)
always_inline void vlib_set_queue_signal_callback(vlib_main_t *vm, void(*fp)(vlib_main_t *))
always_inline f64 vlib_time_now_ticks(vlib_main_t *vm, u64 n)
always_inline uword is_pow2(uword x)
always_inline void vlib_panic_with_error(vlib_main_t *vm, clib_error_t *error)
_vlib_init_function_list_elt_t * main_loop_enter_function_registrations
u32 main_loop_nodes_processed
mc_serialize_msg_t * mc_msg_registrations
vlib_trace_main_t trace_main
void(* queue_signal_callback)(struct vlib_main_t *)
vlib_main_t vlib_global_main
struct _mc_serialize_msg mc_serialize_msg_t
vlib_node_main_t node_main
always_inline void vlib_increment_main_loop_counter(vlib_main_t *vm)
volatile u32 api_queue_nonempty
elog_event_type_t * node_call_elog_event_types
always_inline f64 vlib_time_now(vlib_main_t *vm)
clib_longjmp_t main_loop_exit
always_inline uword pow2_mask(uword x)
vlib_config_function_runtime_t * config_function_registrations
void(* os_physmem_free)(void *x)
always_inline u32 vlib_vector_input_stats_index(vlib_main_t *vm, word delta)
clib_random_buffer_t random_buffer
clib_error_t * main_loop_error
u64 cpu_time_last_node_dispatch