FD.io VPP  v17.10-9-gd594711
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

uword vlib_buffer_length_in_chain_slow_path (vlib_main_t *vm, vlib_buffer_t *b_first)
 
u8format_vlib_buffer (u8 *s, va_list *args)
 
u8format_vlib_buffer_and_data (u8 *s, va_list *args)
 
static u8format_vlib_buffer_known_state (u8 *s, va_list *args)
 
u8format_vlib_buffer_contents (u8 *s, va_list *va)
 
static u8vlib_validate_buffer_helper (vlib_main_t *vm, u32 bi, uword follow_buffer_next, uword **unique_hash)
 
u8vlib_validate_buffer (vlib_main_t *vm, u32 bi, uword follow_buffer_next)
 
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 void vlib_buffer_validate_alloc_free (vlib_main_t *vm, u32 *buffers, uword n_buffers, vlib_buffer_known_state_t expected_state)
 
void vlib_buffer_merge_free_lists (vlib_buffer_free_list_t *dst, vlib_buffer_free_list_t *src)
 
static u32 vlib_buffer_create_free_list_helper (vlib_main_t *vm, u32 n_data_bytes, u32 is_public, u32 is_default, u8 *name)
 
u32 vlib_buffer_create_free_list (vlib_main_t *vm, u32 n_data_bytes, char *fmt,...)
 
u32 vlib_buffer_get_or_create_free_list (vlib_main_t *vm, u32 n_data_bytes, char *fmt,...)
 
static void del_free_list (vlib_main_t *vm, vlib_buffer_free_list_t *f)
 
void vlib_buffer_delete_free_list_internal (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)
 
static u32 vlib_buffer_alloc_internal (vlib_main_t *vm, u32 *buffers, u32 n_buffers)
 
static u32 vlib_buffer_alloc_from_free_list_internal (vlib_main_t *vm, u32 *buffers, u32 n_buffers, u32 free_list_index)
 
void * vlib_set_buffer_free_callback (vlib_main_t *vm, void *fp)
 
static_always_inline void vlib_buffer_free_inline (vlib_main_t *vm, u32 *buffers, u32 n_buffers, u32 follow_buffer_next)
 
static void vlib_buffer_free_internal (vlib_main_t *vm, u32 *buffers, u32 n_buffers)
 
static void vlib_buffer_free_no_next_internal (vlib_main_t *vm, u32 *buffers, u32 n_buffers)
 
static void vlib_packet_template_buffer_init (vlib_main_t *vm, vlib_buffer_free_list_t *fl, u32 *buffers, u32 n_buffers)
 
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_physmem_alloc, char *fmt,...)
 
void * vlib_packet_template_get_packet (vlib_main_t *vm, vlib_packet_template_t *t, u32 *bi_result)
 
void vlib_packet_template_get_packet_helper (vlib_main_t *vm, vlib_packet_template_t *t)
 
u32 vlib_buffer_add_data (vlib_main_t *vm, u32 free_list_index, u32 buffer_index, void *data, u32 n_data_bytes)
 
u16 vlib_buffer_chain_append_data_with_alloc (vlib_main_t *vm, u32 free_list_index, vlib_buffer_t *first, vlib_buffer_t **last, void *data, u16 data_len)
 
void vlib_buffer_add_mem_range (vlib_main_t *vm, uword start, uword size)
 
static u8format_vlib_buffer_free_list (u8 *s, va_list *va)
 
static clib_error_tshow_buffers (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
clib_error_tvlib_buffer_main_init (struct vlib_main_t *vm)
 
static clib_error_tvlib_buffers_configure (vlib_main_t *vm, unformat_input_t *input)
 

Variables

vlib_buffer_callbacks_tvlib_buffer_callbacks = 0
 
static u32 vlib_buffer_physmem_sz = 32 << 20
 
vlib_main_t ** vlib_mains = &__bootstrap_vlib_main_vector.vm
 
static vlib_cli_command_t show_buffers_command
 (constructor) VLIB_CLI_COMMAND (show_buffers_command) More...
 

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void del_free_list ( vlib_main_t vm,
vlib_buffer_free_list_t f 
)
static

Definition at line 460 of file buffer.c.

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8* format_vlib_buffer ( u8 s,
va_list *  args 
)

Definition at line 70 of file buffer.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8* format_vlib_buffer_and_data ( u8 s,
va_list *  args 
)

Definition at line 102 of file buffer.c.

+ Here is the call graph for this function:

u8* format_vlib_buffer_contents ( u8 s,
va_list *  va 
)

Definition at line 142 of file buffer.c.

+ Here is the call graph for this function:

static u8* format_vlib_buffer_free_list ( u8 s,
va_list *  va 
)
static

Definition at line 995 of file buffer.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u8* format_vlib_buffer_known_state ( u8 s,
va_list *  args 
)
static

Definition at line 114 of file buffer.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static clib_error_t* show_buffers ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 1020 of file buffer.c.

+ Here is the call graph for this function:

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

Definition at line 872 of file buffer.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void vlib_buffer_add_mem_range ( vlib_main_t vm,
uword  start,
uword  size 
)

Definition at line 964 of file buffer.c.

+ Here is the caller graph for this function:

static u32 vlib_buffer_alloc_from_free_list_internal ( vlib_main_t vm,
u32 buffers,
u32  n_buffers,
u32  free_list_index 
)
static

Definition at line 644 of file buffer.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u32 vlib_buffer_alloc_internal ( vlib_main_t vm,
u32 buffers,
u32  n_buffers 
)
static

Definition at line 632 of file buffer.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 929 of file buffer.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 419 of file buffer.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u32 vlib_buffer_create_free_list_helper ( vlib_main_t vm,
u32  n_data_bytes,
u32  is_public,
u32  is_default,
u8 name 
)
static

Definition at line 351 of file buffer.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void vlib_buffer_delete_free_list_internal ( vlib_main_t vm,
u32  free_list_index 
)

Definition at line 474 of file buffer.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static_always_inline void vlib_buffer_free_inline ( vlib_main_t vm,
u32 buffers,
u32  n_buffers,
u32  follow_buffer_next 
)

Definition at line 665 of file buffer.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 749 of file buffer.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 756 of file buffer.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u32 vlib_buffer_get_or_create_free_list ( vlib_main_t vm,
u32  n_data_bytes,
char *  fmt,
  ... 
)

Definition at line 436 of file buffer.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uword vlib_buffer_length_in_chain_slow_path ( vlib_main_t vm,
vlib_buffer_t b_first 
)

Definition at line 53 of file buffer.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

clib_error_t* vlib_buffer_main_init ( struct vlib_main_t vm)

Definition at line 1057 of file buffer.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void vlib_buffer_merge_free_lists ( vlib_buffer_free_list_t dst,
vlib_buffer_free_list_t src 
)

Definition at line 334 of file buffer.c.

+ Here is the caller graph for this function:

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

Definition at line 298 of file buffer.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static clib_error_t* vlib_buffers_configure ( vlib_main_t vm,
unformat_input_t input 
)
static

Definition at line 1108 of file buffer.c.

+ Here is the call graph for this function:

static void vlib_packet_template_buffer_init ( vlib_main_t vm,
vlib_buffer_free_list_t fl,
u32 buffers,
u32  n_buffers 
)
static

Definition at line 765 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 ( vlib_main_t vm,
vlib_packet_template_t t,
u32 bi_result 
)

Definition at line 834 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 854 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_physmem_alloc,
char *  fmt,
  ... 
)

Definition at line 784 of file buffer.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void* vlib_set_buffer_free_callback ( vlib_main_t vm,
void *  fp 
)

Definition at line 655 of file buffer.c.

u8* vlib_validate_buffer ( vlib_main_t vm,
u32  bi,
uword  follow_buffer_next 
)

Definition at line 214 of file buffer.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u8* vlib_validate_buffer_helper ( vlib_main_t vm,
u32  bi,
uword  follow_buffer_next,
uword **  unique_hash 
)
static

Definition at line 159 of file buffer.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

+ Here is the call graph for this function:

Variable Documentation

Definition at line 282 of file buffer.c.

vlib_cli_command_t show_buffers_command
static
Initial value:
= {
.path = "show buffers",
.short_help = "Show packet buffer allocation",
.function = show_buffers,
}
static clib_error_t * show_buffers(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: buffer.c:1020

(constructor) VLIB_CLI_COMMAND (show_buffers_command)

Definition at line 1049 of file buffer.c.

vlib_buffer_callbacks_t* vlib_buffer_callbacks = 0

Definition at line 49 of file buffer.c.

u32 vlib_buffer_physmem_sz = 32 << 20
static

Definition at line 50 of file buffer.c.

Definition at line 292 of file buffer.c.

Definition at line 283 of file buffer.c.