X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvpp%2Fapi%2Fapi.c;h=d69b84fd0b94538e881d2ee47466563e29d51c29;hb=f94c63ea392a79b509a7b8263f5a9372a58786f9;hp=70b104234b77423d5f4c0bd9c36ad550835c18a7;hpb=e86a8edd3c14fb41ace2a12efd17bc7772bf623f;p=vpp.git diff --git a/src/vpp/api/api.c b/src/vpp/api/api.c index 70b104234b7..d69b84fd0b9 100644 --- a/src/vpp/api/api.c +++ b/src/vpp/api/api.c @@ -56,7 +56,7 @@ #undef BIHASH_TYPE #undef __included_bihash_template_h__ -#include +#include #include @@ -164,16 +164,16 @@ static void vl_api_cli_t_handler (vl_api_cli_t * mp) { vl_api_cli_reply_t *rp; - svm_queue_t *q; + vl_api_registration_t *reg; vlib_main_t *vm = vlib_get_main (); api_main_t *am = &api_main; unformat_input_t input; u8 *shmem_vec = 0; void *oldheap; - q = vl_api_client_index_to_input_queue (mp->client_index); - if (!q) - return; + reg = vl_api_client_index_to_registration (mp->client_index); + if (!reg) + return;; rp = vl_msg_api_alloc (sizeof (*rp)); rp->_vl_msg_id = ntohs (VL_API_CLI_REPLY); @@ -193,7 +193,7 @@ vl_api_cli_t_handler (vl_api_cli_t * mp) rp->reply_in_shmem = (uword) shmem_vec; - vl_msg_api_send_shmem (q, (u8 *) & rp); + vl_api_send_msg (reg, (u8 *) rp); } static void @@ -367,7 +367,8 @@ vl_api_get_node_graph_t_handler (vl_api_get_node_graph_t * mp) vlib_main_t *vm = vlib_get_main (); void *oldheap; vl_api_get_node_graph_reply_t *rmp; - vlib_node_t ***node_dups; + static vlib_node_t ***node_dups; + static vlib_main_t **stat_vms; pthread_mutex_lock (&am->vlib_rp->mutex); oldheap = svm_push_data_heap (am->vlib_rp); @@ -378,9 +379,10 @@ vl_api_get_node_graph_t_handler (vl_api_get_node_graph_t * mp) vec_validate (vector, 16384); vec_reset_length (vector); - /* $$$$ FIXME */ - node_dups = vlib_node_get_nodes (vm, (u32) ~ 0 /* all threads */ , - 1 /* include stats */ ); + vlib_node_get_nodes (vm, 0 /* main threads */ , + 0 /* include stats */ , + 1 /* barrier sync */ , + &node_dups, &stat_vms); vector = vlib_node_serialize (vm, node_dups, vector, 1 /* include nexts */ , 1 /* include stats */ ); @@ -430,7 +432,7 @@ static void setup_message_id_table (api_main_t * am); /* * vpe_api_hookup * Add vpe's API message handlers to the table. - * vlib has alread mapped shared memory and + * vlib has already mapped shared memory and * added the client registration handlers. * See .../open-repo/vlib/memclnt_vlib.c:memclnt_process() */ @@ -472,7 +474,7 @@ vpe_api_hookup (vlib_main_t * vm) VLIB_API_INIT_FUNCTION (vpe_api_hookup); -static clib_error_t * +clib_error_t * vpe_api_init (vlib_main_t * vm) { vpe_api_main_t *am = &vpe_api_main; @@ -490,9 +492,6 @@ vpe_api_init (vlib_main_t * vm) return 0; } -VLIB_INIT_FUNCTION (vpe_api_init); - - static clib_error_t * api_segment_config (vlib_main_t * vm, unformat_input_t * input) {