24 #include <sys/types.h> 41 #define TRACE_VLIB_MEMORY_QUEUE 0 50 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 58 vl_print (handle,
"vl_api_memclnt_create_t:\n");
69 vl_print (handle,
"vl_api_memclnt_delete_t:\n");
79 vl_print (handle,
"vl_api_trace_plugin_msg_ids: %s first %u last %u\n",
92 __attribute__ ((weak));
100 clib_warning (
"need to link against -lvlibsocket, msg not sent!");
131 serialize_likely_small_unsigned_integer (sm, hp->value[0]);
132 serialize_cstring (sm, (char *) hp->key);
153 u8 *serialized_message_table = 0;
188 pthread_mutex_lock (&svm->
mutex);
193 memset (regp, 0,
sizeof (*regp));
202 if (serialized_message_table)
204 vec_dup (serialized_message_table);
206 pthread_mutex_unlock (&svm->
mutex);
209 vec_free (serialized_message_table);
212 rp->_vl_msg_id = ntohs (VL_API_MEMCLNT_CREATE_REPLY);
228 _vl_msg_api_function_list_elt_t *
i;
233 error = i->f (client_index);
236 i = i->next_init_function;
253 u32 handle, client_index, epoch;
266 (
"Stale clnt delete index %d old epoch %d cur epoch %d",
282 rp->_vl_msg_id = ntohs (VL_API_MEMCLNT_DELETE_REPLY);
301 pthread_mutex_lock (&svm->
mutex);
304 memset (regp, 0xF1,
sizeof (*regp));
306 pthread_mutex_unlock (&svm->
mutex);
324 u16 first_msg_id = ~0;
334 strncpy ((
char *) name, (
char *) mp->
name,
ARRAY_LEN (name) - 1);
348 rmp->_vl_msg_id = ntohs (VL_API_GET_FIRST_MSG_ID_REPLY);
355 #define foreach_vlib_api_msg \ 356 _(MEMCLNT_CREATE, memclnt_create) \ 357 _(MEMCLNT_DELETE, memclnt_delete) \ 358 _(GET_FIRST_MSG_ID, get_first_msg_id) 370 memset (c, 0,
sizeof (*c));
375 #define _(N,n) do { \ 376 c->id = VL_API_##N; \ 378 c->handler = vl_api_##n##_t_handler; \ 379 c->cleanup = vl_noop_handler; \ 380 c->endian = vl_api_##n##_t_endian; \ 381 c->print = vl_api_##n##_t_print; \ 382 c->size = sizeof(vl_api_##n##_t); \ 385 c->message_bounce = 0; \ 386 vl_msg_api_config(c);} while (0); 394 #define foreach_histogram_bucket \ 402 #define _(n) SLEEP_##n##_US, 424 memset (mp, 0,
sizeof (*mp));
426 mp->_vl_msg_id = clib_host_to_net_u16 (VL_API_TRACE_PLUGIN_MSG_IDS);
430 mp->
last_msg_id = clib_host_to_net_u16 (last_msg_id);
447 f64 dead_client_scan_time;
448 f64 sleep_time, start_time;
456 clib_warning (
"memory_api_init returned %d, wait for godot...", rv);
486 uword event_type __attribute__ ((unused));
504 pthread_mutex_lock (&q->mutex);
508 pthread_mutex_unlock (&q->mutex);
515 .format =
"q-underflow: len %d",
530 headp = (
i8 *) (q->data + sizeof (
uword) * q->head);
534 need_broadcast = (q->cursize == q->maxsize / 2);
539 pthread_mutex_unlock (&q->mutex);
541 (void) pthread_cond_broadcast (&q->condvar);
548 int index = SLEEP_400_US;
549 if (vector_rate > 40.0)
551 else if (vector_rate > 20.0)
553 index = SLEEP_200_US;
556 else if (vector_rate >= 1.0)
558 index = SLEEP_100_US;
566 vector_rate_histogram[index] += 1;
580 static u32 *dead_indices;
581 static u32 *confused_indices;
592 q = regp->vl_input_queue;
593 if (kill (q->consumer_pid, 0) < 0)
595 vec_add1(dead_indices, regpp - am->vl_clients);
600 clib_warning (
"NULL client registration index %d",
601 regpp - am->vl_clients);
602 vec_add1 (confused_indices, regpp - am->vl_clients);
610 for (i = 0; i <
vec_len (confused_indices); i++)
623 for (i = 0; i <
vec_len (dead_indices); i++)
637 pthread_mutex_lock (&svm->
mutex);
640 for (i = 0; i <
vec_len (dead_indices); i++)
646 memset (*regpp, 0xF3,
sizeof (**regpp));
662 pthread_mutex_unlock (&svm->
mutex);
664 for (i = 0; i <
vec_len (dead_indices); i++)
675 .format =
"q-awake: len %d",
684 ed->len = q->cursize;
696 u64 total_counts = 0;
704 if (total_counts == 0)
713 percent = ((f64) vector_rate_histogram[SLEEP_##n##_US]) \ 714 / (f64) total_counts; \ 716 vlib_cli_output (vm, "Sleep %3d us: %llu, %.2f%%",n, \ 717 vector_rate_histogram[SLEEP_##n##_US], \ 728 .path =
"show api histogram",
729 .short_help =
"show api histogram",
748 .path =
"clear api histogram",
749 .short_help =
"clear api histogram",
759 .name =
"api-rx-from-ring",
760 .state = VLIB_NODE_STATE_DISABLED,
767 static volatile int *cursizep;
781 cursizep = &q->cursize;
798 ? VLIB_NODE_STATE_POLLING
799 : VLIB_NODE_STATE_DISABLED));
815 while (n_left_from > 0)
832 _vec_len (long_msg) = 0;
833 vec_add (long_msg, msg, msg_len);
839 vec_add (long_msg, msg, msg_len);
857 .name =
"api-rx-from-node",
889 "Owner",
"Size",
"Nitems",
"Hits",
"Misses");
913 (vm,
"%d application restarts, %d reclaimed msgs, %d garbage collects\n",
920 __attribute__ ((weak));
935 u32 *confused_indices = 0;
941 "Name",
"PID",
"Queue Length",
"Queue VA",
"Health");
950 q = regp->vl_input_queue;
951 if (kill (q->consumer_pid, 0) < 0)
959 vlib_cli_output (vm,
"%16s %8d %14d 0x%016llx %s\n",
960 regp->name, q->consumer_pid, q->cursize,
965 clib_warning (
"NULL client registration index %d",
966 regpp - am->vl_clients);
967 vec_add1 (confused_indices, regpp - am->vl_clients);
976 for (i = 0; i <
vec_len (confused_indices); i++)
1030 .short_help =
"Show API information",
1036 .path =
"show api ring-stats",
1037 .short_help =
"Message ring statistics",
1044 .path =
"show api clients",
1045 .short_help =
"Client information",
1052 .path =
"show api status",
1053 .short_help =
"Show API trace status",
1099 .path =
"show api message-table",
1100 .short_help =
"Message Table",
1117 else if (
unformat (input,
"tx nitems %u", &nitems)
1123 else if (
unformat (input,
"on rx"))
1127 else if (
unformat (input,
"on tx"))
1147 else if (
unformat (input,
"debug on"))
1151 else if (
unformat (input,
"debug off"))
1173 .path =
"set api-trace",
1174 .short_help =
"API trace",
1185 memset (a, 0,
sizeof (*a));
1215 int len0, len1, clen;
1219 clen = len0 < len1 ? len0 : len1;
1220 return (strncmp ((
char *) a0->
name, (
char *) a1->
name, clen));
1229 s =
format (s,
"%-20s%9s%9s",
"Name",
"First-ID",
"Last-ID");
1259 for (i = 0; i <
vec_len (rp); i++)
1269 .path =
"show api plugin",
1270 .short_help =
"show api plugin",
1308 rmp->_vl_msg_id = ntohs (VL_API_RPC_REPLY);
1338 void (*call_fp) (
void *);
1352 memset (mp, 0,
sizeof (*mp));
1354 mp->_vl_msg_id = ntohs (VL_API_RPC_CALL);
1365 while (pthread_mutex_trylock (&q->mutex))
1370 pthread_mutex_unlock (&q->mutex);
1372 while (pthread_mutex_trylock (&q->mutex))
1378 pthread_mutex_unlock (&q->mutex);
1395 clib_warning (
"WARNING: traced plugin '%s' not in current image",
1403 clib_warning (
"WARNING: traced plugin '%s' first message id %d not %d",
1410 clib_warning (
"WARNING: traced plugin '%s' last message id %d not %d",
1416 #define foreach_rpc_api_msg \ 1417 _(RPC_CALL,rpc_call) \ 1418 _(RPC_REPLY,rpc_reply) 1420 #define foreach_plugin_trace_msg \ 1421 _(TRACE_PLUGIN_MSG_IDS,trace_plugin_msg_ids) 1427 vl_msg_api_set_handlers(VL_API_##N, #n, \ 1428 vl_api_##n##_t_handler, \ 1431 vl_api_##n##_t_print, \ 1432 sizeof(vl_api_##n##_t), 0 ); 1437 vl_msg_api_set_handlers(VL_API_##N, #n, \ 1438 vl_api_##n##_t_handler, \ 1441 vl_api_##n##_t_print, \ 1442 sizeof(vl_api_##n##_t), 1 ); 1470 trace_name =
"TX trace";
1475 trace_name =
"RX trace";
1484 s =
format (s,
"%s: not yet configured.\n", trace_name);
1488 s =
format (s,
"%s: used %d of %d items, %s enabled, %s wrapped\n",
1495 __attribute__ ((weak));
1503 u32 first_index,
u32 last_index,
1504 vl_api_replay_t which)
1506 vl_api_trace_file_header_t *hp;
1511 u8 endian_swap_needed = 0;
1515 void **saved_print_handlers = 0;
1517 fd = open ((
char *) filename, O_RDONLY);
1525 if (fstat (fd, &statb) < 0)
1532 if (!(statb.st_mode & S_IFREG) || (statb.st_size < sizeof (*hp)))
1539 file_size = statb.st_size;
1540 file_size = (file_size + 4095) & ~(4096);
1542 hp = mmap (0, file_size, PROT_READ, MAP_PRIVATE, fd, 0);
1544 if (hp == (vl_api_trace_file_header_t *) MAP_FAILED)
1554 endian_swap_needed = 1;
1556 if (endian_swap_needed)
1557 nitems = ntohl (hp->nitems);
1559 nitems = hp->nitems;
1561 if (last_index == (
u32) ~ 0)
1563 last_index = nitems - 1;
1566 if (first_index >= nitems || last_index >= nitems)
1569 first_index, last_index, nitems - 1);
1570 munmap (hp, file_size);
1575 "Note: wrapped/incomplete trace, results may vary\n");
1584 msg = (
u8 *) (hp + 1);
1586 for (i = 0; i < first_index; i++)
1592 size = clib_host_to_net_u32 (*(
u32 *) msg);
1593 msg +=
sizeof (
u32);
1596 msg_id = ntohs (*((
u16 *) msg));
1598 msg_id = *((
u16 *) msg);
1604 munmap (hp, file_size);
1613 for (; i <= last_index; i++)
1623 size = clib_host_to_net_u32 (*(
u32 *) msg);
1624 msg +=
sizeof (
u32);
1627 msg_id = ntohs (*((
u16 *) msg));
1629 msg_id = *((
u16 *) msg);
1635 munmap (hp, file_size);
1644 memset (tmpbuf, 0xf,
sizeof (
uword));
1654 void (*endian_fp) (
void *);
1659 munmap (hp, file_size);
1665 (*endian_fp) (tmpbuf +
sizeof (
uword));
1671 msg_idp = (
u16 *) (tmpbuf +
sizeof (
uword));
1682 u8 *(*print_fp) (
void *,
void *);
1685 (*print_fp) (tmpbuf +
sizeof (
uword), vm);
1701 u8 *(*print_fp) (
void *,
void *);
1707 (*print_fp) (tmpbuf +
sizeof (
uword), vm);
1710 s =
format (0,
"static u8 * vl_api_%s_%d[%d] = {",
1718 s =
format (s,
"0x%02x,", tmpbuf[
sizeof (
uword) + j]);
1720 s =
format (s,
"\n};\n%c", 0);
1730 void (*handler) (
void *);
1736 (*handler) (tmpbuf +
sizeof (
uword));
1750 _vec_len (tmpbuf) = 0;
1754 if (saved_print_handlers)
1761 munmap (hp, file_size);
1770 u32 nitems = 256 << 10;
1783 if (
unformat (input,
"nitems %d", &nitems))
1792 else if (
unformat (input,
"save %s", &filename))
1794 u8 *chroot_filename;
1795 if (strstr ((
char *) filename,
"..")
1796 || index ((
char *) filename,
'/'))
1803 chroot_filename =
format (0,
"/tmp/%s%c", filename, 0);
1807 fp = fopen ((
char *) chroot_filename,
"w");
1825 "Error while writing end of buffer trace to file\n");
1828 "Error while writing start of buffer trace to file\n");
1835 else if (
unformat (input,
"dump %s", &filename))
1839 else if (
unformat (input,
"custom-dump %s", &filename))
1843 else if (
unformat (input,
"replay %s", &filename))
1847 else if (
unformat (input,
"initializers %s", &filename))
1855 else if (
unformat (input,
"first %d", &first))
1859 else if (
unformat (input,
"last %d", &last))
1863 else if (
unformat (input,
"status"))
1873 else if (
unformat (input,
"post-mortem-on"))
1875 else if (
unformat (input,
"post-mortem-off"))
1886 .path =
"api trace",
1888 "api trace [on|off][dump|save|replay <file>][status][free][post-mortem-on]",
1896 u32 nitems = 256 << 10;
1904 if (
unformat (input,
"nitems %d", &nitems))
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
#define TRACE_VLIB_MEMORY_QUEUE
#define vl_print(handle,...)
sll srl srl sll sra u16x4 i
void vl_api_memclnt_delete_t_handler(vl_api_memclnt_delete_t *mp)
static void svm_pop_heap(void *oldheap)
static f64 vlib_process_wait_for_event_or_clock(vlib_main_t *vm, f64 dt)
Suspend a cooperative multi-tasking thread Waits for an event, or for the indicated number of seconds...
int unix_shared_memory_queue_is_full(unix_shared_memory_queue_t *q)
static void vlib_buffer_free(vlib_main_t *vm, u32 *buffers, u32 n_buffers)
Free buffers Frees the entire buffer chain for each buffer.
static vlib_cli_command_t trace
(constructor) VLIB_CLI_COMMAND (trace)
void vl_msg_api_send_shmem(unix_shared_memory_queue_t *q, u8 *elem)
static clib_error_t * setup_memclnt_exit(vlib_main_t *vm)
Fixed length block allocator.
unix_shared_memory_queue_t * vl_input_queue
static vlib_node_registration_t api_rx_from_node_node
(constructor) VLIB_REGISTER_NODE (api_rx_from_node_node)
static f64 vlib_time_now(vlib_main_t *vm)
static clib_error_t * vl_api_client_command(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cli_cmd)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
static void vl_api_trace_plugin_msg_ids_t_handler(vl_api_trace_plugin_msg_ids_t *mp)
void vl_msg_api_barrier_sync(void)
static clib_error_t * vl_api_message_table_command(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cli_cmd)
static clib_error_t * vl_api_show_plugin_command(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cli_cmd)
unix_shared_memory_queue_t * vl_api_client_index_to_input_queue(u32 index)
static heap_elt_t * last(heap_header_t *h)
static clib_error_t * api_config_fn(vlib_main_t *vm, unformat_input_t *input)
ring_alloc_t * client_rings
static clib_error_t * vl_api_clear_histogram_command(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cli_cmd)
void vl_msg_api_post_mortem_dump_enable_disable(int enable)
void vl_msg_api_send(vl_api_registration_t *rp, u8 *elem)
#define pool_is_free(P, E)
Use free bitmap to query whether given element is free.
void vl_api_get_first_msg_id_t_handler(vl_api_get_first_msg_id_t *mp)
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
void vl_enable_disable_memory_api(vlib_main_t *vm, int enable)
trace_cfg_t * api_trace_cfg
static vlib_cli_command_t cli_show_api_clients_command
(constructor) VLIB_CLI_COMMAND (cli_show_api_clients_command)
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
_vl_msg_api_function_list_elt_t * reaper_function_registrations
void vl_msg_api_custom_dump_configure(api_main_t *am)
#define vec_add(V, E, N)
Add N elements to end of vector V (no header, unspecified alignment)
static f64 vlib_last_vector_length_per_node(vlib_main_t *vm)
static void vlib_worker_thread_barrier_check(void)
static uword vlib_process_suspend(vlib_main_t *vm, f64 dt)
Suspend a vlib cooperative multi-tasking thread for a period of time.
void vl_set_memory_region_name(char *name)
#define VLIB_BUFFER_NEXT_PRESENT
i16 current_data
signed offset in data[], pre_data[] that we are currently processing.
_vlib_init_function_list_elt_t * api_init_function_registrations
static vlib_cli_command_t cli_show_api_status_command
(constructor) VLIB_CLI_COMMAND (cli_show_api_status_command)
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
static int range_compare(vl_api_msg_range_t *a0, vl_api_msg_range_t *a1)
vl_api_trace_t * rx_trace
#define VLIB_INIT_FUNCTION(x)
static uword vlib_process_get_events(vlib_main_t *vm, uword **data_vector)
Return the first event type which has occurred and a vector of per-event data of that type...
void vl_unmap_shmem(void)
static void * svm_push_data_heap(svm_region_t *rp)
void vl_msg_api_free(void *)
vl_api_registration_t ** vl_clients
static vlib_cli_command_t cli_show_api_message_table_command
(constructor) VLIB_CLI_COMMAND (cli_show_api_message_table_command)
#define clib_arch_is_little_endian
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
static void send_one_plugin_msg_ids_msg(u8 *name, u16 first_msg_id, u16 last_msg_id)
#define clib_error_return(e, args...)
clib_error_t * vlib_call_init_exit_functions(vlib_main_t *vm, _vlib_init_function_list_elt_t *head, int call_once)
static clib_error_t * api_trace_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
struct vl_shmem_hdr_ * shmem_hdr
static void * vl_api_memclnt_create_t_print(vl_api_memclnt_create_t *a, void *handle)
void vl_socket_api_send(vl_api_registration_t *rp, u8 *elem)
#define foreach_plugin_trace_msg
#define SVM_GLOBAL_REGION_BASEVA
static uword pointer_to_uword(const void *p)
static void memclnt_queue_callback(vlib_main_t *vm)
static void vlib_set_queue_signal_callback(vlib_main_t *vm, void(*fp)(vlib_main_t *))
vl_shmem_hdr_t * shmem_hdr
static heap_elt_t * first(heap_header_t *h)
int vl_msg_api_trace_free(api_main_t *am, vl_api_trace_which_t which)
vl_registration_type_t registration_type
static vlib_cli_command_t api_trace_command
(constructor) VLIB_CLI_COMMAND (api_trace_command)
static void * vl_api_trace_plugin_msg_ids_t_print(vl_api_trace_plugin_msg_ids_t *a, void *handle)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
#define foreach_rpc_api_msg
static vlib_node_registration_t memclnt_node
(constructor) VLIB_REGISTER_NODE (memclnt_node)
static clib_error_t * vl_api_ring_command(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cli_cmd)
u16 current_length
Nbytes between current data and the end of this buffer.
static void vlib_process_signal_event(vlib_main_t *vm, uword node_index, uword type_opaque, uword data)
static int call_reaper_functions(u32 client_index)
void(** msg_print_handlers)(void *, void *)
static vlib_cli_command_t cli_show_api_ring_command
(constructor) VLIB_CLI_COMMAND (cli_show_api_ring_command)
uword os_get_cpu_number(void)
void vl_msg_api_barrier_release(void)
#define vec_dup(V)
Return copy of vector (no header, no alignment)
#define VLIB_CONFIG_FUNCTION(x, n,...)
void svm_region_init_args(svm_map_region_args_t *a)
static void vl_api_rpc_call_t_handler(vl_api_rpc_call_t *mp)
static u32 vl_msg_api_handle_get_index(u32 index)
#define foreach_vlib_api_msg
void vl_msg_api_handler_with_vm_node(api_main_t *am, void *the_msg, vlib_main_t *vm, vlib_node_runtime_t *node)
volatile u32 queue_signal_pending
#define uword_to_pointer(u, type)
int vl_msg_api_trace_save(api_main_t *am, vl_api_trace_which_t which, FILE *fp)
#define clib_arch_is_big_endian
int vl_msg_api_trace_onoff(api_main_t *am, vl_api_trace_which_t which, int onoff)
void * vl_msg_api_alloc(int nbytes)
#define VL_API_LITTLE_ENDIAN
void vl_api_rpc_call_main_thread(void *fp, u8 *data, u32 data_length)
void serialize_open_vector(serialize_main_t *m, u8 *vector)
#define vec_free(V)
Free vector's memory (no header).
unix_shared_memory_queue_t * vl_input_queue
vl_api_msg_range_t * msg_ranges
#define clib_warning(format, args...)
#define clib_memcpy(a, b, c)
#define foreach_histogram_bucket
static void serialize_integer(serialize_main_t *m, u64 x, u32 n_bytes)
void vlib_worker_thread_barrier_sync(vlib_main_t *vm)
#define ELOG_TYPE_DECLARE(f)
static vlib_cli_command_t cli_show_api_command
(constructor) VLIB_CLI_COMMAND (cli_show_api_command)
static clib_error_t * vl_api_trace_command(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cli_cmd)
static void vl_msg_api_process_file(vlib_main_t *vm, u8 *filename, u32 first_index, u32 last_index, vl_api_replay_t which)
#define VLIB_CLI_COMMAND(x,...)
void vl_msg_api_handler_no_trace_no_free(void *the_msg)
vl_api_trace_t * tx_trace
static uword api_rx_from_node(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
static vlib_cli_command_t cli_show_api_plugin_command
(constructor) VLIB_CLI_COMMAND (cli_show_api_plugin_command)
#define pool_put_index(p, i)
Free pool element with given index.
static uword hash_elts(void *v)
#define VL_API_EPOCH_MASK
clib_error_t * vlibmemory_init(vlib_main_t *vm)
static u64 vector_rate_histogram[SLEEP_N_BUCKETS]
static uword memclnt_process(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *f)
VLIB_API_INIT_FUNCTION(rpc_api_hookup)
u8 * vl_api_serialize_message_table(api_main_t *am, u8 *vector)
u32 next_buffer
Next buffer for this linked-list of buffers.
static void clib_mem_free(void *p)
#define VL_API_BIG_ENDIAN
u8 * serialized_message_table_in_shmem
#define clib_error_report(e)
static void * vlib_frame_args(vlib_frame_t *f)
Get pointer to frame scalar data.
void dump_socket_clients(vlib_main_t *vm, api_main_t *am)
static void vlib_node_set_state(vlib_main_t *vm, u32 node_index, vlib_node_state_t new_state)
Set node dispatch state.
#define SVM_GLOBAL_REGION_SIZE
static void * clib_mem_alloc(uword size)
static u8 * format_api_msg_range(u8 *s, va_list *args)
static vlib_main_t * vlib_get_main(void)
static clib_error_t * rpc_api_hookup(vlib_main_t *vm)
static clib_error_t * vl_api_status_command(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cli_cmd)
static void vl_api_rpc_reply_t_handler(vl_api_rpc_reply_t *mp)
#define SVM_GLOBAL_REGION_NAME
void vl_api_memclnt_create_t_handler(vl_api_memclnt_create_t *mp)
void(** msg_endian_handlers)(void *)
#define SVM_PVT_MHEAP_SIZE
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
#define hash_foreach_pair(p, v, body)
Iterate over hash pairs.
#define vec_sort_with_function(vec, f)
Sort a vector using the supplied element comparison function.
int vl_map_shmem(char *region_name, int is_vlib)
u8 * format_vl_msg_api_trace_status(u8 *s, va_list *args)
u32 vl_api_registration_pool_index
void svm_client_scan_this_region_nolock(svm_region_t *rp)
static clib_error_t * vl_api_show_histogram_command(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cli_cmd)
volatile u32 api_queue_nonempty
#define hash_get_mem(h, key)
void(** msg_handlers)(void *)
void vlib_worker_thread_barrier_release(vlib_main_t *vm)
#define VLIB_REGISTER_NODE(x,...)
void vl_msg_api_send_shmem_nolock(unix_shared_memory_queue_t *q, u8 *elem)
static int memory_api_init(char *region_name)
void * serialize_close_vector(serialize_main_t *m)
static void * vl_api_memclnt_delete_t_print(vl_api_memclnt_delete_t *a, void *handle)
void * vl_msg_api_alloc_as_if_client(int nbytes)
static u32 vl_msg_api_handle_get_epoch(u32 index)
uword * msg_index_by_name_and_crc
int vl_msg_api_trace_configure(api_main_t *am, vl_api_trace_which_t which, u32 nitems)
u32 flags
buffer flags: VLIB_BUFFER_IS_TRACED: trace this buffer.
uword * msg_range_by_name
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
static u32 vl_msg_api_handle_from_index_and_epoch(u32 index, u32 epoch)
CLIB vectors are ubiquitous dynamically resized arrays with by user defined "headers".
struct _unix_shared_memory_queue unix_shared_memory_queue_t
static uword pool_elts(void *v)
Number of active elements in a pool.