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;
60 n_buffers_left = n_buffers;
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;
118 u32 node_index,
u32 n_errors,
char *error_strings[],
145 for (i = 0; i < n_errors; i++)
147 counters[
i].
name = error_strings[
i];
148 counters[
i].
desc = error_strings[
i];
157 counters, n_errors * sizeof (counters[0]));
171 n_errors * sizeof (em->
counters[0]));
174 0, n_errors * sizeof (em->
counters[0]));
181 for (i = 0; i < n_errors; i++)
185 format (error_name,
"/err/%v/%s%c", n->
name, counters[i].
name, 0);
203 for (i = 0; i < n_errors; i++)
241 if (
unformat (input,
"verbose %d", &verbose))
243 else if (
unformat (input,
"verbose"))
250 "Reason",
"Severity",
"Index");
252 vlib_cli_output (vm,
"%=10s%=35s%=35s%=10s",
"Count",
"Node",
"Reason",
258 em = &this_vlib_main->error_main;
264 for (ni = 0; ni <
vec_len (this_vlib_main->node_main.nodes); ni++)
267 for (code = 0; code < n->
n_errors; code++)
275 if (c == 0 && verbose < 2)
298 for (code = 0; code < n->
n_errors; code++)
317 .path =
"show errors",
318 .short_help =
"Show error counts",
325 .path =
"show node counters",
326 .short_help =
"Show node counters",
340 em = &this_vlib_main->error_main;
351 .path =
"clear errors",
352 .short_help =
"Clear error counters",
359 .path =
"clear node counters",
360 .short_help =
"Clear node counters",
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
void vlib_stats_pop_heap2(u64 *error_vector, u32 thread_index, void *oldheap, int lock)
__clib_export void heap_dealloc(void *v, uword handle)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
static clib_error_t * show_errors(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
void * vlib_stats_push_heap(void *old)
char * format
Format string.
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
#define clib_memcpy(d, s, n)
u64 * counters_last_clear
description fragment has unexpected format
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
vl_counter_t * counters_heap
static char * sev2str(enum vl_counter_severity_e s)
elog_event_type_t * error_elog_event_types
vlib_error_t error
Error code for buffers to be enqueued to error handler.
vlib_worker_thread_t * vlib_worker_threads
vlib_error_main_t error_main
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)
#define foreach_vlib_main(body)
#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).
void vlib_register_errors(vlib_main_t *vm, u32 node_index, u32 n_errors, char *error_strings[], vl_counter_t counters[])
vl_counter_t * error_counters
static_always_inline uword vlib_get_thread_index(void)
sll srl srl sll sra u16x4 i
#define vec_free(V)
Free vector's memory (no header).
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.
vlib_main_t vlib_node_runtime_t * node
#define VLIB_CLI_COMMAND(x,...)
enum vl_counter_severity_e severity
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
#define heap_alloc(v, size, handle)
static clib_error_t * clear_error_counters(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static void * clib_mem_alloc(uword size)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
vlib_node_main_t node_main
VLIB buffer representation.
static vlib_node_t * vlib_get_node(vlib_main_t *vm, u32 i)
Get vlib node by index.
void vlib_stats_register_error_index(void *oldheap, u8 *name, u64 *em_vec, u64 index)
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.