|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
48 u32 next_buffer_stride,
51 u32 drop_error_node,
u32 drop_error_code)
53 u32 n_left_this_frame, n_buffers_left, *args, n_args_left;
61 while (n_buffers_left > 0)
65 n_left_this_frame =
clib_min (n_buffers_left, n_args_left);
66 n_buffers_left -= n_left_this_frame;
67 n_args_left -= n_left_this_frame;
69 while (n_left_this_frame >= 4)
71 u32 bi0, bi1, bi2, bi3;
74 args[0] = bi0 = buffers[0];
75 args[1] = bi1 = buffers[1];
76 args[2] = bi2 = buffers[2];
77 args[3] = bi3 = buffers[3];
84 b0->
error = drop_error;
85 b1->
error = drop_error;
86 b2->
error = drop_error;
87 b3->
error = drop_error;
91 n_left_this_frame -= 4;
94 while (n_left_this_frame >= 1)
99 args[0] = bi0 = buffers[0];
102 b0->
error = drop_error;
106 n_left_this_frame -= 1;
144 for (
i = 0;
i < n_errors;
i++)
146 counters[
i].
name = error_strings[
i];
147 counters[
i].
desc = error_strings[
i];
156 counters, n_errors * sizeof (counters[0]));
170 n_errors * sizeof (em->
counters[0]));
173 0, n_errors * sizeof (em->
counters[0]));
180 for (
i = 0;
i < n_errors;
i++)
202 for (
i = 0;
i < n_errors;
i++)
228 for (
i = 0;
i <
node->n_errors;
i++)
271 if (
unformat (input,
"verbose %d", &verbose))
273 else if (
unformat (input,
"verbose"))
280 "Reason",
"Severity",
"Index");
287 em = &this_vlib_main->error_main;
293 for (ni = 0; ni <
vec_len (this_vlib_main->node_main.nodes); ni++)
296 for (code = 0; code < n->
n_errors; code++)
304 if (
c == 0 && verbose < 2)
326 for (code = 0; code < n->
n_errors; code++)
345 .path =
"show errors",
346 .short_help =
"Show error counts",
353 .path =
"show node counters",
354 .short_help =
"Show node counters",
368 em = &this_vlib_main->error_main;
378 .path =
"clear errors",
379 .short_help =
"Clear error counters",
386 .path =
"clear node counters",
387 .short_help =
"Clear node counters",
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
void * vlib_stats_push_heap(void *old)
static vlib_cli_command_t cli_clear_error_counters
(constructor) VLIB_CLI_COMMAND (cli_clear_error_counters)
void vlib_register_errors(vlib_main_t *vm, u32 node_index, u32 n_errors, char *error_strings[], vlib_error_desc_t counters[])
char * format
Format string.
#define clib_memcpy(d, s, n)
nat44_ei_hairpin_src_next_t next_index
static vlib_cli_command_t cli_clear_node_counters
(constructor) VLIB_CLI_COMMAND (cli_clear_node_counters)
uword unformat_vlib_error(unformat_input_t *input, va_list *args)
vlib_error_desc_t * counters_heap
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
vlib_main_t vlib_node_runtime_t * node
static char * sev2str(enum vl_counter_severity_e s)
static vlib_cli_command_t cli_show_node_counters
(constructor) VLIB_CLI_COMMAND (cli_show_node_counters)
void vlib_stats_pop_heap2(u64 *error_vector, u32 thread_index, void *oldheap, int lock)
vlib_error_main_t error_main
vlib_node_main_t node_main
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
@ VL_COUNTER_SEVERITY_INFO
static clib_error_t * show_errors(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
vlib_worker_thread_t * vlib_worker_threads
static clib_error_t * clear_error_counters(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
@ VL_COUNTER_SEVERITY_ERROR
#define foreach_vlib_main()
elog_event_type_t * error_elog_event_types
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
vlib_error_t error
Error code for buffers to be enqueued to error handler.
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
static_always_inline uword vlib_get_thread_index(void)
unformat_function_t unformat_vlib_node
uword vlib_error_drop_buffers(vlib_main_t *vm, vlib_node_runtime_t *node, u32 *buffers, u32 next_buffer_stride, u32 n_buffers, u32 next_index, u32 drop_error_node, u32 drop_error_code)
static vlib_node_t * vlib_get_node(vlib_main_t *vm, u32 i)
Get vlib node by index.
sll srl srl sll sra u16x4 i
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment)
#define VLIB_CLI_COMMAND(x,...)
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
vlib_error_desc_t * error_counters
__clib_export void heap_dealloc(void *v, uword handle)
#define vec_free(V)
Free vector's memory (no header).
u64 * counters_last_clear
description fragment has unexpected format
vlib_put_next_frame(vm, node, next_index, 0)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
#define heap_alloc(v, size, handle)
enum vl_counter_severity_e severity
vlib_cli_command_t vlib_cli_show_errors
(constructor) VLIB_CLI_COMMAND (vlib_cli_show_errors)
#define vlib_get_next_frame(vm, node, next_index, vectors, n_vectors_left)
Get pointer to next frame vector data by (vlib_node_runtime_t, next_index).
static void * clib_mem_alloc(uword size)
void vlib_stats_register_error_index(void *oldheap, u8 *name, u64 *em_vec, u64 index)
@ VL_COUNTER_SEVERITY_WARN
VLIB buffer representation.