FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
buffer_funcs.h File Reference
+ 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_buffer_func_main_t
 
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_COPY_CLONE_FLAGS_MASK
 
#define VLIB_BUFFER_LINEARIZE_MAX   64
 

Typedefs

typedef void() vlib_buffer_enqueue_to_next_fn_t(vlib_main_t *vm, vlib_node_runtime_t *node, u32 *buffers, u16 *nexts, uword count)
 
typedef void() vlib_buffer_enqueue_to_single_next_fn_t(vlib_main_t *vm, vlib_node_runtime_t *node, u32 *ers, u16 next_index, u32 count)
 
typedef u32() vlib_buffer_enqueue_to_thread_fn_t(vlib_main_t *vm, vlib_node_runtime_t *node, u32 frame_queue_index, u32 *buffer_indices, u16 *thread_indices, u32 n_packets, int drop_on_congestion)
 
typedef u32() vlib_frame_queue_dequeue_fn_t(vlib_main_t *vm, vlib_frame_queue_main_t *fqm)
 

Enumerations

enum  vlib_buffer_known_state_t { VLIB_BUFFER_UNKNOWN, VLIB_BUFFER_KNOWN_FREE, VLIB_BUFFER_KNOWN_ALLOCATED }
 

Functions

static void vlib_buffer_validate (vlib_main_t *vm, vlib_buffer_t *b)
 
static void * vlib_buffer_ptr_from_index (uword buffer_mem_start, u32 buffer_index, uword offset)
 
static vlib_buffer_tvlib_get_buffer (vlib_main_t *vm, u32 buffer_index)
 Translate buffer index into buffer pointer. More...
 
static_always_inline u32 vlib_buffer_get_default_data_size (vlib_main_t *vm)
 
static_always_inline void vlib_buffer_copy_indices (u32 *dst, u32 *src, u32 n_indices)
 
static void vlib_buffer_copy_indices_from_ring (u32 *dst, u32 *ring, u32 start, u32 ring_size, u32 n_buffers)
 
static void vlib_buffer_copy_indices_to_ring (u32 *ring, u32 *src, u32 start, u32 ring_size, u32 n_buffers)
 
 STATIC_ASSERT_OFFSET_OF (vlib_buffer_t, template_end, 64)
 
static_always_inline void vlib_buffer_copy_template (vlib_buffer_t *b, vlib_buffer_t *bt)
 
static u8 vlib_buffer_pool_get_default_for_numa (vlib_main_t *vm, u32 numa_node)
 
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 uword vlib_buffer_get_pa (vlib_main_t *vm, vlib_buffer_t *b)
 
static uword vlib_buffer_get_current_pa (vlib_main_t *vm, vlib_buffer_t *b)
 
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 (vlib_main_t *vm, u32 buffer_index)
 
u8vlib_validate_buffer (vlib_main_t *vm, u32 buffer_index, uword follow_chain)
 
u8vlib_validate_buffers (vlib_main_t *vm, u32 *buffers, uword next_buffer_stride, uword n_buffers, vlib_buffer_known_state_t known_state, uword follow_buffer_next)
 
static_always_inline vlib_buffer_pool_tvlib_get_buffer_pool (vlib_main_t *vm, u8 buffer_pool_index)
 
static_always_inline __clib_warn_unused_result uword vlib_buffer_pool_get (vlib_main_t *vm, u8 buffer_pool_index, u32 *buffers, u32 n_buffers)
 
static __clib_warn_unused_result u32 vlib_buffer_alloc_from_pool (vlib_main_t *vm, u32 *buffers, u32 n_buffers, u8 buffer_pool_index)
 Allocate buffers from specific pool into supplied array. More...
 
static __clib_warn_unused_result u32 vlib_buffer_alloc_on_numa (vlib_main_t *vm, u32 *buffers, u32 n_buffers, u32 numa_node)
 Allocate buffers from specific numa node into supplied array. More...
 
static __clib_warn_unused_result u32 vlib_buffer_alloc (vlib_main_t *vm, u32 *buffers, u32 n_buffers)
 Allocate buffers into supplied array. More...
 
static __clib_warn_unused_result 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 __clib_warn_unused_result u32 vlib_buffer_alloc_to_ring_from_pool (vlib_main_t *vm, u32 *ring, u32 start, u32 ring_size, u32 n_buffers, u8 buffer_pool_index)
 Allocate buffers into ring from specific buffer pool. More...
 
static_always_inline void vlib_buffer_pool_put (vlib_main_t *vm, u8 buffer_pool_index, u32 *buffers, u32 n_buffers)
 
static_always_inline void vlib_buffer_free_inline (vlib_main_t *vm, u32 *buffers, u32 n_buffers, int maybe_next)
 
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...
 
int vlib_buffer_add_data (vlib_main_t *vm, u32 *buffer_index, void *data, u32 n_data_bytes)
 
static vlib_buffer_tvlib_buffer_copy (vlib_main_t *vm, vlib_buffer_t *b)
 
static vlib_buffer_tvlib_buffer_copy_no_chain (vlib_main_t *vm, vlib_buffer_t *b, u32 *di)
 
static void vlib_buffer_move (vlib_main_t *vm, vlib_buffer_t *b, i16 offset)
 
static u16 vlib_buffer_clone_256 (vlib_main_t *vm, u32 src_buffer, u32 *buffers, u16 n_buffers, u16 head_end_offset, i16 offset)
 Create a maximum of 256 clones of buffer and store them in the supplied array. More...
 
static u16 vlib_buffer_clone_at_offset (vlib_main_t *vm, u32 src_buffer, u32 *buffers, u16 n_buffers, u16 head_end_offset, i16 offset)
 Create multiple 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 *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_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_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_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 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

vlib_buffer_func_main_t vlib_buffer_func_main
 
format_function_t format_vlib_buffer
 
format_function_t format_vlib_buffer_and_data
 
format_function_t format_vlib_buffer_contents
 
format_function_t format_vlib_buffer_no_chain
 

Detailed Description

vlib buffer access methods.

Definition in file buffer_funcs.h.

Macro Definition Documentation

◆ VLIB_BUFFER_COPY_CLONE_FLAGS_MASK

#define VLIB_BUFFER_COPY_CLONE_FLAGS_MASK
Value:
(VLIB_BUFFER_NEXT_PRESENT | VLIB_BUFFER_TOTAL_LENGTH_VALID | \
VLIB_BUFFER_IS_TRACED | ~VLIB_BUFFER_FLAGS_ALL)

Definition at line 1072 of file buffer_funcs.h.

◆ VLIB_BUFFER_LINEARIZE_MAX

#define VLIB_BUFFER_LINEARIZE_MAX   64

Definition at line 1468 of file buffer_funcs.h.

◆ vlib_prefetch_buffer_with_index

#define vlib_prefetch_buffer_with_index (   vm,
  bi,
  type 
)
Value:
do { \
vlib_buffer_t * _b = vlib_get_buffer (vm, bi); \
vlib_prefetch_buffer_header (_b, type); \
} while (0)

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 507 of file buffer_funcs.h.

Typedef Documentation

◆ vlib_buffer_enqueue_to_next_fn_t

typedef void() vlib_buffer_enqueue_to_next_fn_t(vlib_main_t *vm, vlib_node_runtime_t *node, u32 *buffers, u16 *nexts, uword count)

Definition at line 54 of file buffer_funcs.h.

◆ vlib_buffer_enqueue_to_single_next_fn_t

typedef void() vlib_buffer_enqueue_to_single_next_fn_t(vlib_main_t *vm, vlib_node_runtime_t *node, u32 *ers, u16 next_index, u32 count)

Definition at line 58 of file buffer_funcs.h.

◆ vlib_buffer_enqueue_to_thread_fn_t

typedef u32() vlib_buffer_enqueue_to_thread_fn_t(vlib_main_t *vm, vlib_node_runtime_t *node, u32 frame_queue_index, u32 *buffer_indices, u16 *thread_indices, u32 n_packets, int drop_on_congestion)

Definition at line 62 of file buffer_funcs.h.

◆ vlib_frame_queue_dequeue_fn_t

typedef u32() vlib_frame_queue_dequeue_fn_t(vlib_main_t *vm, vlib_frame_queue_main_t *fqm)

Definition at line 67 of file buffer_funcs.h.

Enumeration Type Documentation

◆ vlib_buffer_known_state_t

Enumerator
VLIB_BUFFER_UNKNOWN 
VLIB_BUFFER_KNOWN_FREE 
VLIB_BUFFER_KNOWN_ALLOCATED 

Definition at line 513 of file buffer_funcs.h.

Function Documentation

◆ STATIC_ASSERT_OFFSET_OF()

STATIC_ASSERT_OFFSET_OF ( vlib_buffer_t  ,
template_end  ,
64   
)

◆ vlib_buffer_add_data()

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

Definition at line 398 of file buffer.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_buffer_alloc()

static __clib_warn_unused_result 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 702 of file buffer_funcs.h.

+ Here is the call graph for this function:

◆ vlib_buffer_alloc_from_pool()

static __clib_warn_unused_result u32 vlib_buffer_alloc_from_pool ( vlib_main_t vm,
u32 buffers,
u32  n_buffers,
u8  buffer_pool_index 
)
inlinestatic

Allocate buffers from specific pool 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 597 of file buffer_funcs.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_buffer_alloc_on_numa()

static __clib_warn_unused_result u32 vlib_buffer_alloc_on_numa ( vlib_main_t vm,
u32 buffers,
u32  n_buffers,
u32  numa_node 
)
inlinestatic

Allocate buffers from specific numa node 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
numa_node- (u32) numa node
Returns
- (u32) number of buffers actually allocated, may be less than the number requested or zero

Definition at line 685 of file buffer_funcs.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_buffer_alloc_to_ring()

static __clib_warn_unused_result 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 718 of file buffer_funcs.h.

+ Here is the call graph for this function:

◆ vlib_buffer_alloc_to_ring_from_pool()

static __clib_warn_unused_result u32 vlib_buffer_alloc_to_ring_from_pool ( vlib_main_t vm,
u32 ring,
u32  start,
u32  ring_size,
u32  n_buffers,
u8  buffer_pool_index 
)
inlinestatic

Allocate buffers into ring from specific buffer pool.

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 747 of file buffer_funcs.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_buffer_attach_clone()

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 1340 of file buffer_funcs.h.

+ Here is the call graph for this function:

◆ vlib_buffer_chain_append_data()

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

Definition at line 1403 of file buffer_funcs.h.

+ Here is the call graph for this function:

◆ vlib_buffer_chain_append_data_with_alloc()

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

Definition at line 453 of file buffer.c.

+ Here is the call graph for this function:

◆ vlib_buffer_chain_buffer()

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

Definition at line 1376 of file buffer_funcs.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_buffer_chain_increase_length()

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

Definition at line 1391 of file buffer_funcs.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_buffer_chain_init()

static void vlib_buffer_chain_init ( vlib_buffer_t first)
inlinestatic

Definition at line 1366 of file buffer_funcs.h.

+ Here is the call graph for this function:

◆ vlib_buffer_chain_linearize()

static u32 vlib_buffer_chain_linearize ( vlib_main_t vm,
vlib_buffer_t b 
)
inlinestatic

Definition at line 1471 of file buffer_funcs.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_buffer_chain_validate()

void vlib_buffer_chain_validate ( vlib_main_t vm,
vlib_buffer_t first 
)

◆ vlib_buffer_clone()

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 1325 of file buffer_funcs.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_buffer_clone_256()

static u16 vlib_buffer_clone_256 ( vlib_main_t vm,
u32  src_buffer,
u32 buffers,
u16  n_buffers,
u16  head_end_offset,
i16  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
offset- (i16) copy packet head at current position if 0, else at offset position to change headroom space as specified
Returns
- (u16) number of buffers actually cloned, may be less than the number requested or zero

Definition at line 1196 of file buffer_funcs.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_buffer_clone_at_offset()

static u16 vlib_buffer_clone_at_offset ( vlib_main_t vm,
u32  src_buffer,
u32 buffers,
u16  n_buffers,
u16  head_end_offset,
i16  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
offset- (i16) copy packet head at current position if 0, else at offset position to change headroom space as specified
Returns
- (u16) number of buffers actually cloned, may be less than the number requested or zero

Definition at line 1289 of file buffer_funcs.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_buffer_contents()

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 467 of file buffer_funcs.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_buffer_copy()

static vlib_buffer_t* vlib_buffer_copy ( vlib_main_t vm,
vlib_buffer_t b 
)
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:

◆ vlib_buffer_copy_indices()

static_always_inline void vlib_buffer_copy_indices ( u32 dst,
u32 src,
u32  n_indices 
)

Definition at line 128 of file buffer_funcs.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_buffer_copy_indices_from_ring()

static void vlib_buffer_copy_indices_from_ring ( u32 dst,
u32 ring,
u32  start,
u32  ring_size,
u32  n_buffers 
)
inlinestatic

Definition at line 134 of file buffer_funcs.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_buffer_copy_indices_to_ring()

static void vlib_buffer_copy_indices_to_ring ( u32 ring,
u32 src,
u32  start,
u32  ring_size,
u32  n_buffers 
)
inlinestatic

Definition at line 152 of file buffer_funcs.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_buffer_copy_no_chain()

static vlib_buffer_t* vlib_buffer_copy_no_chain ( vlib_main_t vm,
vlib_buffer_t b,
u32 di 
)
inlinestatic

Definition at line 1137 of file buffer_funcs.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_buffer_copy_template()

static_always_inline void vlib_buffer_copy_template ( vlib_buffer_t b,
vlib_buffer_t bt 
)

Definition at line 171 of file buffer_funcs.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_buffer_free()

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 979 of file buffer_funcs.h.

+ Here is the call graph for this function:

◆ vlib_buffer_free_from_ring()

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 1026 of file buffer_funcs.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_buffer_free_from_ring_no_next()

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 1051 of file buffer_funcs.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_buffer_free_inline()

static_always_inline void vlib_buffer_free_inline ( vlib_main_t vm,
u32 buffers,
u32  n_buffers,
int  maybe_next 
)

Definition at line 807 of file buffer_funcs.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_buffer_free_no_next()

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 996 of file buffer_funcs.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_buffer_free_one()

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 1012 of file buffer_funcs.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_buffer_get_current_pa()

static uword vlib_buffer_get_current_pa ( vlib_main_t vm,
vlib_buffer_t b 
)
inlinestatic

Definition at line 494 of file buffer_funcs.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_buffer_get_default_data_size()

static_always_inline u32 vlib_buffer_get_default_data_size ( vlib_main_t vm)

Definition at line 122 of file buffer_funcs.h.

+ Here is the caller graph for this function:

◆ vlib_buffer_get_pa()

static uword vlib_buffer_get_pa ( vlib_main_t vm,
vlib_buffer_t b 
)
inlinestatic

Definition at line 488 of file buffer_funcs.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_buffer_index_length_in_chain()

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 453 of file buffer_funcs.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_buffer_is_known()

static vlib_buffer_known_state_t vlib_buffer_is_known ( vlib_main_t vm,
u32  buffer_index 
)
inlinestatic

Definition at line 529 of file buffer_funcs.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_buffer_length_in_chain()

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 433 of file buffer_funcs.h.

+ Here is the call graph for this function:

◆ vlib_buffer_length_in_chain_slow_path()

uword vlib_buffer_length_in_chain_slow_path ( vlib_main_t vm,
vlib_buffer_t b_first 
)

Definition at line 78 of file buffer.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_buffer_move()

static void vlib_buffer_move ( vlib_main_t vm,
vlib_buffer_t b,
i16  offset 
)
inlinestatic

Definition at line 1163 of file buffer_funcs.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_buffer_pool_get()

static_always_inline __clib_warn_unused_result uword vlib_buffer_pool_get ( vlib_main_t vm,
u8  buffer_pool_index,
u32 buffers,
u32  n_buffers 
)

Definition at line 559 of file buffer_funcs.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_buffer_pool_get_default_for_numa()

static u8 vlib_buffer_pool_get_default_for_numa ( vlib_main_t vm,
u32  numa_node 
)
inlinestatic

Definition at line 189 of file buffer_funcs.h.

+ Here is the caller graph for this function:

◆ vlib_buffer_pool_put()

static_always_inline void vlib_buffer_pool_put ( vlib_main_t vm,
u8  buffer_pool_index,
u32 buffers,
u32  n_buffers 
)

Definition at line 770 of file buffer_funcs.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_buffer_ptr_from_index()

static void* vlib_buffer_ptr_from_index ( uword  buffer_mem_start,
u32  buffer_index,
uword  offset 
)
inlinestatic

Definition at line 97 of file buffer_funcs.h.

+ Here is the caller graph for this function:

◆ vlib_buffer_space_left_at_end()

static u32 vlib_buffer_space_left_at_end ( vlib_main_t vm,
vlib_buffer_t b 
)
inlinestatic

Definition at line 1462 of file buffer_funcs.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_buffer_validate()

static void vlib_buffer_validate ( vlib_main_t vm,
vlib_buffer_t b 
)
inlinestatic

Definition at line 81 of file buffer_funcs.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_buffer_validate_alloc_free()

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 315 of file buffer.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_get_buffer()

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 111 of file buffer_funcs.h.

+ Here is the call graph for this function:

◆ vlib_get_buffer_index()

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 324 of file buffer_funcs.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_get_buffer_indices()

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 404 of file buffer_funcs.h.

+ Here is the call graph for this function:

◆ vlib_get_buffer_indices_with_offset()

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 343 of file buffer_funcs.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_get_buffer_pool()

static_always_inline vlib_buffer_pool_t* vlib_get_buffer_pool ( vlib_main_t vm,
u8  buffer_pool_index 
)

Definition at line 552 of file buffer_funcs.h.

+ Here is the caller graph for this function:

◆ vlib_get_buffers()

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 311 of file buffer_funcs.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_get_buffers_with_offset()

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 204 of file buffer_funcs.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_get_next_buffer()

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 417 of file buffer_funcs.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_packet_template_free()

static void vlib_packet_template_free ( vlib_main_t vm,
vlib_packet_template_t t 
)
inlinestatic

Definition at line 1456 of file buffer_funcs.h.

◆ vlib_packet_template_get_packet()

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

Definition at line 377 of file buffer.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_packet_template_init()

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 355 of file buffer.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_validate_buffer()

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

Definition at line 254 of file buffer.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_validate_buffers()

u8* vlib_validate_buffers ( vlib_main_t vm,
u32 buffers,
uword  next_buffer_stride,
uword  n_buffers,
vlib_buffer_known_state_t  known_state,
uword  follow_buffer_next 
)

Definition at line 261 of file buffer.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ format_vlib_buffer

format_function_t format_vlib_buffer

Definition at line 1430 of file buffer_funcs.h.

◆ format_vlib_buffer_and_data

format_function_t format_vlib_buffer_and_data

Definition at line 1430 of file buffer_funcs.h.

◆ format_vlib_buffer_contents

format_function_t format_vlib_buffer_contents

Definition at line 1431 of file buffer_funcs.h.

◆ format_vlib_buffer_no_chain

format_function_t format_vlib_buffer_no_chain

Definition at line 1431 of file buffer_funcs.h.

◆ vlib_buffer_func_main

vlib_buffer_func_main_t vlib_buffer_func_main

Definition at line 419 of file buffer_funcs.c.

vlib_get_buffer
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
Definition: buffer_funcs.h:111
vm
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
Definition: nat44_ei.c:3047
VLIB_BUFFER_FLAGS_ALL
#define VLIB_BUFFER_FLAGS_ALL
Definition: buffer.h:99
type
vl_api_fib_path_type_t type
Definition: fib_types.api:123