FD.io VPP
v19.01.3-6-g70449b9b9
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 |
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 } |
Functions | |
static void | vlib_buffer_struct_is_sane (vlib_buffer_t *b) |
static uword | vlib_buffer_get_va (vlib_buffer_t *b) |
static void * | vlib_buffer_get_current (vlib_buffer_t *b) |
Get pointer to current data to process. More... | |
static uword | vlib_buffer_get_current_va (vlib_buffer_t *b) |
static void | vlib_buffer_advance (vlib_buffer_t *b, word l) |
Advance current data pointer by the supplied (signed!) amount. More... | |
static u8 | vlib_buffer_has_space (vlib_buffer_t *b, word l) |
Check if there is enough space in buffer to advance. More... | |
static void | vlib_buffer_reset (vlib_buffer_t *b) |
Reset current header & length to state they were in when packet was received. More... | |
static void * | vlib_get_buffer_opaque (vlib_buffer_t *b) |
Get pointer to buffer's opaque data array. More... | |
static void * | vlib_get_buffer_opaque2 (vlib_buffer_t *b) |
Get pointer to buffer's opaque2 data array. More... | |
static u8 * | vlib_buffer_get_tail (vlib_buffer_t *b) |
Get pointer to the end of buffer's data. More... | |
static void * | vlib_buffer_put_uninit (vlib_buffer_t *b, u16 size) |
Append uninitialized data to buffer. More... | |
static void * | vlib_buffer_push_uninit (vlib_buffer_t *b, u8 size) |
Prepend uninitialized data to buffer. More... | |
static void * | vlib_buffer_make_headroom (vlib_buffer_t *b, u8 size) |
Make head room, typically for packet headers. More... | |
static void * | vlib_buffer_pull (vlib_buffer_t *b, u8 size) |
Retrieve bytes from buffer head. More... | |
static_always_inline vlib_buffer_pool_t * | vlib_buffer_pool_get (u8 buffer_pool_index) |
u8 | vlib_buffer_register_physmem_map (struct vlib_main_t *vm, u32 physmem_map_index) |
clib_error_t * | vlib_buffer_main_init (struct vlib_main_t *vm) |
void * | vlib_set_buffer_free_callback (struct vlib_main_t *vm, void *fp) |
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 |
#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_data | ( | b, | |
type | |||
) | CLIB_PREFETCH (vlib_buffer_get_current(b), CLIB_CACHE_LINE_BYTES, type) |
#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) |
|
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 |
|
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 250 of file buffer.h.
clib_error_t* vlib_buffer_main_init | ( | struct vlib_main_t * | vm | ) |
|
inlinestatic |
static_always_inline vlib_buffer_pool_t* vlib_buffer_pool_get | ( | u8 | buffer_pool_index | ) |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
u8 vlib_buffer_register_physmem_map | ( | struct vlib_main_t * | vm, |
u32 | physmem_map_index | ||
) |
|
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 262 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 |