FD.io VPP
v16.06
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_main_t |
struct | vlib_serialize_buffer_main_t |
Typedefs | |
typedef u64 | vlib_copy_unit_t |
typedef struct vlib_buffer_free_list_t | vlib_buffer_free_list_t |
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.
#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_NEXT_PRESENT (1 << VLIB_BUFFER_LOG2_NEXT_PRESENT) |
#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...
See vlib/main.c...
#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 struct vlib_buffer_free_list_t vlib_buffer_free_list_t |
typedef u64 vlib_copy_unit_t |
u32 serialize_close_vlib_buffer | ( | serialize_main_t * | m | ) |
void serialize_open_vlib_buffer | ( | serialize_main_t * | m, |
struct vlib_main_t * | vm, | ||
vlib_serialize_buffer_main_t * | sm | ||
) |
always_inline u32 serialize_vlib_buffer_n_bytes | ( | serialize_main_t * | m | ) |
void unserialize_close_vlib_buffer | ( | serialize_main_t * | m | ) |
void unserialize_open_vlib_buffer | ( | serialize_main_t * | m, |
struct vlib_main_t * | vm, | ||
vlib_serialize_buffer_main_t * | sm | ||
) |
always_inline void vlib_buffer_advance | ( | vlib_buffer_t * | b, |
word | l | ||
) |
Advance current data pointer by the supplied (signed!) amount.
b | - (vlib_buffer_t *) pointer to the buffer |
l | - (word) signed increment |
always_inline void* vlib_buffer_get_current | ( | vlib_buffer_t * | b | ) |
Get pointer to current data to process.
b | - (vlib_buffer_t *) pointer to the buffer |
always_inline vlib_buffer_t* vlib_buffer_next_contiguous | ( | vlib_buffer_t * | b, |
u32 | buffer_bytes | ||
) |
always_inline void vlib_buffer_reset | ( | vlib_buffer_t * | b | ) |
Reset current header & length to state they were in when packet was received.
b | - (vlib_buffer_t *) pointer to the buffer |
Definition at line 211 of file buffer.h.
always_inline void vlib_buffer_struct_is_sane | ( | vlib_buffer_t * | b | ) |
always_inline void* vlib_get_buffer_opaque | ( | vlib_buffer_t * | b | ) |
Get pointer to buffer's opaque data array.
b | - (vlib_buffer_t *) pointer to the buffer |
always_inline void* vlib_get_buffer_opaque2 | ( | vlib_buffer_t * | b | ) |
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 | ||
) |