FD.io VPP  v17.04.2-2-ga8f93f8
Vector Packet Processing
buffer.c File Reference

Allocate/free network buffers. More...

+ Include dependency graph for buffer.c:

Go to the source code of this file.

Functions

 STATIC_ASSERT (VLIB_BUFFER_PRE_DATA_SIZE==RTE_PKTMBUF_HEADROOM,"VLIB_BUFFER_PRE_DATA_SIZE must be equal to RTE_PKTMBUF_HEADROOM")
 
static_always_inline void dpdk_rte_pktmbuf_free (vlib_main_t *vm, vlib_buffer_t *b)
 
static void del_free_list (vlib_main_t *vm, vlib_buffer_free_list_t *f)
 
static void dpdk_buffer_delete_free_list (vlib_main_t *vm, u32 free_list_index)
 
static uword fill_free_list (vlib_main_t *vm, vlib_buffer_free_list_t *fl, uword min_free_buffers)
 
static u32 alloc_from_free_list (vlib_main_t *vm, vlib_buffer_free_list_t *free_list, u32 *alloc_buffers, u32 n_alloc_buffers)
 
u32 dpdk_buffer_alloc (vlib_main_t *vm, u32 *buffers, u32 n_buffers)
 
u32 dpdk_buffer_alloc_from_free_list (vlib_main_t *vm, u32 *buffers, u32 n_buffers, u32 free_list_index)
 
static_always_inline void vlib_buffer_free_inline (vlib_main_t *vm, u32 *buffers, u32 n_buffers, u32 follow_buffer_next)
 
static void dpdk_buffer_free (vlib_main_t *vm, u32 *buffers, u32 n_buffers)
 
static void dpdk_buffer_free_no_next (vlib_main_t *vm, u32 *buffers, u32 n_buffers)
 
static void dpdk_packet_template_init (vlib_main_t *vm, void *vt, void *packet_data, uword n_packet_data_bytes, uword min_n_buffers_each_physmem_alloc, u8 *name)
 
clib_error_tvlib_buffer_pool_create (vlib_main_t *vm, unsigned num_mbufs, unsigned socket_id)
 
static clib_error_tbuffer_state_validation_init (vlib_main_t *vm)
 
static clib_error_tdpdk_buffer_init (vlib_main_t *vm)
 

Variables

u32vlib_buffer_state_validation_lock
 
uwordvlib_buffer_state_validation_hash
 
void * vlib_buffer_state_heap
 
static vlib_buffer_callbacks_t callbacks
 

Detailed Description

Allocate/free network buffers.

Definition in file buffer.c.

Function Documentation

static u32 alloc_from_free_list ( vlib_main_t vm,
vlib_buffer_free_list_t free_list,
u32 alloc_buffers,
u32  n_alloc_buffers 
)
static

Definition at line 281 of file buffer.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static clib_error_t* buffer_state_validation_init ( vlib_main_t vm)
static

Definition at line 545 of file buffer.c.

+ Here is the call graph for this function:

static void del_free_list ( vlib_main_t vm,
vlib_buffer_free_list_t f 
)
static

Definition at line 111 of file buffer.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u32 dpdk_buffer_alloc ( vlib_main_t vm,
u32 buffers,
u32  n_buffers 
)

Definition at line 309 of file buffer.c.

+ Here is the call graph for this function:

u32 dpdk_buffer_alloc_from_free_list ( vlib_main_t vm,
u32 buffers,
u32  n_buffers,
u32  free_list_index 
)

Definition at line 322 of file buffer.c.

+ Here is the call graph for this function:

static void dpdk_buffer_delete_free_list ( vlib_main_t vm,
u32  free_list_index 
)
static

Definition at line 128 of file buffer.c.

+ Here is the call graph for this function:

static void dpdk_buffer_free ( vlib_main_t vm,
u32 buffers,
u32  n_buffers 
)
static

Definition at line 395 of file buffer.c.

+ Here is the call graph for this function:

static void dpdk_buffer_free_no_next ( vlib_main_t vm,
u32 buffers,
u32  n_buffers 
)
static

Definition at line 402 of file buffer.c.

+ Here is the call graph for this function:

static clib_error_t* dpdk_buffer_init ( vlib_main_t vm)
static

Definition at line 573 of file buffer.c.

+ Here is the call graph for this function:

static void dpdk_packet_template_init ( vlib_main_t vm,
void *  vt,
void *  packet_data,
uword  n_packet_data_bytes,
uword  min_n_buffers_each_physmem_alloc,
u8 name 
)
static

Definition at line 409 of file buffer.c.

+ Here is the call graph for this function:

static_always_inline void dpdk_rte_pktmbuf_free ( vlib_main_t vm,
vlib_buffer_t b 
)

Definition at line 83 of file buffer.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword fill_free_list ( vlib_main_t vm,
vlib_buffer_free_list_t fl,
uword  min_free_buffers 
)
static

Definition at line 165 of file buffer.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

STATIC_ASSERT ( VLIB_BUFFER_PRE_DATA_SIZE  = =RTE_PKTMBUF_HEADROOM,
"VLIB_BUFFER_PRE_DATA_SIZE must be equal to RTE_PKTMBUF_HEADROOM"   
)
static_always_inline void vlib_buffer_free_inline ( vlib_main_t vm,
u32 buffers,
u32  n_buffers,
u32  follow_buffer_next 
)

Definition at line 333 of file buffer.c.

+ Here is the call graph for this function:

clib_error_t* vlib_buffer_pool_create ( vlib_main_t vm,
unsigned  num_mbufs,
unsigned  socket_id 
)

Definition at line 426 of file buffer.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

vlib_buffer_callbacks_t callbacks
static
Initial value:
= {
.vlib_buffer_alloc_cb = &dpdk_buffer_alloc,
.vlib_buffer_alloc_from_free_list_cb = &dpdk_buffer_alloc_from_free_list,
.vlib_buffer_free_cb = &dpdk_buffer_free,
.vlib_buffer_free_no_next_cb = &dpdk_buffer_free_no_next,
.vlib_packet_template_init_cb = &dpdk_packet_template_init,
.vlib_buffer_delete_free_list_cb = &dpdk_buffer_delete_free_list,
}
u32 dpdk_buffer_alloc_from_free_list(vlib_main_t *vm, u32 *buffers, u32 n_buffers, u32 free_list_index)
Definition: buffer.c:322
u32 dpdk_buffer_alloc(vlib_main_t *vm, u32 *buffers, u32 n_buffers)
Definition: buffer.c:309
static void dpdk_buffer_delete_free_list(vlib_main_t *vm, u32 free_list_index)
Definition: buffer.c:128
static void dpdk_packet_template_init(vlib_main_t *vm, void *vt, void *packet_data, uword n_packet_data_bytes, uword min_n_buffers_each_physmem_alloc, u8 *name)
Definition: buffer.c:409
static void dpdk_buffer_free_no_next(vlib_main_t *vm, u32 *buffers, u32 n_buffers)
Definition: buffer.c:402
static void dpdk_buffer_free(vlib_main_t *vm, u32 *buffers, u32 n_buffers)
Definition: buffer.c:395

Definition at line 563 of file buffer.c.

void* vlib_buffer_state_heap

Definition at line 542 of file buffer.c.

uword* vlib_buffer_state_validation_hash

Definition at line 541 of file buffer.c.

u32* vlib_buffer_state_validation_lock

Definition at line 540 of file buffer.c.