40 #ifndef included_vlib_main_h 41 #define included_vlib_main_h 57 #ifndef VLIB_ELOG_MAIN_LOOP 58 #define VLIB_ELOG_MAIN_LOOP 0 95 #define VLIB_LOG2_MAIN_LOOPS_PER_STATS_UPDATE 7 102 #define VLIB_MAIN_LOOP_EXIT_NONE 0 103 #define VLIB_MAIN_LOOP_EXIT_PANIC 1 105 #define VLIB_MAIN_LOOP_EXIT_CLI 2 248 f64 limit = t + wait;
254 #define vlib_time_code(vm,body) \ 257 _t[0] = vlib_time_now (vm); \ 258 do { body; } while (0); \ 259 _t[1] = vlib_time_now (vm); \ 260 clib_warning ("%.7e", _t[1] - _t[0]); \ 263 #define vlib_wait_with_timeout(vm,suspend_time,timeout_time,test) \ 265 uword __vlib_wait_with_timeout = 0; \ 266 f64 __vlib_wait_time = 0; \ 267 while (! (__vlib_wait_with_timeout = (test)) \ 268 && __vlib_wait_time < (timeout_time)) \ 270 vlib_process_suspend (vm, suspend_time); \ 271 __vlib_wait_time += suspend_time; \ 273 __vlib_wait_with_timeout; \ 283 #define vlib_panic_with_msg(vm,args...) \ 284 vlib_panic_with_error (vm, clib_error_return (0, args)) 328 return n == 0 ? 0 : (
f64) v / (
f64) n;
336 u32 i,
c, n, v, is_wrap;
378 #define VLIB_PCAP_MAJOR_VERSION 1 379 #define VLIB_PCAP_MINOR_VERSION 0
_vlib_init_function_list_elt_t * worker_init_function_registrations
static f64 vlib_last_vectors_per_main_loop_as_f64(vlib_main_t *vm)
uword * pending_rpc_requests
static void vlib_panic_with_error(vlib_main_t *vm, clib_error_t *error)
u32 vector_counts_per_main_loop[2]
clib_spinlock_t pending_rpc_lock
static void vlib_time_wait(vlib_main_t *vm, f64 wait)
_vlib_init_function_list_elt_t * init_function_registrations
uword * processing_rpc_requests
int elog_post_mortem_dump
uword dispatch_pcap_enable
int elog_trace_cli_commands
vlib_one_time_waiting_process_t * procs_waiting_for_mc_stream_join
vlib_physmem_main_t physmem_main
static void vlib_increment_main_loop_counter(vlib_main_t *vm)
Fixed length block allocator.
PCAP utility definitions.
static f64 vlib_time_now(vlib_main_t *vm)
int elog_trace_api_messages
static f64 clib_time_now(clib_time_t *c)
_vlib_init_function_list_elt_t * main_loop_exit_function_registrations
void vlib_worker_loop(vlib_main_t *vm)
#define VLIB_MAIN_LOOP_EXIT_CLI
void clib_longjmp(clib_longjmp_t *save, uword return_value)
static u32 vlib_last_vectors_per_main_loop(vlib_main_t *vm)
static f64 vlib_last_vector_length_per_node(vlib_main_t *vm)
volatile int parked_at_barrier
_vlib_init_function_list_elt_t * api_init_function_registrations
PCAP main state data structure.
static uword pow2_mask(uword x)
u32 main_loop_vectors_processed
#define VLIB_LOG2_MAIN_LOOPS_PER_STATS_UPDATE
elog_event_type_t * error_elog_event_types
f64 time_last_barrier_release
u64 cpu_time_main_loop_start
u32 node_counts_per_main_loop[2]
static void vlib_set_queue_signal_callback(vlib_main_t *vm, void(*fp)(vlib_main_t *))
static void vlib_panic(vlib_main_t *vm)
vlib_error_main_t error_main
struct vlib_main_t vlib_main_t
elog_event_type_t * node_return_elog_event_types
u32 vlib_app_num_thread_stacks_needed(void)
vlib_buffer_free_list_t * buffer_free_list_pool
uword * init_functions_called
volatile u32 queue_signal_pending
u64(* vlib_node_runtime_perf_counter_cb)(struct vlib_main_t *)
The fine-grained event logger allows lightweight, thread-safe event logging at minimum cost...
#define VLIB_MAIN_LOOP_EXIT_PANIC
int vlib_main(vlib_main_t *vm, unformat_input_t *input)
CLIB_CACHE_LINE_ALIGN_MARK(cacheline0)
_vlib_init_function_list_elt_t * main_loop_enter_function_registrations
u32 main_loop_nodes_processed
vlib_trace_main_t trace_main
int need_vlib_worker_thread_node_runtime_update
static u32 vlib_vector_input_stats_index(vlib_main_t *vm, word delta)
void(* queue_signal_callback)(struct vlib_main_t *)
static uword is_pow2(uword x)
vlib_main_t vlib_global_main
f64 barrier_no_close_before
vlib_node_main_t node_main
void vlib_node_sync_stats(vlib_main_t *vm, vlib_node_t *n)
static f64 clib_time_now_internal(clib_time_t *c, u64 n)
volatile u32 api_queue_nonempty
elog_event_type_t * node_call_elog_event_types
volatile u32 main_loop_exit_now
pcap_main_t dispatch_pcap_main
static f64 vlib_time_now_ticks(vlib_main_t *vm, u64 n)
void(* os_punt_frame)(struct vlib_main_t *vm, struct vlib_node_runtime_t *node, vlib_frame_t *frame)
clib_longjmp_t main_loop_exit
vlib_config_function_runtime_t * config_function_registrations
volatile void(* worker_thread_main_loop_callback)(struct vlib_main_t *)
clib_random_buffer_t random_buffer
clib_error_t * main_loop_error
u64 cpu_time_last_node_dispatch