vlib_main_t
typedef struct vlib_main_t
{
CLIB_CACHE_LINE_ALIGN_MARK (cacheline0); //指定结构体按照64字节对齐,提高缓存命中
/*指令级别的时间. */
clib_time_t clib_time;
/*主线程时间偏移*/
f64 time_offset;
f64 time_last_barrier_release;
/*最后一个节点调度的时间戳. */
u64 cpu_time_last_node_dispatch;
/* 开启主线程时的时间戳. */
u64 cpu_time_main_loop_start;
/* 主循环递增次数. */
u32 main_loop_count;
/*主循环中vectors和nodes计数. */
u32 main_loop_vectors_processed;
u32 main_loop_nodes_processed;
/* 内部节点vectors,calls*/
u64 internal_node_vectors;
u64 internal_node_calls;
u64 internal_node_vectors_last_clear;
u64 internal_node_calls_last_clear;
/* 即时向量速率 */
u32 internal_node_last_vectors_per_main_loop;
/* 主循环 hw/sw 性能计数器*/
void (**vlib_node_runtime_perf_counter_cbs) (struct vlib_main_t *,
u64 *, u64 *,
vlib_node_runtime_t *,
vlib_frame_t *, int);
void (**vlib_node_runtime_perf_counter_cb_tmp) (struct vlib_main_t *,
u64 *, u64 *,
vlib_node_runtime_t *,
vlib_frame_t *, int);
/* Every so often we switch to the next counter. */
#define VLIB_LOG2_MAIN_LOOPS_PER_STATS_UPDATE 7
/*跳转退出主循环. */
u32 main_loop_exit_set;
/* Set e.g. in the SIGTERM signal handler, checked in a safe place... */
volatile u32 main_loop_exit_now;
clib_longjmp_t main_loop_exit;
#define VLIB_MAIN_LOOP_EXIT_NONE 0
#define VLIB_MAIN_LOOP_EXIT_PANIC 1
/* Exit via CLI. */
#define VLIB_MAIN_LOOP_EXIT_CLI 2
/*退出主循环时候的出错标记. */
clib_error_t *main_loop_error;
/*名称,例如:syslog. */
char *name;
/* 堆的开始. */
void *heap_base;
/* 截断版本,帧的索引*/
void *heap_aligned_base;
/* 堆的大小 */
uword heap_size;
/* 缓存区主体结构. */
vlib_buffer_main_t *buffer_main;
/* 物理内存主体结构. */
vlib_physmem_main_t physmem_main;
/*