FD.io VPP  v16.06
Vector Packet Processing
buffer_node.h File Reference
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#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)
 

Functions

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))
 

Macro Definition Documentation

#define vlib_validate_buffer_enqueue_x1 (   vm,
  node,
  next_index,
  to_next,
  n_left_to_next,
  bi0,
  next0 
)
Value:
do { \
if (PREDICT_FALSE (next0 != next_index)) \
{ \
vlib_put_next_frame (vm, node, next_index, n_left_to_next + 1); \
next_index = next0; \
vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next); \
\
to_next[0] = bi0; \
to_next += 1; \
n_left_to_next -= 1; \
} \
} while (0)
void vlib_put_next_frame(vlib_main_t *vm, vlib_node_runtime_t *r, u32 next_index, u32 n_vectors_left)
Definition: main.c:459
#define PREDICT_FALSE(x)
Definition: clib.h:97
#define vlib_get_next_frame(vm, node, next_index, vectors, n_vectors_left)
Definition: node_funcs.h:265

Definition at line 83 of file buffer_node.h.

#define vlib_validate_buffer_enqueue_x2 (   vm,
  node,
  next_index,
  to_next,
  n_left_to_next,
  bi0,
  bi1,
  next0,
  next1 
)
Value:
do { \
int enqueue_code = (next0 != next_index) + 2*(next1 != next_index); \
\
if (PREDICT_FALSE (enqueue_code != 0)) \
{ \
switch (enqueue_code) \
{ \
case 1: \
/* A B A */ \
to_next[-2] = bi1; \
to_next -= 1; \
n_left_to_next += 1; \
vlib_set_next_frame_buffer (vm, node, next0, bi0); \
break; \
\
case 2: \
/* A A B */ \
to_next -= 1; \
n_left_to_next += 1; \
vlib_set_next_frame_buffer (vm, node, next1, bi1); \
break; \
\
case 3: \
/* A B B or A B C */ \
to_next -= 2; \
n_left_to_next += 2; \
vlib_set_next_frame_buffer (vm, node, next0, bi0); \
vlib_set_next_frame_buffer (vm, node, next1, bi1); \
if (next0 == next1) \
{ \
vlib_put_next_frame (vm, node, next_index, \
n_left_to_next); \
next_index = next1; \
vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next); \
} \
} \
} \
} while (0)
void vlib_put_next_frame(vlib_main_t *vm, vlib_node_runtime_t *r, u32 next_index, u32 n_vectors_left)
Definition: main.c:459
#define PREDICT_FALSE(x)
Definition: clib.h:97
#define vlib_get_next_frame(vm, node, next_index, vectors, n_vectors_left)
Definition: node_funcs.h:265
always_inline void vlib_set_next_frame_buffer(vlib_main_t *vm, vlib_node_runtime_t *node, u32 next_index, u32 buffer_index)
Definition: node_funcs.h:292

Definition at line 43 of file buffer_node.h.

Function Documentation

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(*)(vlib_main_t *vm, void *opaque1, uword opaque2, vlib_buffer_t *b0, vlib_buffer_t *b1, u32 *next0, u32 *next1)  two_buffers,
void(*)(vlib_main_t *vm, void *opaque1, uword opaque2, vlib_buffer_t *b0, u32 *next0)  one_buffer 
)

Definition at line 98 of file buffer_node.h.

+ Here is the call graph for this function: