40 #ifndef included_vlib_buffer_node_h 41 #define included_vlib_buffer_node_h 43 #define vlib_validate_buffer_enqueue_x2(vm,node,next_index,to_next,n_left_to_next,bi0,bi1,next0,next1) \ 45 int enqueue_code = (next0 != next_index) + 2*(next1 != next_index); \ 47 if (PREDICT_FALSE (enqueue_code != 0)) \ 49 switch (enqueue_code) \ 55 n_left_to_next += 1; \ 56 vlib_set_next_frame_buffer (vm, node, next0, bi0); \ 62 n_left_to_next += 1; \ 63 vlib_set_next_frame_buffer (vm, node, next1, bi1); \ 69 n_left_to_next += 2; \ 70 vlib_set_next_frame_buffer (vm, node, next0, bi0); \ 71 vlib_set_next_frame_buffer (vm, node, next1, bi1); \ 74 vlib_put_next_frame (vm, node, next_index, \ 77 vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next); \ 83 #define vlib_validate_buffer_enqueue_x1(vm,node,next_index,to_next,n_left_to_next,bi0,next0) \ 85 if (PREDICT_FALSE (next0 != next_index)) \ 87 vlib_put_next_frame (vm, node, next_index, n_left_to_next + 1); \ 89 vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next); \ 93 n_left_to_next -= 1; \ 108 u32 * next0,
u32 * next1),
115 u32 n_left_from, * from, * to_next;
126 while (n_left_from > 0)
131 to_next, n_left_to_next);
133 while (n_left_from >= 4 && n_left_to_next >= 2)
153 pi0 = to_next[0] = from[0];
154 pi1 = to_next[1] = from[1];
163 two_buffers (vm, opaque1, opaque2, p0, p1, &next0, &next1);
166 to_next, n_left_to_next,
167 pi0, pi1, next0, next1);
170 while (n_left_from > 0 && n_left_to_next > 0)
184 one_buffer (vm, opaque1, opaque2, p0, &next0);
187 to_next, n_left_to_next,
void vlib_put_next_frame(vlib_main_t *vm, vlib_node_runtime_t *r, u32 next_index, u32 n_vectors_left)
always_inline void * vlib_frame_vector_args(vlib_frame_t *f)
#define vlib_validate_buffer_enqueue_x2(vm, node, next_index, to_next, n_left_to_next, bi0, bi1, next0, next1)
#define vlib_validate_buffer_enqueue_x1(vm, node, next_index, to_next, n_left_to_next, bi0, next0)
#define vlib_get_next_frame(vm, node, next_index, vectors, n_vectors_left)
#define CLIB_PREFETCH(addr, size, type)
always_inline uword generic_buffer_node_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, uword sizeof_trace, void *opaque1, uword opaque2, void(*two_buffers)(vlib_main_t *vm, void *opaque1, uword opaque2, vlib_buffer_t *b0, vlib_buffer_t *b1, u32 *next0, u32 *next1), void(*one_buffer)(vlib_main_t *vm, void *opaque1, uword opaque2, vlib_buffer_t *b0, u32 *next0))
#define VLIB_NODE_FLAG_TRACE
void vlib_trace_frame_buffers_only(vlib_main_t *vm, vlib_node_runtime_t *node, u32 *buffers, uword n_buffers, uword next_buffer_stride, uword n_buffer_data_bytes_in_trace)
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
always_inline vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.