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);
229 _vl_msg_api_function_list_elt_t *
i;
234 error = i->f (client_index);
237 i = i->next_init_function;
254 u32 handle, client_index, epoch;
267 (
"Stale clnt delete index %d old epoch %d cur epoch %d",
283 rp->_vl_msg_id = ntohs (VL_API_MEMCLNT_DELETE_REPLY);
302 pthread_mutex_lock (&svm->
mutex);
305 memset (regp, 0xF1,
sizeof (*regp));
307 pthread_mutex_unlock (&svm->
mutex);
325 u16 first_msg_id = ~0;
335 strncpy ((
char *) name, (
char *) mp->
name,
ARRAY_LEN (name) - 1);
349 rmp->_vl_msg_id = ntohs (VL_API_GET_FIRST_MSG_ID_REPLY);
356 #define foreach_vlib_api_msg \ 357 _(MEMCLNT_CREATE, memclnt_create) \ 358 _(MEMCLNT_DELETE, memclnt_delete) \ 359 _(GET_FIRST_MSG_ID, get_first_msg_id) 371 memset (c, 0,
sizeof (*c));
376 #define _(N,n) do { \ 377 c->id = VL_API_##N; \ 379 c->handler = vl_api_##n##_t_handler; \ 380 c->cleanup = vl_noop_handler; \ 381 c->endian = vl_api_##n##_t_endian; \ 382 c->print = vl_api_##n##_t_print; \ 383 c->size = sizeof(vl_api_##n##_t); \ 386 c->message_bounce = 0; \ 387 vl_msg_api_config(c);} while (0); 395 #define foreach_histogram_bucket \ 403 #define _(n) SLEEP_##n##_US, 425 memset (mp, 0,
sizeof (*mp));
427 mp->_vl_msg_id = clib_host_to_net_u16 (VL_API_TRACE_PLUGIN_MSG_IDS);
431 mp->
last_msg_id = clib_host_to_net_u16 (last_msg_id);
448 f64 dead_client_scan_time;
449 f64 sleep_time, start_time;
457 clib_warning (
"memory_api_init returned %d, wait for godot...", rv);
487 uword event_type __attribute__ ((unused));
505 pthread_mutex_lock (&q->mutex);
509 pthread_mutex_unlock (&q->mutex);
516 .format =
"q-underflow: len %d",
531 headp = (
i8 *) (q->data + sizeof (
uword) * q->head);
535 need_broadcast = (q->cursize == q->maxsize / 2);
540 pthread_mutex_unlock (&q->mutex);
542 (void) pthread_cond_broadcast (&q->condvar);
549 int index = SLEEP_400_US;
550 if (vector_rate > 40.0)
552 else if (vector_rate > 20.0)
554 index = SLEEP_200_US;
557 else if (vector_rate >= 1.0)
559 index = SLEEP_100_US;
567 vector_rate_histogram[index] += 1;
581 static u32 *dead_indices;
582 static u32 *confused_indices;
593 q = regp->vl_input_queue;
594 if (kill (q->consumer_pid, 0) < 0)
596 vec_add1(dead_indices, regpp - am->vl_clients);
601 clib_warning (
"NULL client registration index %d",
602 regpp - am->vl_clients);
603 vec_add1 (confused_indices, regpp - am->vl_clients);
611 for (i = 0; i <
vec_len (confused_indices); i++)
624 for (i = 0; i <
vec_len (dead_indices); i++)
638 pthread_mutex_lock (&svm->
mutex);
641 for (i = 0; i <
vec_len (dead_indices); i++)
647 memset (*regpp, 0xF3,
sizeof (**regpp));
663 pthread_mutex_unlock (&svm->
mutex);
665 for (i = 0; i <
vec_len (dead_indices); i++)
676 .format =
"q-awake: len %d",
685 ed->len = q->cursize;
697 u64 total_counts = 0;
705 if (total_counts == 0)
714 percent = ((f64) vector_rate_histogram[SLEEP_##n##_US]) \ 715 / (f64) total_counts; \ 717 vlib_cli_output (vm, "Sleep %3d us: %llu, %.2f%%",n, \ 718 vector_rate_histogram[SLEEP_##n##_US], \ 729 .path =
"show api histogram",
730 .short_help =
"show api histogram",
749 .path =
"clear api histogram",
750 .short_help =
"clear api histogram",
760 .name =
"api-rx-from-ring",
761 .state = VLIB_NODE_STATE_DISABLED,
768 static volatile int *cursizep;
782 cursizep = &q->cursize;
799 ? VLIB_NODE_STATE_POLLING
800 : VLIB_NODE_STATE_DISABLED));
816 while (n_left_from > 0)
833 _vec_len (long_msg) = 0;
834 vec_add (long_msg, msg, msg_len);
840 vec_add (long_msg, msg, msg_len);
858 .name =
"api-rx-from-node",
890 "Owner",
"Size",
"Nitems",
"Hits",
"Misses");
914 (vm,
"%d application restarts, %d reclaimed msgs, %d garbage collects\n",
921 __attribute__ ((weak));
936 u32 *confused_indices = 0;
942 "Name",
"PID",
"Queue Length",
"Queue VA",
"Health");
951 q = regp->vl_input_queue;
952 if (kill (q->consumer_pid, 0) < 0)
960 vlib_cli_output (vm,
"%16s %8d %14d 0x%016llx %s\n",
961 regp->name, q->consumer_pid, q->cursize,
966 clib_warning (
"NULL client registration index %d",
967 regpp - am->vl_clients);
968 vec_add1 (confused_indices, regpp - am->vl_clients);
977 for (i = 0; i <
vec_len (confused_indices); i++)
1031 .short_help =
"Show API information",
1037 .path =
"show api ring-stats",
1038 .short_help =
"Message ring statistics",
1045 .path =
"show api clients",
1046 .short_help =
"Client information",
1053 .path =
"show api status",
1054 .short_help =
"Show API trace status",
1100 .path =
"show api message-table",
1101 .short_help =
"Message Table",
1118 else if (
unformat (input,
"tx nitems %u", &nitems)
1124 else if (
unformat (input,
"on rx"))
1128 else if (
unformat (input,
"on tx"))
1148 else if (
unformat (input,
"debug on"))
1152 else if (
unformat (input,
"debug off"))
1174 .path =
"set api-trace",
1175 .short_help =
"API trace",
1186 memset (a, 0,
sizeof (*a));
1216 int len0, len1, clen;
1220 clen = len0 < len1 ? len0 : len1;
1221 return (strncmp ((
char *) a0->
name, (
char *) a1->
name, clen));
1230 s =
format (s,
"%-20s%9s%9s",
"Name",
"First-ID",
"Last-ID");
1260 for (i = 0; i <
vec_len (rp); i++)
1270 .path =
"show api plugin",
1271 .short_help =
"show api plugin",
1279 vl_api_rpc_call_reply_t *rmp;
1309 rmp->_vl_msg_id = ntohs (VL_API_RPC_CALL_REPLY);
1339 void (*call_fp) (
void *);
1353 memset (mp, 0,
sizeof (*mp));
1355 mp->_vl_msg_id = ntohs (VL_API_RPC_CALL);
1366 while (pthread_mutex_trylock (&q->mutex))
1371 pthread_mutex_unlock (&q->mutex);
1373 while (pthread_mutex_trylock (&q->mutex))
1379 pthread_mutex_unlock (&q->mutex);
1396 clib_warning (
"WARNING: traced plugin '%s' not in current image",
1404 clib_warning (
"WARNING: traced plugin '%s' first message id %d not %d",
1411 clib_warning (
"WARNING: traced plugin '%s' last message id %d not %d",
1417 #define foreach_rpc_api_msg \ 1418 _(RPC_CALL,rpc_call) \ 1419 _(RPC_CALL_REPLY,rpc_call_reply) 1421 #define foreach_plugin_trace_msg \ 1422 _(TRACE_PLUGIN_MSG_IDS,trace_plugin_msg_ids) 1428 vl_msg_api_set_handlers(VL_API_##N, #n, \ 1429 vl_api_##n##_t_handler, \ 1432 vl_api_##n##_t_print, \ 1433 sizeof(vl_api_##n##_t), 0 ); 1438 vl_msg_api_set_handlers(VL_API_##N, #n, \ 1439 vl_api_##n##_t_handler, \ 1442 vl_api_##n##_t_print, \ 1443 sizeof(vl_api_##n##_t), 1 ); 1471 trace_name =
"TX trace";
1476 trace_name =
"RX trace";
1485 s =
format (s,
"%s: not yet configured.\n", trace_name);
1489 s =
format (s,
"%s: used %d of %d items, %s enabled, %s wrapped\n",
1496 __attribute__ ((weak));
1504 u32 first_index,
u32 last_index,
1505 vl_api_replay_t which)
1507 vl_api_trace_file_header_t *hp;
1512 u8 endian_swap_needed = 0;
1516 void **saved_print_handlers = 0;
1518 fd = open ((
char *) filename, O_RDONLY);
1526 if (fstat (fd, &statb) < 0)
1533 if (!(statb.st_mode & S_IFREG) || (statb.st_size < sizeof (*hp)))
1540 file_size = statb.st_size;
1541 file_size = (file_size + 4095) & ~(4096);
1543 hp = mmap (0, file_size, PROT_READ, MAP_PRIVATE, fd, 0);
1545 if (hp == (vl_api_trace_file_header_t *) MAP_FAILED)
1555 endian_swap_needed = 1;
1557 if (endian_swap_needed)
1558 nitems = ntohl (hp->nitems);
1560 nitems = hp->nitems;
1562 if (last_index == (
u32) ~ 0)
1564 last_index = nitems - 1;
1567 if (first_index >= nitems || last_index >= nitems)
1570 first_index, last_index, nitems - 1);
1571 munmap (hp, file_size);
1576 "Note: wrapped/incomplete trace, results may vary\n");
1585 msg = (
u8 *) (hp + 1);
1587 for (i = 0; i < first_index; i++)
1593 size = clib_host_to_net_u32 (*(
u32 *) msg);
1594 msg +=
sizeof (
u32);
1597 msg_id = ntohs (*((
u16 *) msg));
1599 msg_id = *((
u16 *) msg);
1605 munmap (hp, file_size);
1614 for (; i <= last_index; i++)
1624 size = clib_host_to_net_u32 (*(
u32 *) msg);
1625 msg +=
sizeof (
u32);
1628 msg_id = ntohs (*((
u16 *) msg));
1630 msg_id = *((
u16 *) msg);
1636 munmap (hp, file_size);
1645 memset (tmpbuf, 0xf,
sizeof (
uword));
1655 void (*endian_fp) (
void *);
1660 munmap (hp, file_size);
1666 (*endian_fp) (tmpbuf +
sizeof (
uword));
1672 msg_idp = (
u16 *) (tmpbuf +
sizeof (
uword));
1683 u8 *(*print_fp) (
void *,
void *);
1686 (*print_fp) (tmpbuf +
sizeof (
uword), vm);
1702 u8 *(*print_fp) (
void *,
void *);
1708 (*print_fp) (tmpbuf +
sizeof (
uword), vm);
1711 s =
format (0,
"static u8 * vl_api_%s_%d[%d] = {",
1719 s =
format (s,
"0x%02x,", tmpbuf[
sizeof (
uword) + j]);
1721 s =
format (s,
"\n};\n%c", 0);
1731 void (*handler) (
void *);
1737 (*handler) (tmpbuf +
sizeof (
uword));
1751 _vec_len (tmpbuf) = 0;
1755 if (saved_print_handlers)
1762 munmap (hp, file_size);
1771 u32 nitems = 256 << 10;
1784 if (
unformat (input,
"nitems %d", &nitems))
1793 else if (
unformat (input,
"save %s", &filename))
1795 u8 *chroot_filename;
1796 if (strstr ((
char *) filename,
"..")
1797 || index ((
char *) filename,
'/'))
1804 chroot_filename =
format (0,
"/tmp/%s%c", filename, 0);
1808 fp = fopen ((
char *) chroot_filename,
"w");
1826 "Error while writing end of buffer trace to file\n");
1829 "Error while writing start of buffer trace to file\n");
1836 else if (
unformat (input,
"dump %s", &filename))
1840 else if (
unformat (input,
"custom-dump %s", &filename))
1844 else if (
unformat (input,
"replay %s", &filename))
1848 else if (
unformat (input,
"initializers %s", &filename))
1856 else if (
unformat (input,
"first %d", &first))
1860 else if (
unformat (input,
"last %d", &last))
1864 else if (
unformat (input,
"status"))
1874 else if (
unformat (input,
"post-mortem-on"))
1876 else if (
unformat (input,
"post-mortem-off"))
1887 .path =
"api trace",
1889 "api trace [on|off][dump|save|replay <file>][status][free][post-mortem-on]",
1897 u32 nitems = 256 << 10;
1905 if (
unformat (input,
"nitems %d", &nitems))
1928 if (
unformat (input,
"length %d", &nitems) ||
1929 (
unformat (input,
"len %d", &nitems)))
1934 clib_warning (
"vlib input queue length %d too small, ignored",
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
void vl_set_memory_region_name(const char *name)
void * vl_msg_api_alloc_as_if_client(int nbytes)
#define TRACE_VLIB_MEMORY_QUEUE
#define vl_print(handle,...)
static int memory_api_init(const char *region_name)
#define SVM_GLOBAL_REGION_NAME
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)
static clib_error_t * api_queue_config_fn(vlib_main_t *vm, unformat_input_t *input)
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)
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)
static heap_elt_t * last(heap_header_t *h)
#define SVM_PVT_MHEAP_SIZE
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_send(vl_api_registration_t *rp, u8 *elem)
#define pool_is_free(P, E)
Use free bitmap to query whether given element is free.
static void vl_api_rpc_call_reply_t_handler(vl_api_rpc_call_reply_t *mp)
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)
#define VL_API_EPOCH_MASK
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.
#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_msg_api_handler_no_trace_no_free(void *the_msg)
static void * svm_push_data_heap(svm_region_t *rp)
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)
#define SVM_GLOBAL_REGION_BASEVA
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
static uword pointer_to_uword(const void *p)
void * vl_msg_api_alloc(int nbytes)
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)
void vl_msg_api_free(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)
void vl_msg_api_barrier_sync(void)
static void vl_api_rpc_call_t_handler(vl_api_rpc_call_t *mp)
#define SVM_GLOBAL_REGION_SIZE
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)
The fine-grained event logger allows lightweight, thread-safe event logging at minimum cost...
#define clib_arch_is_big_endian
int vl_msg_api_trace_onoff(api_main_t *am, vl_api_trace_which_t which, int onoff)
static_always_inline uword vlib_get_thread_index(void)
void vl_api_rpc_call_main_thread(void *fp, u8 *data, u32 data_length)
void serialize_open_vector(serialize_main_t *m, u8 *vector)
void vl_unmap_shmem(void)
#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
unix_shared_memory_queue_t * vl_api_client_index_to_input_queue(u32 index)
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)
void vl_msg_api_barrier_release(void)
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,...)
#define VL_API_BIG_ENDIAN
void vl_msg_api_send_shmem(unix_shared_memory_queue_t *q, u8 *elem)
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)
clib_error_t * vlibmemory_init(vlib_main_t *vm)
#define VL_API_LITTLE_ENDIAN
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)
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.
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)
void vl_msg_api_post_mortem_dump_enable_disable(int enable)
void vl_msg_api_send_shmem_nolock(unix_shared_memory_queue_t *q, u8 *elem)
void vl_api_memclnt_create_t_handler(vl_api_memclnt_create_t *mp)
void(** msg_endian_handlers)(void *)
#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.
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 * serialize_close_vector(serialize_main_t *m)
static void * vl_api_memclnt_delete_t_print(vl_api_memclnt_delete_t *a, void *handle)
static u32 vl_msg_api_handle_get_epoch(u32 index)
int vl_map_shmem(const char *region_name, int is_vlib)
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.
u32 vlib_input_queue_length
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.