50 #define VLIB_FRAME_SIZE_ALLOC (VLIB_FRAME_SIZE + 4) 63 #define VLIB_FRAME_SIZE_EXTRA 4 68 #define VLIB_FRAME_MAGIC (0xabadc0ed) 69 n_bytes +=
sizeof (
u32);
91 u32 n_scalar_bytes,
u32 n_vector_bytes)
93 #ifdef VLIB_SUPPORTS_ARBITRARY_SCALAR_SIZES 94 uword key = (n_scalar_bytes << 16) | n_vector_bytes;
123 u32 l, n, scalar_size, vector_size;
206 else if (from[i] == 0xfefefefe)
208 clib_warning (
"BUG: frame poison pattern at index %d", i);
278 if (n_alloc + n_free > 0)
288 .path =
"show vlib frame-allocation",
289 .short_help =
"Show node dispatch frame statistics",
329 tmp = owner_next_frame[0];
330 owner_next_frame[0] = next_frame[0];
340 if (next_frame->
frame != NULL)
381 u32 next_index,
u32 allocate_new_next_frame)
415 if (n_used >=
VLIB_FRAME_SIZE || (allocate_new_next_frame && n_used > 0) ||
446 u32 next_index,
u32 n_vectors_left)
453 u32 n_before, n_after;
465 ASSERT (n_after >= n_before);
485 u32 next_index,
u32 n_vectors_left)
490 u32 n_vectors_in_frame;
557 v1 = v0 + n_vectors_in_frame;
618 if (vm != &vlib_global_main)
654 u32 ca0, ca1, v0, v1, cl0, cl1, r;
655 u32 ptick00, ptick01, ptick10, ptick11, pvec0, pvec1;
666 cl1 = cl0 + n_clocks;
667 ptick01 = ptick00 + n_ticks0;
668 ptick11 = ptick10 + n_ticks1;
669 pvec1 = pvec0 + n_vectors;
684 if (
PREDICT_FALSE (ca1 < ca0 || v1 < v0 || cl1 < cl0) || (ptick01 < ptick00)
685 || (ptick11 < ptick10) || (pvec1 < pvec0))
710 pmc1, node, frame, before_or_after);
719 n_calls, n_vectors, n_clocks, 0ULL, 0ULL);
732 .path =
"event-logger clear",
733 .short_help =
"Clear the event log",
744 char *file, *chroot_file;
755 if (strstr (file,
"..") || index (file,
'/'))
761 chroot_file = (
char *)
format (0,
"/tmp/%s%c", file, 0);
787 filename =
format (0,
"/tmp/elog_post_mortem.%d%c", getpid (), 0);
796 .path =
"event-logger save",
797 .short_help =
"event-logger save <filename> (saves log in /tmp/<filename>)",
816 .path =
"event-logger stop",
817 .short_help =
"Stop the event-logger",
836 .path =
"event-logger restart",
837 .short_help =
"Restart the event-logger",
860 vlib_cli_output (vm,
"Resized ring and restarted the event logger...");
866 .path =
"event-logger resize",
867 .short_help =
"event-logger resize <nnn>",
889 "running" :
"stopped");
895 if (n_events_to_show == 0)
906 u32 n_events_to_show;
909 n_events_to_show = 250;
912 if (
unformat (input,
"%d", &n_events_to_show))
915 n_events_to_show = ~0;
925 .path =
"show event-logger",
926 .short_help =
"Show event logger info",
975 #if VLIB_BUFFER_TRACE_TRAJECTORY > 0 976 void (*vlib_buffer_trace_trajectory_cb) (
vlib_buffer_t * b,
u32 node_index);
977 void (*vlib_buffer_trace_trajectory_init_cb) (
vlib_buffer_t * b);
982 if (
PREDICT_TRUE (vlib_buffer_trace_trajectory_init_cb != 0))
984 (*vlib_buffer_trace_trajectory_init_cb) (b);
993 #if VLIB_BUFFER_TRACE_TRAJECTORY > 0 994 if (
PREDICT_TRUE (vlib_buffer_trace_trajectory_cb != 0))
996 (*vlib_buffer_trace_trajectory_cb) (b, node_index);
1005 s =
format (s,
"BUG STUB %s", __FUNCTION__);
1013 s =
format (s,
"BUG STUB %s", __FUNCTION__);
1018 __attribute__ ((weak));
1022 s =
format (s,
"BUG STUB %s", __FUNCTION__);
1032 s =
format (s,
"current_data: %d, current_length: %d\n",
1036 "current_config_index/punt_reason: %d, flow_id: %x, next_buffer: %x\n",
1039 format (s,
"error: %d, ref_count: %d, buffer_pool_index: %d\n",
1048 #define A(x) vec_add1(vm->pcap_buffer, (x)) 1067 if (frame == 0 || frame->
n_vectors == 0)
1092 A ((from[i] >> 24) & 0xff);
1093 A ((from[i] >> 16) & 0xff);
1094 A ((from[i] >> 8) & 0xff);
1095 A ((from[i] >> 0) & 0xff);
1131 n_left =
clib_min (capture_size, 16384);
1169 u64 pmc_before[2], pmc_after[2], pmc_delta[2];
1181 return last_time_stamp;
1185 && dispatch_state != VLIB_NODE_STATE_INTERRUPT)
1192 return last_time_stamp;
1206 last_time_stamp, frame ? frame->
n_vectors : 0,
1229 n = node->
function (vm, node, frame);
1235 n = node->
function (vm, node, frame);
1247 pmc_delta[0] = pmc_after[0] - pmc_before[0];
1248 pmc_delta[1] = pmc_after[1] - pmc_before[1];
1258 t - last_time_stamp,
1264 if (
PREDICT_FALSE ((dispatch_state == VLIB_NODE_STATE_INTERRUPT)
1265 || (dispatch_state == VLIB_NODE_STATE_POLLING
1273 .function = (
char *) __FUNCTION__,
1274 .
format =
"%s vector length %d, switching to %s",
1275 .format_args =
"T4i4t4",
1276 .n_enum_strings = 2,
1278 "interrupt",
"polling",
1284 u32 node_name, vector_length, is_polling;
1287 if ((dispatch_state == VLIB_NODE_STATE_INTERRUPT
1293 n->
state = VLIB_NODE_STATE_POLLING;
1294 node->
state = VLIB_NODE_STATE_POLLING;
1309 ed->vector_length = v;
1313 else if (dispatch_state == VLIB_NODE_STATE_POLLING
1314 && v <= nm->interrupt_threshold_vector_length)
1322 n->
state = VLIB_NODE_STATE_INTERRUPT;
1323 node->
state = VLIB_NODE_STATE_INTERRUPT;
1341 ed->vector_length = v;
1353 u64 last_time_stamp)
1383 restore_frame = NULL;
1389 restore_frame = p->
frame;
1405 VLIB_NODE_STATE_POLLING,
1406 f, last_time_stamp);
1417 if (restore_frame != NULL)
1445 if (NULL == nf->
frame)
1448 nf->
frame = restore_frame;
1468 return last_time_stamp;
1550 u32 old_process_index;
1552 uword n_vectors, is_suspend;
1554 if (node->
state != VLIB_NODE_STATE_POLLING
1557 return last_time_stamp;
1561 t = last_time_stamp;
1590 TWT (tw_timer_wheel) * tw =
1611 t - last_time_stamp);
1626 uword process_index,
u64 last_time_stamp)
1634 u64 t, n_vectors, is_suspend;
1636 t = last_time_stamp;
1640 return last_time_stamp;
1694 t - last_time_stamp);
1715 u32 *last_node_runtime_indices = 0;
1716 u32 frame_queue_check_counter = 0;
1736 vec_alloc (last_node_runtime_indices, 32);
1782 frame_queue_check_counter))
1788 frame_queue_check_counter = 100;
1797 frame_queue_check_counter = 100;
1799 frame_queue_check_counter--;
1809 VLIB_NODE_STATE_POLLING,
1817 VLIB_NODE_STATE_POLLING,
1841 last_node_runtime_indices;
1842 last_node_runtime_indices = tmp;
1843 _vec_len (last_node_runtime_indices) = 0;
1846 for (i = 0; i < l; i++)
1849 last_node_runtime_indices[i]);
1852 VLIB_NODE_STATE_INTERRUPT,
1871 .format =
"process tw start",
1876 .format =
"process tw end: %d",
1877 .format_args =
"i4",
1965 f64 this_loops_per_second;
1967 this_loops_per_second =
2004 int turn_on_mem_trace = 0;
2008 if (
unformat (input,
"memory-trace"))
2009 turn_on_mem_trace = 1;
2011 else if (
unformat (input,
"elog-events %d",
2014 else if (
unformat (input,
"elog-post-mortem-dump"))
2016 else if (
unformat (input,
"buffer-alloc-success-rate %f",
2019 if (VLIB_BUFFER_ALLOC_FAULT_INJECTOR == 0)
2021 (0,
"Buffer fault injection not configured");
2023 else if (
unformat (input,
"buffer-alloc-success-seed %u",
2026 if (VLIB_BUFFER_ALLOC_FAULT_INJECTOR == 0)
2028 (0,
"Buffer fault injection not configured");
2037 if (turn_on_mem_trace)
2050 #define foreach_weak_reference_stub \ 2051 _(vlib_map_stat_segment_init) \ 2053 _(vlibmemory_init) \ 2054 _(map_api_segment_init) 2057 clib_error_t *name (vlib_main_t *vm) __attribute__((weak)); \ 2058 clib_error_t *name (vlib_main_t *vm) { return 0; } 2192 if (VLIB_BUFFER_ALLOC_FAULT_INJECTOR > 0)
2267 (vm,
"pcap dispatch capture enabled: %d of %d pkts...",
2274 "Buffer trace of %d pkts from %U enabled...",
2306 tm = &this_vlib_main->trace_main;
2322 memset (pm, 0,
sizeof (*pm));
2380 u32 node_index = ~0, buffer_traces_to_capture = 100;
2388 if (
unformat (line_input,
"on %=", &enable, 1))
2390 else if (
unformat (line_input,
"enable %=", &enable, 1))
2392 else if (
unformat (line_input,
"off %=", &enable, 0))
2394 else if (
unformat (line_input,
"disable %=", &enable, 0))
2396 else if (
unformat (line_input,
"max %d", &max))
2398 else if (
unformat (line_input,
"packets-to-capture %d", &max))
2403 else if (
unformat (line_input,
"status %=", &status, 1))
2405 else if (
unformat (line_input,
"buffer-trace %U %d",
2407 &buffer_traces_to_capture))
2441 (0,
"can't change number of records to capture while tracing...");
2509 .path =
"pcap dispatch trace",
2511 "pcap dispatch trace [on|off] [max <nn>] [file <name>] [status]\n" 2512 " [buffer-trace <input-node-name> <nn>]",
_vlib_init_function_list_elt_t * worker_init_function_registrations
static void elog_enable_disable(elog_main_t *em, int is_enabled)
Enable or disable event logging.
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.
clib_error_t * vlib_call_all_main_loop_exit_functions(vlib_main_t *vm)
static vlib_frame_t * vlib_frame_alloc(vlib_main_t *vm, vlib_node_runtime_t *from_node_runtime, u32 to_next_index)
uword * pending_rpc_requests
u64 internal_node_vectors
vlib_main_t vlib_global_main
f64 time
Absolute time as floating point number in seconds.
void TW() tw_timer_wheel_init(TWT(tw_timer_wheel) *tw, void *expired_timer_callback, f64 timer_interval_in_seconds, u32 max_expirations)
Initialize a tw timer wheel template instance.
u32 max_clock
Maximum clock cycle for an invocation.
u32 next_frame_index
Start of next frames for this node.
static clib_error_t * show_frame_stats(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define hash_set(h, key, value)
char * file_name
File name of pcap output.
clib_error_t * vlib_call_all_main_loop_enter_functions(vlib_main_t *vm)
static_always_inline void clib_spinlock_unlock(clib_spinlock_t *p)
static void vlib_next_frame_change_ownership(vlib_main_t *vm, vlib_node_runtime_t *node_runtime, u32 next_index)
static_always_inline void clib_spinlock_lock(clib_spinlock_t *p)
static vlib_next_frame_t * vlib_node_get_next_frame(vlib_main_t *vm, u32 node_index, u32 next_index)
Get pointer to frame by (node_index, next_index).
u32 interrupt_threshold_vector_length
vlib_process_t ** processes
int vl_api_get_elog_trace_api_messages(void)
static uword vlib_process_bootstrap(uword _a)
format_function_t format_vlib_node_name
vlib_node_runtime_t node_runtime
#define VLIB_PENDING_FRAME_NO_NEXT_FRAME
u32 n_packets_to_capture
Number of packets to capture.
static u32 vlib_buffer_get_trace_index(vlib_buffer_t *b)
Extract the trace (pool) index from a trace handle.
vlib_frame_t * vlib_get_next_frame_internal(vlib_main_t *vm, vlib_node_runtime_t *node, u32 next_index, u32 allocate_new_next_frame)
uword * processing_rpc_requests
static u32 clib_get_current_numa_node()
u8 * format_vnet_buffer_opaque2(u8 *s, va_list *args)
#define VLIB_PCAP_MAJOR_VERSION
vlib_trace_node_t * nodes
static void vlib_elog_main_loop_event(vlib_main_t *vm, u32 node_index, u64 time, u32 n_vectors, u32 is_return)
static clib_error_t * elog_save_buffer(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
int elog_post_mortem_dump
uword dispatch_pcap_enable
i16 current_data
signed offset in data[], pre_data[] that we are currently processing.
static void vlib_increment_main_loop_counter(vlib_main_t *vm)
elog_time_stamp_t init_time
Timestamps.
#define clib_memcpy_fast(a, b, c)
static void vlib_process_sync_stats(vlib_main_t *vm, vlib_process_t *p, uword n_calls, uword n_vectors, uword n_clocks, uword n_ticks0, uword n_ticks1)
void clib_random_buffer_init(clib_random_buffer_t *b, uword seed)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
static f64 vlib_time_now(vlib_main_t *vm)
static void dummy_queue_signal_callback(vlib_main_t *vm)
f64 buffer_alloc_success_rate
u32 current_process_index
void vlib_register_all_static_nodes(vlib_main_t *vm)
static_always_inline void clib_spinlock_unlock_if_init(clib_spinlock_t *p)
static u32 clib_get_current_cpu_id()
u16 current_length
Nbytes between current data and the end of this buffer.
static_always_inline uword vlib_process_startup(vlib_main_t *vm, vlib_process_t *p, vlib_frame_t *f)
static u64 dispatch_pending_node(vlib_main_t *vm, uword pending_frame_index, u64 last_time_stamp)
static vlib_frame_t * vlib_get_frame(vlib_main_t *vm, vlib_frame_t *f)
static void vlib_validate_frame_indices(vlib_frame_t *f)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
static u64 clib_cpu_time_now(void)
u8 * format_vnet_buffer_opaque(u8 *s, va_list *args)
u32 clocks_since_last_overflow
Number of clock cycles.
#define vec_add2(V, P, N)
Add N elements to end of vector V, return pointer to new elements in P.
static void vlib_process_update_stats(vlib_main_t *vm, vlib_process_t *p, uword n_calls, uword n_vectors, uword n_clocks)
static void elog_show_buffer_internal(vlib_main_t *vm, u32 n_events_to_show)
#define VLIB_MAIN_LOOP_EXIT_CLI
void clib_longjmp(clib_longjmp_t *save, uword return_value)
u8 * event_data_as_vector
static vlib_frame_size_t * get_frame_size_info(vlib_node_main_t *nm, u32 n_scalar_bytes, u32 n_vector_bytes)
static clib_error_t * elog_show_buffer(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
u8 * format_elog_event(u8 *s, va_list *va)
u8 * format_vnet_buffer_flags(u8 *s, va_list *args)
#define vec_validate_aligned(V, I, A)
Make sure vector is long enough for given index (no header, specified alignment)
clib_spinlock_t pending_interrupt_lock
static uword vlib_buffer_length_in_chain(vlib_main_t *vm, vlib_buffer_t *b)
Get length in bytes of the buffer chain.
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
uword clib_setjmp(clib_longjmp_t *save, uword return_value_not_taken)
#define vec_alloc(V, N)
Allocate space for N more elements (no header, unspecified alignment)
clib_error_t * vlib_sort_init_exit_functions(_vlib_init_function_list_elt_t **head)
Topological sorter for init function chains.
static uword vlib_process_stack_is_valid(vlib_process_t *p)
u8 buffer_pool_index
index of buffer pool this buffer belongs.
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
u16 thread_index
thread this node runs on
#define vlib_worker_thread_barrier_sync(X)
volatile uword check_frame_queues
static void vlib_worker_thread_barrier_check(void)
static clib_error_t * dispatch_trace_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
u32 * pending_interrupt_node_runtime_indices
u32 input_main_loops_per_call
For input nodes: decremented on each main loop interation until it reaches zero and function is calle...
static void vlib_main_loop(vlib_main_t *vm)
#define foreach_weak_reference_stub
void(** vlib_node_runtime_perf_counter_cbs)(struct vlib_main_t *, u64 *, u64 *, vlib_node_runtime_t *, vlib_frame_t *, int)
vlib_trace_header_t ** trace_buffer_pool
#define static_always_inline
PCAP main state data structure.
clib_spinlock_t lock
spinlock to protect e.g.
#define VLIB_FRAME_NO_APPEND
vlib_node_function_t * function
Node function to call.
void elog_init(elog_main_t *em, u32 n_events)
void vl_api_set_elog_main(elog_main_t *m)
u32 main_loop_vectors_processed
#define VLIB_INVALID_NODE_INDEX
u32 vectors_since_last_overflow
Number of vector elements processed by this node.
u32 buffer_trace_node_index
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
vlib_frame_t * vlib_get_frame_to_node(vlib_main_t *vm, u32 to_node_index)
#define clib_error_return(e, args...)
static void dispatch_pcap_trace(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
static uword vlib_timing_wheel_data_is_timed_event(u32 d)
#define VLIB_NODE_FLAG_SWITCH_FROM_INTERRUPT_TO_POLLING_MODE
#define VLIB_PROCESS_IS_SUSPENDED_WAITING_FOR_CLOCK
#define vec_resize(V, N)
Resize a vector (no header, unspecified alignment) Add N elements to end of given vector V...
u64 cpu_time_main_loop_start
vlib_node_runtime_t * nodes_by_type[VLIB_N_NODE_TYPE]
static u32 vlib_frame_bytes(u32 n_scalar_bytes, u32 n_vector_bytes)
#define VLIB_MAIN_LOOP_EXIT_NONE
static vlib_next_frame_t * vlib_node_runtime_get_next_frame(vlib_main_t *vm, vlib_node_runtime_t *n, u32 next_index)
u32 perf_counter0_ticks_since_last_overflow
Perf counter 0 ticks.
#define VLIB_PROCESS_IS_RUNNING
#define VLIB_PROCESS_RETURN_LONGJMP_RETURN
static void clib_spinlock_init(clib_spinlock_t *p)
vl_api_fib_path_type_t type
vlib_error_t error
Error code for buffers to be enqueued to error handler.
u32 calls_since_last_overflow
Number of calls.
clib_error_t * pcap_close(pcap_main_t *pm)
Close PCAP file.
vlib_worker_thread_t * vlib_worker_threads
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
static clib_error_t * elog_write_file(elog_main_t *em, char *clib_file, int flush_ring)
static void * vlib_process_signal_event_helper(vlib_node_main_t *nm, vlib_node_t *n, vlib_process_t *p, uword t, uword n_data_elts, uword n_data_elt_bytes)
vlib_node_stats_t stats_total
static void vlib_put_next_frame_validate(vlib_main_t *vm, vlib_node_runtime_t *rt, u32 next_index, u32 n_vectors_left)
u16 state
Input node state.
static u8 * format_buffer_metadata(u8 *s, va_list *args)
format_function_t format_vlib_trace
vlib_signal_timed_event_data_t * signal_timed_event_data_pool
#define VLIB_FRAME_IS_ALLOCATED
#define VLIB_FRAME_NO_FREE_AFTER_DISPATCH
u8 * pcap_data
Vector of pcap data.
static_always_inline u64 dispatch_node(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_node_type_t type, vlib_node_state_t dispatch_state, vlib_frame_t *frame, u64 last_time_stamp)
void vlib_put_frame_to_node(vlib_main_t *vm, u32 to_node_index, vlib_frame_t *f)
static uword vlib_timing_wheel_data_get_index(u32 d)
u32 *TW() tw_timer_expire_timers_vec(TWT(tw_timer_wheel) *tw, f64 now, u32 *vec)
#define pool_put(P, E)
Free an object E in pool P.
elog_event_type_t * node_return_elog_event_types
void vlib_frame_free(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_frame_t *f)
u32 polling_threshold_vector_length
u64 * n_vectors_by_next_node
u32 trace_handle
Specifies trace buffer handle if VLIB_PACKET_IS_TRACED flag is set.
void elog_post_mortem_dump(void)
u32 node_index
Node index.
#define foreach_vlib_main(body)
uword * init_functions_called
static void * pcap_add_packet(pcap_main_t *pm, f64 time_now, u32 n_bytes_in_trace, u32 n_bytes_in_packet)
Add packet.
#define VLIB_PROCESS_STACK_MAGIC
#define VLIB_PROCESS_RESUME_LONGJMP_RESUME
void elog_alloc(elog_main_t *em, u32 n_events)
clib_error_t * vlibmemory_init(vlib_main_t *vm)
volatile u32 queue_signal_pending
static vlib_frame_t * vlib_frame_alloc_to_node(vlib_main_t *vm, u32 to_node_index, u32 frame_flags)
clib_error_t * map_api_segment_init(vlib_main_t *vm)
static u64 dispatch_process(vlib_main_t *vm, vlib_process_t *p, vlib_frame_t *f, u64 last_time_stamp)
static u32 vlib_node_runtime_update_stats(vlib_main_t *vm, vlib_node_runtime_t *node, uword n_calls, uword n_vectors, uword n_clocks, uword n_ticks0, uword n_ticks1)
static_always_inline void os_set_numa_index(uword numa_index)
#define VLIB_EARLY_CONFIG_FUNCTION(x, n,...)
static u32 vlib_node_runtime_update_main_loop_vector_stats(vlib_main_t *vm, vlib_node_runtime_t *node, uword n_vectors)
u8 inline_event_data[64 - 3 *sizeof(u32) - 2 *sizeof(u16)]
#define CLIB_PREFETCH(addr, size, type)
int elog_trace_graph_dispatch
static uword elog_n_events_in_buffer(elog_main_t *em)
Return number of events in the event-log buffer.
static_always_inline void vlib_main_or_worker_loop(vlib_main_t *vm, int is_main)
vlib_pending_frame_t * pending_frames
u32 flow_id
Generic flow identifier.
int vlib_frame_queue_dequeue(vlib_main_t *vm, vlib_frame_queue_main_t *fqm)
sll srl srl sll sra u16x4 i
#define vec_free(V)
Free vector's memory (no header).
clib_error_t * vpe_api_init(vlib_main_t *vm)
#define VLIB_NODE_FLAG_FRAME_NO_FREE_AFTER_DISPATCH
#define clib_warning(format, args...)
#define VLIB_PROCESS_RESUME_PENDING
static vlib_node_runtime_t * vlib_node_get_runtime(vlib_main_t *vm, u32 node_index)
Get node runtime by node index.
u32 perf_counter_vectors_since_last_overflow
Perf counter vectors.
#define VLIB_BUFFER_TRACE_TRAJECTORY
Compile time buffer trajectory tracing option Turn this on if you run into "bad monkey" contexts...
clib_error_t * vlib_buffer_main_init(struct vlib_main_t *vm)
#define VLIB_FRAME_PENDING
static u32 vlib_frame_vector_byte_offset(u32 scalar_size)
u32 current_config_index
Used by feature subgraph arcs to visit enabled feature nodes.
void vlib_put_next_frame(vlib_main_t *vm, vlib_node_runtime_t *r, u32 next_index, u32 n_vectors_left)
Release pointer to next frame vector data.
#define ELOG_TYPE_DECLARE(f)
clib_error_t * pcap_write(pcap_main_t *pm)
Write PCAP file.
static uword round_pow2(uword x, uword pow2)
u32 n_total_events_disable_limit
When count reaches limit logging is disabled.
vlib_frame_t ** free_frames
vlib_main_t vlib_node_runtime_t * node
#define VLIB_CLI_COMMAND(x,...)
#define VLIB_PCAP_MINOR_VERSION
#define hash_create(elts, value_bytes)
#define uword_to_pointer(u, type)
u16 cached_next_index
Next frame index that vector arguments were last enqueued to last time this node ran.
clib_error_t * vlib_node_main_init(vlib_main_t *vm)
#define PCAP_MAIN_INIT_DONE
#define pool_put_index(p, i)
Free pool element with given index.
never_inline void vlib_node_runtime_sync_stats(vlib_main_t *vm, vlib_node_runtime_t *r, uword n_calls, uword n_vectors, uword n_clocks, uword n_ticks0, uword n_ticks1)
static void vlib_node_runtime_perf_counter(vlib_main_t *vm, u64 *pmc0, u64 *pmc1, vlib_node_runtime_t *node, vlib_frame_t *frame, int before_or_after)
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
static void elog_reset_buffer(elog_main_t *em)
Reset the event buffer.
u32 buffer_traces_to_capture
vlib_frame_queue_main_t * frame_queue_mains
#define ELOG_TRACK_DATA(em, f, track)
uword event_ring_size
Power of 2 number of elements in ring.
u32 main_loop_nodes_processed
u64 cpu
CPU cycle counter.
u64 loops_this_reporting_interval
void vlib_worker_thread_initial_barrier_sync_and_release(vlib_main_t *vm)
#define clib_error_report(e)
u32 elog_trace_graph_circuit_node_index
vlib_trace_main_t trace_main
int vl_api_set_elog_trace_api_messages(int enable)
static uword pointer_to_uword(const void *p)
void(**volatile worker_thread_main_loop_callbacks)(struct vlib_main_t *)
void(* queue_signal_callback)(struct vlib_main_t *)
void vlib_gdb_show_event_log(void)
static vlib_main_t * vlib_get_main(void)
static_always_inline uword vlib_process_resume(vlib_process_t *p)
void vlib_node_sync_stats(vlib_main_t *vm, vlib_node_t *n)
#define vec_elt(v, i)
Get vector value at index i.
int vlib_main(vlib_main_t *volatile vm, unformat_input_t *input)
pcap_packet_type_t packet_type
Packet type.
void vlib_worker_loop(vlib_main_t *vm)
static vlib_node_t * vlib_get_next_node(vlib_main_t *vm, u32 node_index, u32 next_index)
Get vlib node by graph arc (next) index.
void vl_api_send_pending_rpc_requests(vlib_main_t *)
#define clib_mem_alloc_aligned_no_fail(size, align)
u32 buffer_alloc_success_seed
u32 * data_from_advancing_timing_wheel
clib_error_t * vlib_physmem_init(vlib_main_t *vm)
u32 perf_counter1_ticks_since_last_overflow
Perf counter 1 ticks.
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
u32 input_node_counts_by_state[VLIB_N_NODE_STATE]
vlib_pending_frame_t * suspended_process_frames
u32 next_buffer
Next buffer for this linked-list of buffers.
vlib_node_main_t node_main
static u32 * vlib_frame_find_magic(vlib_frame_t *f, vlib_node_t *node)
VLIB buffer representation.
vlib_next_frame_t * next_frames
static clib_error_t * elog_stop(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
clib_error_t * vlib_call_all_config_functions(vlib_main_t *vm, unformat_input_t *input, int is_early)
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
static uword elog_is_enabled(elog_main_t *em)
event logging enabled predicate
static f64 clib_time_now_internal(clib_time_t *c, u64 n)
clib_error_t * vlib_call_all_init_functions(vlib_main_t *vm)
#define VLIB_FRAME_SIZE_EXTRA
unformat_function_t unformat_vlib_node
static void elog_track(elog_main_t *em, elog_event_type_t *type, elog_track_t *track, u32 data)
Log a single-datum event to a specific track, non-inline version.
static u64 dispatch_suspended_process(vlib_main_t *vm, uword process_index, u64 last_time_stamp)
vlib_frame_size_t * frame_sizes
u64 resume_clock_interval
static void add_trajectory_trace(vlib_buffer_t *b, u32 node_index)
elog_event_type_t * node_call_elog_event_types
static void * clib_mem_alloc_aligned(uword size, uword align)
static vlib_process_t * vlib_get_process_from_node(vlib_main_t *vm, vlib_node_t *node)
uword clib_calljmp(uword(*func)(uword func_arg), uword func_arg, void *stack)
void vlib_worker_thread_barrier_release(vlib_main_t *vm)
#define clib_call_callbacks(h,...)
call the specified callback set
pcap_main_t dispatch_pcap_main
u32 TW() tw_timer_start(TWT(tw_timer_wheel) *tw, u32 user_id, u32 timer_id, u64 interval)
Start a Tw Timer.
u32 suspended_process_frame_index
static void validate_frame_magic(vlib_main_t *vm, vlib_frame_t *f, vlib_node_t *n, uword next_index)
static vlib_thread_main_t * vlib_get_thread_main()
static clib_error_t * vlib_main_configure(vlib_main_t *vm, unformat_input_t *input)
static vlib_cli_command_t pcap_dispatch_trace_command
(constructor) VLIB_CLI_COMMAND (pcap_dispatch_trace_command)
u32 internal_node_last_vectors_per_main_loop
static vlib_node_t * vlib_get_node(vlib_main_t *vm, u32 i)
Get vlib node by index.
static clib_error_t * vlib_cli_elog_clear(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define VLIB_PROCESS_IS_SUSPENDED_WAITING_FOR_EVENT
#define vec_foreach(var, vec)
Vector iterator.
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
elog_track_t default_track
Default track.
clib_longjmp_t return_longjmp
u16 flags
Copy of main node flags.
u32 n_total_events
Total number of events in buffer.
clib_longjmp_t main_loop_exit
clib_longjmp_t resume_longjmp
void clib_mem_trace(int enable)
static clib_error_t * elog_resize(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static_always_inline void vlib_get_buffers(vlib_main_t *vm, u32 *bi, vlib_buffer_t **b, int count)
Translate array of buffer indices into buffer pointers.
#define VLIB_NODE_FLAG_TRACE
#define CLIB_CACHE_LINE_BYTES
u32 total_length_not_including_first_buffer
Only valid for first buffer in chain.
clib_error_t * vlib_map_stat_segment_init(void)
static u32 vlib_timing_wheel_data_set_suspended_process(u32 i)
void vlib_start_process(vlib_main_t *vm, uword process_index)
int vlib_pcap_dispatch_trace_configure(vlib_pcap_dispatch_trace_args_t *a)
static_always_inline void clib_spinlock_lock_if_init(clib_spinlock_t *p)
volatile u8 ref_count
Reference count for this buffer.
int elog_trace_graph_circuit
u32 n_packets_captured
Number of packets currently captured.
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
clib_random_buffer_t random_buffer
static clib_error_t * elog_restart(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define VLIB_NODE_FLAG_SWITCH_FROM_POLLING_TO_INTERRUPT_MODE
u8 *(* validate_frame)(struct vlib_main_t *vm, struct vlib_node_runtime_t *, struct vlib_frame_t *f)
u32 * dispatch_buffer_trace_nodes
clib_error_t * main_loop_error
elog_event_t * elog_peek_events(elog_main_t *em)
convert event ring events to events, and return them as a vector.
static uword elog_buffer_capacity(elog_main_t *em)
Return number of events which can fit in the event buffer.
u64 cpu_time_last_node_dispatch
#define VLIB_FRAME_FREE_AFTER_DISPATCH
clib_error_t * vlib_thread_init(vlib_main_t *vm)
u32 vectors_since_last_overflow
u32 max_clock_n
Number of vectors in the recorded max_clock.
#define VLIB_PROCESS_RETURN_LONGJMP_SUSPEND