FD.io VPP  v16.06
Vector Packet Processing
memory_vlib.c File Reference
+ Include dependency graph for memory_vlib.c:

Go to the source code of this file.

Macros

#define TRACE_VLIB_MEMORY_QUEUE   0
 
#define vl_typedefs   /* define message structures */
 
#define vl_print(handle, ...)   vlib_cli_output (handle, __VA_ARGS__)
 
#define vl_printfun
 
#define vl_endianfun
 
#define foreach_vlib_api_msg
 
#define foreach_histogram_bucket
 
#define foreach_rpc_api_msg
 

Enumerations

enum  histogram_index_t { SLEEP_N_BUCKETS }
 

Functions

static voidvl_api_memclnt_create_t_print (vl_api_memclnt_create_t *a, void *handle)
 
static voidvl_api_memclnt_delete_t_print (vl_api_memclnt_delete_t *a, void *handle)
 
void vl_socket_api_send (vl_api_registration_t *rp, u8 *elem)
 
void vl_msg_api_send (vl_api_registration_t *rp, u8 *elem)
 
int vl_msg_api_version_check (vl_api_memclnt_create_t *mp)
 
void vl_api_memclnt_create_t_handler (vl_api_memclnt_create_t *mp)
 
int vl_api_memclnt_delete_callback (u32 client_index)
 
void vl_api_memclnt_delete_t_handler (vl_api_memclnt_delete_t *mp)
 
void vl_api_get_first_msg_id_t_handler (vl_api_get_first_msg_id_t *mp)
 
static int memory_api_init (char *region_name)
 
static void memclnt_queue_callback (vlib_main_t *vm)
 
static uword memclnt_process (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *f)
 
static clib_error_tvl_api_show_histogram_command (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cli_cmd)
 
static clib_error_tvl_api_clear_histogram_command (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cli_cmd)
 
void vl_enable_disable_memory_api (vlib_main_t *vm, int enable)
 
static uword api_rx_from_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
static clib_error_tsetup_memclnt_exit (vlib_main_t *vm)
 
static clib_error_tvl_api_ring_command (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cli_cmd)
 
void dump_socket_clients (vlib_main_t *vm, api_main_t *am)
 
static clib_error_tvl_api_client_command (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cli_cmd)
 
static clib_error_tvl_api_message_table_command (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cli_cmd)
 
void vl_api_trace_print_file_cmd (vlib_main_t *vm, u32 first, u32 last, u8 *filename)
 
static clib_error_tvl_api_trace_command (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cli_cmd)
 
clib_error_tvlibmemory_init (vlib_main_t *vm)
 
void vl_set_memory_region_name (char *name)
 
static int range_compare (vl_api_msg_range_t *a0, vl_api_msg_range_t *a1)
 
static u8format_api_msg_range (u8 *s, va_list *args)
 
static clib_error_tvl_api_show_plugin_command (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cli_cmd)
 
static void vl_api_rpc_call_t_handler (vl_api_rpc_call_t *mp)
 
static void vl_api_rpc_reply_t_handler (vl_api_rpc_reply_t *mp)
 
void vl_api_rpc_call_main_thread (void *fp, u8 *data, u32 data_length)
 
static clib_error_trpc_api_hookup (vlib_main_t *vm)
 
 VLIB_API_INIT_FUNCTION (rpc_api_hookup)
 

Variables

static u64 vector_rate_histogram [SLEEP_N_BUCKETS]
 
vlib_cli_command_t cli_show_api_histogram_command
 (constructor) VLIB_CLI_COMMAND (cli_show_api_histogram_command) More...
 
vlib_cli_command_t cli_clear_api_histogram_command
 (constructor) VLIB_CLI_COMMAND (cli_clear_api_histogram_command) More...
 
vlib_node_registration_t memclnt_node
 (constructor) VLIB_REGISTER_NODE (memclnt_node) More...
 
vlib_node_registration_t api_rx_from_node_node
 (constructor) VLIB_REGISTER_NODE (api_rx_from_node_node) More...
 
vlib_cli_command_t cli_show_api_command
 (constructor) VLIB_CLI_COMMAND (cli_show_api_command) More...
 
vlib_cli_command_t cli_show_api_ring_command
 (constructor) VLIB_CLI_COMMAND (cli_show_api_ring_command) More...
 
vlib_cli_command_t cli_show_api_clients_command
 (constructor) VLIB_CLI_COMMAND (cli_show_api_clients_command) More...
 
vlib_cli_command_t cli_show_api_message_table_command
 (constructor) VLIB_CLI_COMMAND (cli_show_api_message_table_command) More...
 
vlib_cli_command_t trace
 (constructor) VLIB_CLI_COMMAND (trace) More...
 
vlib_cli_command_t cli_show_api_plugin_command
 (constructor) VLIB_CLI_COMMAND (cli_show_api_plugin_command) More...
 

Macro Definition Documentation

#define foreach_histogram_bucket
Value:
_(400) \
_(200) \
_(100) \
_(10)

Definition at line 331 of file memory_vlib.c.

#define foreach_rpc_api_msg
Value:
_(RPC_CALL,rpc_call) \
_(RPC_REPLY,rpc_reply)

Definition at line 1190 of file memory_vlib.c.

#define foreach_vlib_api_msg
Value:
_(MEMCLNT_CREATE, memclnt_create) \
_(MEMCLNT_DELETE, memclnt_delete) \
_(GET_FIRST_MSG_ID, get_first_msg_id)

Definition at line 296 of file memory_vlib.c.

#define TRACE_VLIB_MEMORY_QUEUE   0

Definition at line 39 of file memory_vlib.c.

#define vl_endianfun

Definition at line 74 of file memory_vlib.c.

#define vl_print (   handle,
  ... 
)    vlib_cli_output (handle, __VA_ARGS__)

Definition at line 48 of file memory_vlib.c.

#define vl_printfun

Definition at line 49 of file memory_vlib.c.

#define vl_typedefs   /* define message structures */

Definition at line 43 of file memory_vlib.c.

Enumeration Type Documentation

Enumerator
SLEEP_N_BUCKETS 

Definition at line 337 of file memory_vlib.c.

Function Documentation

static uword api_rx_from_node ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)
static

Definition at line 660 of file memory_vlib.c.

+ Here is the call graph for this function:

void dump_socket_clients ( vlib_main_t vm,
api_main_t am 
)

Definition at line 772 of file memory_vlib.c.

+ Here is the caller graph for this function:

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

Definition at line 1080 of file memory_vlib.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword memclnt_process ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t f 
)
static

Definition at line 349 of file memory_vlib.c.

+ Here is the call graph for this function:

static void memclnt_queue_callback ( vlib_main_t vm)
static

Definition at line 623 of file memory_vlib.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int memory_api_init ( char *  region_name)
static

Definition at line 304 of file memory_vlib.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int range_compare ( vl_api_msg_range_t a0,
vl_api_msg_range_t a1 
)
static

Definition at line 1070 of file memory_vlib.c.

+ Here is the caller graph for this function:

static clib_error_t* rpc_api_hookup ( vlib_main_t vm)
static

Definition at line 1195 of file memory_vlib.c.

+ Here is the call graph for this function:

static clib_error_t* setup_memclnt_exit ( vlib_main_t vm)
static

Definition at line 715 of file memory_vlib.c.

+ Here is the call graph for this function:

static clib_error_t* vl_api_clear_histogram_command ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cli_cmd 
)
static

Definition at line 597 of file memory_vlib.c.

static clib_error_t* vl_api_client_command ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cli_cmd 
)
static

Definition at line 777 of file memory_vlib.c.

+ Here is the call graph for this function:

void vl_api_get_first_msg_id_t_handler ( vl_api_get_first_msg_id_t mp)

Definition at line 257 of file memory_vlib.c.

+ Here is the call graph for this function:

void vl_api_memclnt_create_t_handler ( vl_api_memclnt_create_t mp)

Definition at line 107 of file memory_vlib.c.

+ Here is the call graph for this function:

static void* vl_api_memclnt_create_t_print ( vl_api_memclnt_create_t a,
void handle 
)
inlinestatic

Definition at line 54 of file memory_vlib.c.

int vl_api_memclnt_delete_callback ( u32  client_index)

Definition at line 185 of file memory_vlib.c.

+ Here is the caller graph for this function:

void vl_api_memclnt_delete_t_handler ( vl_api_memclnt_delete_t mp)

Definition at line 191 of file memory_vlib.c.

+ Here is the call graph for this function:

static void* vl_api_memclnt_delete_t_print ( vl_api_memclnt_delete_t a,
void handle 
)
inlinestatic

Definition at line 65 of file memory_vlib.c.

static clib_error_t* vl_api_message_table_command ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cli_cmd 
)
static

Definition at line 850 of file memory_vlib.c.

+ Here is the call graph for this function:

static clib_error_t* vl_api_ring_command ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cli_cmd 
)
static

Definition at line 725 of file memory_vlib.c.

+ Here is the call graph for this function:

void vl_api_rpc_call_main_thread ( void fp,
u8 data,
u32  data_length 
)

Definition at line 1173 of file memory_vlib.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void vl_api_rpc_call_t_handler ( vl_api_rpc_call_t mp)
static

Definition at line 1126 of file memory_vlib.c.

+ Here is the call graph for this function:

static void vl_api_rpc_reply_t_handler ( vl_api_rpc_reply_t mp)
static

Definition at line 1170 of file memory_vlib.c.

static clib_error_t* vl_api_show_histogram_command ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cli_cmd 
)
static

Definition at line 558 of file memory_vlib.c.

+ Here is the call graph for this function:

static clib_error_t* vl_api_show_plugin_command ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cli_cmd 
)
static

Definition at line 1094 of file memory_vlib.c.

+ Here is the call graph for this function:

static clib_error_t* vl_api_trace_command ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cli_cmd 
)
static

Definition at line 984 of file memory_vlib.c.

+ Here is the call graph for this function:

void vl_api_trace_print_file_cmd ( vlib_main_t vm,
u32  first,
u32  last,
u8 filename 
)

Definition at line 890 of file memory_vlib.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void vl_enable_disable_memory_api ( vlib_main_t vm,
int  enable 
)

Definition at line 651 of file memory_vlib.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void vl_msg_api_send ( vl_api_registration_t rp,
u8 elem 
)

Definition at line 90 of file memory_vlib.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int vl_msg_api_version_check ( vl_api_memclnt_create_t mp)

Definition at line 102 of file memory_vlib.c.

+ Here is the caller graph for this function:

void vl_set_memory_region_name ( char *  name)

Definition at line 1063 of file memory_vlib.c.

+ Here is the caller graph for this function:

void vl_socket_api_send ( vl_api_registration_t rp,
u8 elem 
)

Definition at line 82 of file memory_vlib.c.

+ Here is the caller graph for this function:

VLIB_API_INIT_FUNCTION ( rpc_api_hookup  )

+ Here is the caller graph for this function:

clib_error_t* vlibmemory_init ( vlib_main_t vm)

Definition at line 1053 of file memory_vlib.c.

+ Here is the call graph for this function:

Variable Documentation

vlib_node_registration_t api_rx_from_node_node
Initial value:
= {
.function = api_rx_from_node,
.vector_size = 4,
.name = "api-rx-from-node",
}
static uword api_rx_from_node(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: memory_vlib.c:660

(constructor) VLIB_REGISTER_NODE (api_rx_from_node_node)

Definition at line 707 of file memory_vlib.c.

vlib_cli_command_t cli_clear_api_histogram_command
Initial value:
= {
.path = "clear api histogram",
.short_help = "clear api histogram",
}
static clib_error_t * vl_api_clear_histogram_command(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cli_cmd)
Definition: memory_vlib.c:597

(constructor) VLIB_CLI_COMMAND (cli_clear_api_histogram_command)

Definition at line 608 of file memory_vlib.c.

vlib_cli_command_t cli_show_api_clients_command
Initial value:
= {
.path = "show api clients",
.short_help = "Client information",
.function = vl_api_client_command,
}
static clib_error_t * vl_api_client_command(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cli_cmd)
Definition: memory_vlib.c:777

(constructor) VLIB_CLI_COMMAND (cli_show_api_clients_command)

Definition at line 843 of file memory_vlib.c.

vlib_cli_command_t cli_show_api_command
Initial value:
= {
.path = "show api",
.short_help = "Show API information",
}

(constructor) VLIB_CLI_COMMAND (cli_show_api_command)

Definition at line 832 of file memory_vlib.c.

vlib_cli_command_t cli_show_api_histogram_command
Initial value:
= {
.path = "show api histogram",
.short_help = "show api histogram",
}
static clib_error_t * vl_api_show_histogram_command(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cli_cmd)
Definition: memory_vlib.c:558

(constructor) VLIB_CLI_COMMAND (cli_show_api_histogram_command)

Definition at line 590 of file memory_vlib.c.

vlib_cli_command_t cli_show_api_message_table_command
Initial value:
= {
.path = "show api message-table",
.short_help = "Message Table",
}
static clib_error_t * vl_api_message_table_command(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cli_cmd)
Definition: memory_vlib.c:850

(constructor) VLIB_CLI_COMMAND (cli_show_api_message_table_command)

Definition at line 884 of file memory_vlib.c.

vlib_cli_command_t cli_show_api_plugin_command
Initial value:
= {
.path = "show api plugin",
.short_help = "show api plugin",
}
static clib_error_t * vl_api_show_plugin_command(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cli_cmd)
Definition: memory_vlib.c:1094

(constructor) VLIB_CLI_COMMAND (cli_show_api_plugin_command)

Definition at line 1120 of file memory_vlib.c.

vlib_cli_command_t cli_show_api_ring_command
Initial value:
= {
.path = "show api ring-stats",
.short_help = "Message ring statistics",
.function = vl_api_ring_command,
}
static clib_error_t * vl_api_ring_command(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cli_cmd)
Definition: memory_vlib.c:725

(constructor) VLIB_CLI_COMMAND (cli_show_api_ring_command)

Definition at line 837 of file memory_vlib.c.

Initial value:
= {
.function = memclnt_process,
.name = "api-rx-from-ring",
.state = VLIB_NODE_STATE_DISABLED,
}
static uword memclnt_process(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *f)
Definition: memory_vlib.c:349

(constructor) VLIB_REGISTER_NODE (memclnt_node)

Definition at line 615 of file memory_vlib.c.

Initial value:
= {
.path = "set api-trace",
.short_help = "API trace",
.function = vl_api_trace_command,
}
static clib_error_t * vl_api_trace_command(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cli_cmd)
Definition: memory_vlib.c:984

(constructor) VLIB_CLI_COMMAND (trace)

Definition at line 1046 of file memory_vlib.c.

u64 vector_rate_histogram[SLEEP_N_BUCKETS]
static

Definition at line 344 of file memory_vlib.c.