43 #define foreach_handoffdemo_error \ 44 _(HANDED_OFF, "packets handed off processed") \ 45 _(CONGESTION_DROP, "handoff queue congestion drops") \ 46 _(COMPLETE, "completed packets") 50 #define _(sym,str) HANDOFFDEMO_ERROR_##sym, 57 #define _(sym,string) string, 71 int which,
int is_trace)
74 u32 n_left_from, *from;
75 u32 error0 = node->
errors[HANDOFFDEMO_ERROR_COMPLETE];
95 thread_indices[
i] = 2;
97 if (is_trace && (b[0]->
flags & VLIB_BUFFER_IS_TRACED))
114 if (n_enq < frame->n_vectors)
116 HANDOFFDEMO_ERROR_CONGESTION_DROP,
119 HANDOFFDEMO_ERROR_HANDED_OFF, n_enq);
133 while (n_left_from > 0)
135 if (is_trace && (b[0]->
flags & VLIB_BUFFER_IS_TRACED))
143 b[0]->
error = error0;
171 .name =
"handoffdemo-1",
173 .vector_size =
sizeof (
u32),
204 .name =
"handoffdemo-2",
206 .vector_size =
sizeof (
u32),
vl_api_wireguard_peer_flags_t flags
u32 vlib_frame_queue_main_init(u32 node_index, u32 frame_queue_nelts)
vlib_error_t * errors
Vector of errors for this node.
static uword handoffdemo_node_1_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
#define VLIB_INIT_FUNCTION(x)
static uword handoffdemo_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, int which, int is_trace)
vl_api_fib_path_type_t type
vlib_error_t error
Error code for buffers to be enqueued to error handler.
static clib_error_t * handoffdemo_node_init(vlib_main_t *vm)
vlib_node_registration_t handoffdemo_node_2
(constructor) VLIB_REGISTER_NODE (handoffdemo_node_2)
u32 node_index
Node index.
static void vlib_node_increment_counter(vlib_main_t *vm, u32 node_index, u32 counter_index, u64 increment)
#define VLIB_REGISTER_NODE(x,...)
static_always_inline void vlib_buffer_enqueue_to_next(vlib_main_t *vm, vlib_node_runtime_t *node, u32 *buffers, u16 *nexts, uword count)
sll srl srl sll sra u16x4 i
vlib_node_registration_t handoffdemo_node_1
(constructor) VLIB_REGISTER_NODE (handoffdemo_node_1)
vlib_main_t vlib_node_runtime_t * node
static u8 * format_handoffdemo_trace(u8 *s, va_list *args)
handoffdemo_main_t handoffdemo_main
static char * handoffdemo_error_strings[]
struct _vlib_node_registration vlib_node_registration_t
#define foreach_handoffdemo_error
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
VLIB buffer representation.
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
static_always_inline u32 vlib_buffer_enqueue_to_thread(vlib_main_t *vm, u32 frame_queue_index, u32 *buffer_indices, u16 *thread_indices, u32 n_packets, int drop_on_congestion)
uword handoffdemo_node_2_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
u16 flags
Copy of main node flags.
void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
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
vlib_node_registration_t handoffdemo_node