FD.io VPP
v18.07.1-19-g511ce25
Vector Packet Processing
|
vlib buffer structure definition and a few select access methods. More...
Go to the source code of this file.
Data Structures | |
struct | vlib_buffer_t |
struct | vlib_buffer_free_list_t |
struct | vlib_buffer_callbacks_t |
struct | vlib_buffer_pool_t |
struct | vlib_buffer_main_t |
struct | vlib_serialize_buffer_main_t |
Macros | |
#define | VLIB_BUFFER_DATA_SIZE (2048) |
#define | VLIB_BUFFER_PRE_DATA_SIZE __PRE_DATA_SIZE |
#define | foreach_vlib_buffer_flag |
Buffer Flags. More... | |
#define | LOG2_VLIB_BUFFER_FLAG_USER(n) (32 - (n)) |
#define | VLIB_BUFFER_FLAG_USER(n) (1 << LOG2_VLIB_BUFFER_FLAG_USER(n)) |
#define | VLIB_BUFFER_HDR_SIZE (sizeof(vlib_buffer_t) - VLIB_BUFFER_PRE_DATA_SIZE) |
#define | vlib_prefetch_buffer_header(b, type) CLIB_PREFETCH (b, 64, type) |
Prefetch buffer metadata. More... | |
#define | VLIB_BUFFER_DEFAULT_FREE_LIST_INDEX (0) |
#define | VLIB_BUFFER_DEFAULT_FREE_LIST_BYTES VLIB_BUFFER_DATA_SIZE |
#define | VLIB_BUFFER_TRACE_TRAJECTORY 0 |
Compile time buffer trajectory tracing option Turn this on if you run into "bad monkey" contexts, and you want to know exactly which nodes they've visited... More... | |
#define | VLIB_BUFFER_TRACE_TRAJECTORY_INIT(b) |
#define | VLIB_BUFFER_REGISTER_CALLBACKS(x, ...) |
Typedefs | |
typedef u8 | vlib_buffer_free_list_index_t |
typedef struct vlib_buffer_free_list_t | vlib_buffer_free_list_t |
typedef uword( | vlib_buffer_fill_free_list_cb_t) (struct vlib_main_t *vm, vlib_buffer_free_list_t *fl, uword min_free_buffers) |
typedef void( | vlib_buffer_free_cb_t) (struct vlib_main_t *vm, u32 *buffers, u32 n_buffers) |
typedef void( | vlib_buffer_free_no_next_cb_t) (struct vlib_main_t *vm, u32 *buffers, u32 n_buffers) |
Enumerations | |
enum | { foreach_vlib_buffer_flag } |
enum | { foreach_vlib_buffer_flag } |
Variables | |
vlib_buffer_callbacks_t * | vlib_buffer_callbacks |
vlib_buffer_main_t | buffer_main |
vlib buffer structure definition and a few select access methods.
This structure and the buffer allocation mechanism should perhaps live in vnet, but it would take a lot of typing to make it so.
Definition in file buffer.h.
foreach_vlib_buffer_flag |
Buffer Flags.
#define VLIB_BUFFER_DEFAULT_FREE_LIST_BYTES VLIB_BUFFER_DATA_SIZE |
#define VLIB_BUFFER_FLAG_USER | ( | n | ) | (1 << LOG2_VLIB_BUFFER_FLAG_USER(n)) |
#define VLIB_BUFFER_HDR_SIZE (sizeof(vlib_buffer_t) - VLIB_BUFFER_PRE_DATA_SIZE) |
#define VLIB_BUFFER_REGISTER_CALLBACKS | ( | x, | |
... | |||
) |
#define VLIB_BUFFER_TRACE_TRAJECTORY 0 |
#define vlib_prefetch_buffer_header | ( | b, | |
type | |||
) | CLIB_PREFETCH (b, 64, type) |
Prefetch buffer metadata.
The first 64 bytes of buffer contains most header information
b | - (vlib_buffer_t *) pointer to the buffer |
type | - LOAD, STORE. In most cases, STORE is the right answer |
typedef uword( vlib_buffer_fill_free_list_cb_t) (struct vlib_main_t *vm, vlib_buffer_free_list_t *fl, uword min_free_buffers) |
typedef void( vlib_buffer_free_cb_t) (struct vlib_main_t *vm, u32 *buffers, u32 n_buffers) |
typedef u8 vlib_buffer_free_list_index_t |
typedef struct vlib_buffer_free_list_t vlib_buffer_free_list_t |
typedef void( vlib_buffer_free_no_next_cb_t) (struct vlib_main_t *vm, u32 *buffers, u32 n_buffers) |
u32 serialize_close_vlib_buffer | ( | serialize_main_t * | m | ) |
Definition at line 204 of file buffer_serialize.c.
void serialize_open_vlib_buffer | ( | serialize_main_t * | m, |
struct vlib_main_t * | vm, | ||
vlib_serialize_buffer_main_t * | sm | ||
) |
Definition at line 190 of file buffer_serialize.c.
|
inlinestatic |
void unserialize_close_vlib_buffer | ( | serialize_main_t * | m | ) |
Definition at line 229 of file buffer_serialize.c.
void unserialize_open_vlib_buffer | ( | serialize_main_t * | m, |
struct vlib_main_t * | vm, | ||
vlib_serialize_buffer_main_t * | sm | ||
) |
Definition at line 197 of file buffer_serialize.c.
|
inlinestatic |
Advance current data pointer by the supplied (signed!) amount.
b | - (vlib_buffer_t *) pointer to the buffer |
l | - (word) signed increment |
|
inlinestatic |
Get pointer to current data to process.
b | - (vlib_buffer_t *) pointer to the buffer |
|
inlinestatic |
|
inlinestatic |
Check if there is enough space in buffer to advance.
b | - (vlib_buffer_t *) pointer to the buffer |
l | - (word) size to check |
Definition at line 229 of file buffer.h.
clib_error_t* vlib_buffer_main_init | ( | struct vlib_main_t * | vm | ) |
|
inlinestatic |
u8 vlib_buffer_pool_create | ( | struct vlib_main_t * | vm, |
vlib_physmem_region_index_t | region, | ||
u16 | buffer_size | ||
) |
static_always_inline vlib_buffer_pool_t* vlib_buffer_pool_get | ( | u8 | buffer_pool_index | ) |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Reset current header & length to state they were in when packet was received.
b | - (vlib_buffer_t *) pointer to the buffer |
Definition at line 241 of file buffer.h.
|
inlinestatic |
|
inlinestatic |
Get pointer to buffer's opaque data array.
b | - (vlib_buffer_t *) pointer to the buffer |
|
inlinestatic |
Get pointer to buffer's opaque2 data array.
b | - (vlib_buffer_t *) pointer to the buffer |
void* vlib_set_buffer_free_callback | ( | struct vlib_main_t * | vm, |
void * | fp | ||
) |
vlib_buffer_main_t buffer_main |
vlib_buffer_callbacks_t* vlib_buffer_callbacks |