47 u32 next_buffer_stride,
50 u32 drop_error_node,
u32 drop_error_code)
52 u32 n_left_this_frame, n_buffers_left, *args, n_args_left;
57 n_buffers_left = n_buffers;
58 while (n_buffers_left > 0)
62 n_left_this_frame =
clib_min (n_buffers_left, n_args_left);
63 n_buffers_left -= n_left_this_frame;
64 n_args_left -= n_left_this_frame;
66 while (n_left_this_frame >= 4)
68 u32 bi0, bi1, bi2, bi3;
71 args[0] = bi0 = buffers[0];
72 args[1] = bi1 = buffers[1];
73 args[2] = bi2 = buffers[2];
74 args[3] = bi3 = buffers[3];
81 b0->
error = drop_error;
82 b1->
error = drop_error;
83 b2->
error = drop_error;
84 b3->
error = drop_error;
88 n_left_this_frame -= 4;
91 while (n_left_this_frame >= 1)
96 args[0] = bi0 = buffers[0];
99 b0->
error = drop_error;
103 n_left_this_frame -= 1;
126 [0] =
"misc. errors",
132 .name =
"misc-drop-buffers",
133 .vector_size =
sizeof (
u32),
146 u32 node_index,
u32 n_errors,
char *error_strings[])
170 error_strings, n_errors * sizeof (error_strings[0]));
180 n_errors * sizeof (em->
counters[0]));
183 0, n_errors * sizeof (em->
counters[0]));
189 memset (&t, 0,
sizeof (t));
190 for (i = 0; i < n_errors; i++)
193 n->
name, error_strings[i]);
211 if (
unformat (input,
"verbose %d", &verbose))
213 else if (
unformat (input,
"verbose"))
227 em = &this_vlib_main->error_main;
233 for (ni = 0; ni <
vec_len (this_vlib_main->node_main.nodes); ni++)
236 for (code = 0; code < n->
n_errors; code++)
244 if (c == 0 && verbose < 2)
265 for (code = 0; code < n->
n_errors; code++)
284 .path =
"show errors",
285 .short_help =
"Show error counts",
292 .path =
"show node counters",
293 .short_help =
"Show node counters",
307 em = &this_vlib_main->error_main;
318 .path =
"clear errors",
319 .short_help =
"Clear error counters",
326 .path =
"clear node counters",
327 .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_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.
static clib_error_t * clear_error_counters(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static vlib_node_registration_t misc_drop_buffers_node
(constructor) VLIB_REGISTER_NODE (misc_drop_buffers_node)
sll srl srl sll sra u16x4 i
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)
void vlib_register_errors(vlib_main_t *vm, u32 node_index, u32 n_errors, char *error_strings[])
vlib_worker_thread_t * vlib_worker_threads
u64 * counters_last_clear
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
elog_event_type_t * error_elog_event_types
static clib_error_t * show_errors(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
vlib_error_main_t error_main
uword os_get_cpu_number(void)
#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_cli_output(vlib_main_t *vm, char *fmt,...)
vlib_error_t error
Error code for buffers to be enqueued to error handler.
char ** error_strings_heap
#define vec_free(V)
Free vector's memory (no header).
#define clib_memcpy(a, b, c)
static char * misc_drop_buffers_error_strings[]
void heap_dealloc(void *v, uword handle)
static void * vlib_frame_args(vlib_frame_t *f)
Get pointer to frame scalar data.
#define heap_alloc(v, size, handle)
VLIB_CLI_COMMAND(set_interface_ip_source_and_port_range_check_command, static)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
vlib_node_main_t node_main
#define VLIB_REGISTER_NODE(x,...)
static vlib_node_t * vlib_get_node(vlib_main_t *vm, u32 i)
Get vlib node by index.
static vlib_error_t vlib_error_set(u32 node_index, u32 code)
static uword misc_drop_buffers(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.