FD.io VPP  v18.10-34-gcce845e
Vector Packet Processing
buffer_funcs.h File Reference

vlib buffer access methods. More...

+ Include dependency graph for buffer_funcs.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  vlib_packet_template_t
 

Macros

#define vlib_prefetch_buffer_with_index(vm, bi, type)
 Prefetch buffer metadata by buffer index The first 64 bytes of buffer contains most header information. More...
 
#define VLIB_BUFFER_CHAIN_MIN_FIRST_DATA_SIZE   (256)
 minimum data size of first buffer in a buffer chain More...
 

Enumerations

enum  vlib_buffer_known_state_t { VLIB_BUFFER_UNKNOWN, VLIB_BUFFER_KNOWN_FREE, VLIB_BUFFER_KNOWN_ALLOCATED }
 

Functions

static vlib_buffer_tvlib_get_buffer (vlib_main_t *vm, u32 buffer_index)
 Translate buffer index into buffer pointer. More...
 
static_always_inline void vlib_get_buffers_with_offset (vlib_main_t *vm, u32 *bi, void **b, int count, i32 offset)
 Translate array of buffer indices into buffer pointers with offset. More...
 
static_always_inline void vlib_get_buffers (vlib_main_t *vm, u32 *bi, vlib_buffer_t **b, int count)
 Translate array of buffer indices into buffer pointers. More...
 
static u32 vlib_get_buffer_index (vlib_main_t *vm, void *p)
 Translate buffer pointer into buffer index. More...
 
static_always_inline void vlib_get_buffer_indices_with_offset (vlib_main_t *vm, void **b, u32 *bi, uword count, i32 offset)
 Translate array of buffer pointers into buffer indices with offset. More...
 
static_always_inline void vlib_get_buffer_indices (vlib_main_t *vm, vlib_buffer_t **b, u32 *bi, uword count)
 Translate array of buffer pointers into buffer indices. More...
 
static vlib_buffer_tvlib_get_next_buffer (vlib_main_t *vm, vlib_buffer_t *b)
 Get next buffer in buffer linklist, or zero for end of list. More...
 
uword vlib_buffer_length_in_chain_slow_path (vlib_main_t *vm, vlib_buffer_t *b_first)
 
static uword vlib_buffer_length_in_chain (vlib_main_t *vm, vlib_buffer_t *b)
 Get length in bytes of the buffer chain. More...
 
static uword vlib_buffer_index_length_in_chain (vlib_main_t *vm, u32 bi)
 Get length in bytes of the buffer index buffer chain. More...
 
static uword vlib_buffer_contents (vlib_main_t *vm, u32 buffer_index, u8 *contents)
 Copy buffer contents to memory. More...
 
static u64 vlib_get_buffer_data_physical_address (vlib_main_t *vm, u32 buffer_index)
 
void vlib_buffer_validate_alloc_free (vlib_main_t *vm, u32 *buffers, uword n_buffers, vlib_buffer_known_state_t expected_state)
 
static vlib_buffer_known_state_t vlib_buffer_is_known (u32 buffer_index)
 
static void vlib_buffer_set_known_state (u32 buffer_index, vlib_buffer_known_state_t state)
 
u8vlib_validate_buffer (vlib_main_t *vm, u32 buffer_index, uword follow_chain)
 
static u32 vlib_buffer_round_size (u32 size)
 
static vlib_buffer_free_list_index_t vlib_buffer_get_free_list_index (vlib_buffer_t *b)
 
static void vlib_buffer_set_free_list_index (vlib_buffer_t *b, vlib_buffer_free_list_index_t index)
 
static u32 vlib_buffer_alloc_from_free_list (vlib_main_t *vm, u32 *buffers, u32 n_buffers, vlib_buffer_free_list_index_t index)
 Allocate buffers from specific freelist into supplied array. More...
 
static u32 vlib_buffer_alloc (vlib_main_t *vm, u32 *buffers, u32 n_buffers)
 Allocate buffers into supplied array. More...
 
static u32 vlib_buffer_alloc_to_ring (vlib_main_t *vm, u32 *ring, u32 start, u32 ring_size, u32 n_buffers)
 Allocate buffers into ring. More...
 
static void vlib_buffer_free (vlib_main_t *vm, u32 *buffers, u32 n_buffers)
 Free buffers Frees the entire buffer chain for each buffer. More...
 
static void vlib_buffer_free_no_next (vlib_main_t *vm, u32 *buffers, u32 n_buffers)
 Free buffers, does not free the buffer chain for each buffer. More...
 
static void vlib_buffer_free_one (vlib_main_t *vm, u32 buffer_index)
 Free one buffer Shorthand to free a single buffer chain. More...
 
static void vlib_buffer_free_from_ring (vlib_main_t *vm, u32 *ring, u32 start, u32 ring_size, u32 n_buffers)
 Free buffers from ring. More...
 
static void vlib_buffer_free_from_ring_no_next (vlib_main_t *vm, u32 *ring, u32 start, u32 ring_size, u32 n_buffers)
 Free buffers from ring without freeing tail buffers. More...
 
vlib_buffer_free_list_index_t vlib_buffer_create_free_list (vlib_main_t *vm, u32 n_data_bytes, char *fmt,...)
 
static void vlib_buffer_delete_free_list (vlib_main_t *vm, vlib_buffer_free_list_index_t free_list_index)
 
void vlib_buffer_free_list_fill_unaligned (vlib_main_t *vm, vlib_buffer_free_list_t *free_list, uword n_unaligned_buffers)
 
static vlib_buffer_free_list_tvlib_buffer_get_buffer_free_list (vlib_main_t *vm, vlib_buffer_t *b, vlib_buffer_free_list_index_t *index)
 
static vlib_buffer_free_list_tvlib_buffer_get_free_list (vlib_main_t *vm, vlib_buffer_free_list_index_t free_list_index)
 
static u32 vlib_buffer_free_list_buffer_size (vlib_main_t *vm, vlib_buffer_free_list_index_t index)
 
void vlib_aligned_memcpy (void *_dst, void *_src, int n_bytes)
 
static void vlib_copy_buffers (u32 *dst, u32 *src, u32 n)
 
u32 vlib_buffer_add_data (vlib_main_t *vm, vlib_buffer_free_list_index_t free_list_index, u32 buffer_index, void *data, u32 n_data_bytes)
 
static vlib_buffer_tvlib_buffer_copy (vlib_main_t *vm, vlib_buffer_t *b)
 
static u16 vlib_buffer_clone_256 (vlib_main_t *vm, u32 src_buffer, u32 *buffers, u16 n_buffers, u16 head_end_offset)
 Create a maximum of 256 clones of buffer and store them in the supplied array. More...
 
static u16 vlib_buffer_clone (vlib_main_t *vm, u32 src_buffer, u32 *buffers, u16 n_buffers, u16 head_end_offset)
 Create multiple clones of buffer and store them in the supplied array. More...
 
static void vlib_buffer_attach_clone (vlib_main_t *vm, vlib_buffer_t *head, vlib_buffer_t *tail)
 Attach cloned tail to the buffer. More...
 
static void vlib_buffer_chain_init (vlib_buffer_t *first)
 
static vlib_buffer_tvlib_buffer_chain_buffer (vlib_main_t *vm, vlib_buffer_t *first, vlib_buffer_t *last, u32 next_bi)
 
static void vlib_buffer_chain_increase_length (vlib_buffer_t *first, vlib_buffer_t *last, i32 len)
 
static u16 vlib_buffer_chain_append_data (vlib_main_t *vm, vlib_buffer_free_list_index_t free_list_index, vlib_buffer_t *first, vlib_buffer_t *last, void *data, u16 data_len)
 
u16 vlib_buffer_chain_append_data_with_alloc (vlib_main_t *vm, vlib_buffer_free_list_index_t free_list_index, vlib_buffer_t *first, vlib_buffer_t **last, void *data, u16 data_len)
 
void vlib_buffer_chain_validate (vlib_main_t *vm, vlib_buffer_t *first)
 
void vlib_packet_template_get_packet_helper (vlib_main_t *vm, vlib_packet_template_t *t)
 
void vlib_packet_template_init (vlib_main_t *vm, vlib_packet_template_t *t, void *packet_data, uword n_packet_data_bytes, uword min_n_buffers_each_alloc, char *fmt,...)
 
void * vlib_packet_template_get_packet (vlib_main_t *vm, vlib_packet_template_t *t, u32 *bi_result)
 
static void vlib_packet_template_free (vlib_main_t *vm, vlib_packet_template_t *t)
 
static u32 unserialize_vlib_buffer_n_bytes (serialize_main_t *m)
 
static void vlib_buffer_init_for_free_list (vlib_buffer_t *dst, vlib_buffer_free_list_t *fl)
 
static void vlib_buffer_add_to_free_list (vlib_main_t *vm, vlib_buffer_free_list_t *f, u32 buffer_index, u8 do_init)
 
static void vlib_validate_buffer_in_use (vlib_buffer_t *b, u32 expected)
 
static void vlib_validate_buffer_set_in_use (vlib_buffer_t *b, u32 expected)
 
static void vlib_buffer_chain_compress (vlib_main_t *vm, vlib_buffer_t *first, u32 **discard_vector)
 compress buffer chain in a way where the first buffer is at least VLIB_BUFFER_CHAIN_MIN_FIRST_DATA_SIZE long More...
 
static u32 vlib_buffer_space_left_at_end (vlib_main_t *vm, vlib_buffer_t *b)
 
static u32 vlib_buffer_chain_linearize (vlib_main_t *vm, vlib_buffer_t *b)
 

Variables

format_function_t format_vlib_buffer
 
format_function_t format_vlib_buffer_and_data
 
format_function_t format_vlib_buffer_contents
 
u32vlib_buffer_state_validation_lock
 
uwordvlib_buffer_state_validation_hash
 
void * vlib_buffer_state_heap
 

Detailed Description

vlib buffer access methods.

Definition in file buffer_funcs.h.

Macro Definition Documentation

#define VLIB_BUFFER_CHAIN_MIN_FIRST_DATA_SIZE   (256)

minimum data size of first buffer in a buffer chain

Definition at line 1211 of file buffer_funcs.h.

#define vlib_prefetch_buffer_with_index (   vm,
  bi,
  type 
)
Value:
do { \
vlib_buffer_t * _b = vlib_get_buffer (vm, bi); \
} while (0)
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
Definition: buffer.h:187
vlib_main_t * vm
Definition: buffer.c:294
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
Definition: buffer_funcs.h:58

Prefetch buffer metadata by buffer index The first 64 bytes of buffer contains most header information.

Parameters
vm- (vlib_main_t *) vlib main data structure pointer
bi- (u32) buffer index
type- LOAD, STORE. In most cases, STORE is the right answer

Definition at line 337 of file buffer_funcs.h.

Enumeration Type Documentation

Enumerator
VLIB_BUFFER_UNKNOWN 
VLIB_BUFFER_KNOWN_FREE 
VLIB_BUFFER_KNOWN_ALLOCATED 

Definition at line 365 of file buffer_funcs.h.

Function Documentation

static u32 unserialize_vlib_buffer_n_bytes ( serialize_main_t m)
inlinestatic

Definition at line 1045 of file buffer_funcs.h.

+ Here is the call graph for this function:

void vlib_aligned_memcpy ( void *  _dst,
void *  _src,
int  n_bytes 
)

+ Here is the caller graph for this function:

u32 vlib_buffer_add_data ( vlib_main_t vm,
vlib_buffer_free_list_index_t  free_list_index,
u32  buffer_index,
void *  data,
u32  n_data_bytes 
)

Definition at line 776 of file buffer.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void vlib_buffer_add_to_free_list ( vlib_main_t vm,
vlib_buffer_free_list_t f,
u32  buffer_index,
u8  do_init 
)
inlinestatic

Definition at line 1118 of file buffer_funcs.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u32 vlib_buffer_alloc ( vlib_main_t vm,
u32 buffers,
u32  n_buffers 
)
inlinestatic

Allocate buffers into supplied array.

Parameters
vm- (vlib_main_t *) vlib main data structure pointer
buffers- (u32 * ) buffer index array
n_buffers- (u32) number of buffers requested
Returns
- (u32) number of buffers actually allocated, may be less than the number requested or zero

Definition at line 503 of file buffer_funcs.h.

+ Here is the call graph for this function:

static u32 vlib_buffer_alloc_from_free_list ( vlib_main_t vm,
u32 buffers,
u32  n_buffers,
vlib_buffer_free_list_index_t  index 
)
inlinestatic

Allocate buffers from specific freelist into supplied array.

Parameters
vm- (vlib_main_t *) vlib main data structure pointer
buffers- (u32 * ) buffer index array
n_buffers- (u32) number of buffers requested
Returns
- (u32) number of buffers actually allocated, may be less than the number requested or zero

Definition at line 444 of file buffer_funcs.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u32 vlib_buffer_alloc_to_ring ( vlib_main_t vm,
u32 ring,
u32  start,
u32  ring_size,
u32  n_buffers 
)
inlinestatic

Allocate buffers into ring.

Parameters
vm- (vlib_main_t *) vlib main data structure pointer
buffers- (u32 * ) buffer index ring
start- (u32) first slot in the ring
ring_size- (u32) ring size
n_buffers- (u32) number of buffers requested
Returns
- (u32) number of buffers actually allocated, may be less than the number requested or zero

Definition at line 520 of file buffer_funcs.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void vlib_buffer_attach_clone ( vlib_main_t vm,
vlib_buffer_t head,
vlib_buffer_t tail 
)
inlinestatic

Attach cloned tail to the buffer.

Parameters
vm- (vlib_main_t *) vlib main data structure pointer
head- (vlib_buffer_t *) head buffer
tail- (Vlib buffer_t *) tail buffer to clone and attach to head

Definition at line 910 of file buffer_funcs.h.

+ Here is the call graph for this function:

static u16 vlib_buffer_chain_append_data ( vlib_main_t vm,
vlib_buffer_free_list_index_t  free_list_index,
vlib_buffer_t first,
vlib_buffer_t last,
void *  data,
u16  data_len 
)
inlinestatic

Definition at line 976 of file buffer_funcs.h.

+ Here is the call graph for this function:

u16 vlib_buffer_chain_append_data_with_alloc ( vlib_main_t vm,
vlib_buffer_free_list_index_t  free_list_index,
vlib_buffer_t first,
vlib_buffer_t **  last,
void *  data,
u16  data_len 
)

Definition at line 833 of file buffer.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static vlib_buffer_t* vlib_buffer_chain_buffer ( vlib_main_t vm,
vlib_buffer_t first,
vlib_buffer_t last,
u32  next_bi 
)
inlinestatic

Definition at line 947 of file buffer_funcs.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void vlib_buffer_chain_compress ( vlib_main_t vm,
vlib_buffer_t first,
u32 **  discard_vector 
)
inlinestatic

compress buffer chain in a way where the first buffer is at least VLIB_BUFFER_CHAIN_MIN_FIRST_DATA_SIZE long

Parameters
[in]vm- vlib_main
[in,out]first- first buffer in chain
[in,out]discard_vector- vector of buffer indexes which were removed from the chain

Definition at line 1223 of file buffer_funcs.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void vlib_buffer_chain_increase_length ( vlib_buffer_t first,
vlib_buffer_t last,
i32  len 
)
inlinestatic

Definition at line 964 of file buffer_funcs.h.

+ Here is the caller graph for this function:

static void vlib_buffer_chain_init ( vlib_buffer_t first)
inlinestatic

Definition at line 937 of file buffer_funcs.h.

static u32 vlib_buffer_chain_linearize ( vlib_main_t vm,
vlib_buffer_t b 
)
inlinestatic

Definition at line 1280 of file buffer_funcs.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void vlib_buffer_chain_validate ( vlib_main_t vm,
vlib_buffer_t first 
)

+ Here is the caller graph for this function:

static u16 vlib_buffer_clone ( vlib_main_t vm,
u32  src_buffer,
u32 buffers,
u16  n_buffers,
u16  head_end_offset 
)
inlinestatic

Create multiple clones of buffer and store them in the supplied array.

Parameters
vm- (vlib_main_t *) vlib main data structure pointer
src_buffer- (u32) source buffer index
buffers- (u32 * ) buffer index array
n_buffers- (u16) number of buffer clones requested (<=256)
head_end_offset- (u16) offset relative to current position where packet head ends
Returns
- (u16) number of buffers actually cloned, may be less than the number requested or zero

Definition at line 879 of file buffer_funcs.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u16 vlib_buffer_clone_256 ( vlib_main_t vm,
u32  src_buffer,
u32 buffers,
u16  n_buffers,
u16  head_end_offset 
)
inlinestatic

Create a maximum of 256 clones of buffer and store them in the supplied array.

Parameters
vm- (vlib_main_t *) vlib main data structure pointer
src_buffer- (u32) source buffer index
buffers- (u32 * ) buffer index array
n_buffers- (u16) number of buffer clones requested (<=256)
head_end_offset- (u16) offset relative to current position where packet head ends
Returns
- (u16) number of buffers actually cloned, may be less than the number requested or zero

Definition at line 797 of file buffer_funcs.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword vlib_buffer_contents ( vlib_main_t vm,
u32  buffer_index,
u8 contents 
)
inlinestatic

Copy buffer contents to memory.

Parameters
vm- (vlib_main_t *) vlib main data structure pointer
buffer_index- (u32) buffer index
contents- (u8 *) memory, must be large enough
Returns
- (uword) length of buffer chain

Definition at line 297 of file buffer_funcs.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static vlib_buffer_t* vlib_buffer_copy ( vlib_main_t vm,
vlib_buffer_t b 
)
inlinestatic

Definition at line 728 of file buffer_funcs.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

vlib_buffer_free_list_index_t vlib_buffer_create_free_list ( vlib_main_t vm,
u32  n_data_bytes,
char *  fmt,
  ... 
)

Definition at line 415 of file buffer.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void vlib_buffer_delete_free_list ( vlib_main_t vm,
vlib_buffer_free_list_index_t  free_list_index 
)
inlinestatic

Definition at line 648 of file buffer_funcs.h.

+ Here is the call graph for this function:

static void vlib_buffer_free ( vlib_main_t vm,
u32 buffers,
u32  n_buffers 
)
inlinestatic

Free buffers Frees the entire buffer chain for each buffer.

Parameters
vm- (vlib_main_t *) vlib main data structure pointer
buffers- (u32 * ) buffer index array
n_buffers- (u32) number of buffers to free

Definition at line 547 of file buffer_funcs.h.

static void vlib_buffer_free_from_ring ( vlib_main_t vm,
u32 ring,
u32  start,
u32  ring_size,
u32  n_buffers 
)
inlinestatic

Free buffers from ring.

Parameters
vm- (vlib_main_t *) vlib main data structure pointer
buffers- (u32 * ) buffer index ring
start- (u32) first slot in the ring
ring_size- (u32) ring size
n_buffers- (u32) number of buffers

Definition at line 602 of file buffer_funcs.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void vlib_buffer_free_from_ring_no_next ( vlib_main_t vm,
u32 ring,
u32  start,
u32  ring_size,
u32  n_buffers 
)
inlinestatic

Free buffers from ring without freeing tail buffers.

Parameters
vm- (vlib_main_t *) vlib main data structure pointer
buffers- (u32 * ) buffer index ring
start- (u32) first slot in the ring
ring_size- (u32) ring size
n_buffers- (u32) number of buffers

Definition at line 627 of file buffer_funcs.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u32 vlib_buffer_free_list_buffer_size ( vlib_main_t vm,
vlib_buffer_free_list_index_t  index 
)
inlinestatic

Definition at line 689 of file buffer_funcs.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void vlib_buffer_free_list_fill_unaligned ( vlib_main_t vm,
vlib_buffer_free_list_t free_list,
uword  n_unaligned_buffers 
)

+ Here is the caller graph for this function:

static void vlib_buffer_free_no_next ( vlib_main_t vm,
u32 buffers,
u32  n_buffers 
)
inlinestatic

Free buffers, does not free the buffer chain for each buffer.

Parameters
vm- (vlib_main_t *) vlib main data structure pointer
buffers- (u32 * ) buffer index array
n_buffers- (u32) number of buffers to free

Definition at line 568 of file buffer_funcs.h.

+ Here is the caller graph for this function:

static void vlib_buffer_free_one ( vlib_main_t vm,
u32  buffer_index 
)
inlinestatic

Free one buffer Shorthand to free a single buffer chain.

Parameters
vm- (vlib_main_t *) vlib main data structure pointer
buffer_index- (u32) buffer index to free

Definition at line 588 of file buffer_funcs.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static vlib_buffer_free_list_t* vlib_buffer_get_buffer_free_list ( vlib_main_t vm,
vlib_buffer_t b,
vlib_buffer_free_list_index_t index 
)
inlinestatic

Definition at line 665 of file buffer_funcs.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static vlib_buffer_free_list_t* vlib_buffer_get_free_list ( vlib_main_t vm,
vlib_buffer_free_list_index_t  free_list_index 
)
inlinestatic

Definition at line 675 of file buffer_funcs.h.

+ Here is the caller graph for this function:

static vlib_buffer_free_list_index_t vlib_buffer_get_free_list_index ( vlib_buffer_t b)
inlinestatic

Definition at line 414 of file buffer_funcs.h.

+ Here is the caller graph for this function:

static uword vlib_buffer_index_length_in_chain ( vlib_main_t vm,
u32  bi 
)
inlinestatic

Get length in bytes of the buffer index buffer chain.

Parameters
vm- (vlib_main_t *) vlib main data structure pointer
bi- (u32) buffer index
Returns
- (uword) length of buffer chain

Definition at line 283 of file buffer_funcs.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void vlib_buffer_init_for_free_list ( vlib_buffer_t dst,
vlib_buffer_free_list_t fl 
)
inlinestatic

Definition at line 1078 of file buffer_funcs.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static vlib_buffer_known_state_t vlib_buffer_is_known ( u32  buffer_index)
inlinestatic

Definition at line 381 of file buffer_funcs.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword vlib_buffer_length_in_chain ( vlib_main_t vm,
vlib_buffer_t b 
)
inlinestatic

Get length in bytes of the buffer chain.

Parameters
vm- (vlib_main_t *) vlib main data structure pointer
b- (void *) buffer pointer
Returns
- (uword) length of buffer chain

Definition at line 263 of file buffer_funcs.h.

+ Here is the call graph for this function:

uword vlib_buffer_length_in_chain_slow_path ( vlib_main_t vm,
vlib_buffer_t b_first 
)

Definition at line 55 of file buffer.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u32 vlib_buffer_round_size ( u32  size)
inlinestatic

Definition at line 408 of file buffer_funcs.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void vlib_buffer_set_free_list_index ( vlib_buffer_t b,
vlib_buffer_free_list_index_t  index 
)
inlinestatic

Definition at line 423 of file buffer_funcs.h.

+ Here is the caller graph for this function:

static void vlib_buffer_set_known_state ( u32  buffer_index,
vlib_buffer_known_state_t  state 
)
inlinestatic

Definition at line 392 of file buffer_funcs.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u32 vlib_buffer_space_left_at_end ( vlib_main_t vm,
vlib_buffer_t b 
)
inlinestatic

Definition at line 1273 of file buffer_funcs.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void vlib_buffer_validate_alloc_free ( vlib_main_t vm,
u32 buffers,
uword  n_buffers,
vlib_buffer_known_state_t  expected_state 
)

Definition at line 309 of file buffer.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void vlib_copy_buffers ( u32 dst,
u32 src,
u32  n 
)
inlinestatic

Definition at line 700 of file buffer_funcs.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static vlib_buffer_t* vlib_get_buffer ( vlib_main_t vm,
u32  buffer_index 
)
inlinestatic

Translate buffer index into buffer pointer.

Parameters
vm- (vlib_main_t *) vlib main data structure pointer
buffer_index- (u32) buffer index
Returns
- (vlib_buffer_t *) buffer pointer

Definition at line 58 of file buffer_funcs.h.

static u64 vlib_get_buffer_data_physical_address ( vlib_main_t vm,
u32  buffer_index 
)
inlinestatic

Definition at line 319 of file buffer_funcs.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u32 vlib_get_buffer_index ( vlib_main_t vm,
void *  p 
)
inlinestatic

Translate buffer pointer into buffer index.

Parameters
vm- (vlib_main_t *) vlib main data structure pointer
p- (void *) buffer pointer
Returns
- (u32) buffer index

Definition at line 154 of file buffer_funcs.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static_always_inline void vlib_get_buffer_indices ( vlib_main_t vm,
vlib_buffer_t **  b,
u32 bi,
uword  count 
)

Translate array of buffer pointers into buffer indices.

Parameters
vm- (vlib_main_t *) vlib main data structure pointer
b- (vlib_buffer_t **) array of buffer pointers
bi- (u32 *) array to store buffer indices
count- (uword) number of elements

Definition at line 234 of file buffer_funcs.h.

+ Here is the call graph for this function:

static_always_inline void vlib_get_buffer_indices_with_offset ( vlib_main_t vm,
void **  b,
u32 bi,
uword  count,
i32  offset 
)

Translate array of buffer pointers into buffer indices with offset.

Parameters
vm- (vlib_main_t *) vlib main data structure pointer
b- (void **) array of buffer pointers
bi- (u32 *) array to store buffer indices
count- (uword) number of elements
offset- (i32) offset applied to each pointer

Definition at line 173 of file buffer_funcs.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static_always_inline void vlib_get_buffers ( vlib_main_t vm,
u32 bi,
vlib_buffer_t **  b,
int  count 
)

Translate array of buffer indices into buffer pointers.

Parameters
vm- (vlib_main_t *) vlib main data structure pointer
bi- (u32 *) array of buffer indices
b- (vlib_buffer_t **) array to store buffer pointers
count- (uword) number of elements

Definition at line 141 of file buffer_funcs.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static_always_inline void vlib_get_buffers_with_offset ( vlib_main_t vm,
u32 bi,
void **  b,
int  count,
i32  offset 
)

Translate array of buffer indices into buffer pointers with offset.

Parameters
vm- (vlib_main_t *) vlib main data structure pointer
bi- (u32 *) array of buffer indices
b- (void **) array to store buffer pointers
count- (uword) number of elements
offset- (i32) offset applied to each pointer

Definition at line 76 of file buffer_funcs.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static vlib_buffer_t* vlib_get_next_buffer ( vlib_main_t vm,
vlib_buffer_t b 
)
inlinestatic

Get next buffer in buffer linklist, or zero for end of list.

Parameters
vm- (vlib_main_t *) vlib main data structure pointer
b- (void *) buffer pointer
Returns
- (vlib_buffer_t *) next buffer, or NULL

Definition at line 247 of file buffer_funcs.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void vlib_packet_template_free ( vlib_main_t vm,
vlib_packet_template_t t 
)
inlinestatic

Definition at line 1039 of file buffer_funcs.h.

void* vlib_packet_template_get_packet ( vlib_main_t vm,
vlib_packet_template_t t,
u32 bi_result 
)

Definition at line 738 of file buffer.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void vlib_packet_template_get_packet_helper ( vlib_main_t vm,
vlib_packet_template_t t 
)

Definition at line 758 of file buffer.c.

+ Here is the call graph for this function:

void vlib_packet_template_init ( vlib_main_t vm,
vlib_packet_template_t t,
void *  packet_data,
uword  n_packet_data_bytes,
uword  min_n_buffers_each_alloc,
char *  fmt,
  ... 
)

Definition at line 690 of file buffer.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8* vlib_validate_buffer ( vlib_main_t vm,
u32  buffer_index,
uword  follow_chain 
)

Definition at line 225 of file buffer.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void vlib_validate_buffer_in_use ( vlib_buffer_t b,
u32  expected 
)
inlinestatic

Definition at line 1148 of file buffer_funcs.h.

+ Here is the call graph for this function:

static void vlib_validate_buffer_set_in_use ( vlib_buffer_t b,
u32  expected 
)
inlinestatic

Definition at line 1192 of file buffer_funcs.h.

+ Here is the call graph for this function:

Variable Documentation

format_function_t format_vlib_buffer

Definition at line 1007 of file buffer_funcs.h.

format_function_t format_vlib_buffer_and_data

Definition at line 1007 of file buffer_funcs.h.

format_function_t format_vlib_buffer_contents

Definition at line 1007 of file buffer_funcs.h.

void* vlib_buffer_state_heap

Definition at line 576 of file buffer.c.

uword* vlib_buffer_state_validation_hash

Definition at line 575 of file buffer.c.

u32* vlib_buffer_state_validation_lock

Definition at line 574 of file buffer.c.