X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvcl%2Fvcl_bapi.c;fp=src%2Fvcl%2Fvcl_bapi.c;h=a13948d754d95db0ae537d007a47edb2704c944c;hb=b462418890240b2e38dbf522f9dd0196b79e0fa8;hp=e245c4dc86579e47c8bd42b4d15943ffd3f5dfc0;hpb=04943b4c42db300d0d895644f32da79a6d411c51;p=vpp.git diff --git a/src/vcl/vcl_bapi.c b/src/vcl/vcl_bapi.c index e245c4dc865..a13948d754d 100644 --- a/src/vcl/vcl_bapi.c +++ b/src/vcl/vcl_bapi.c @@ -65,7 +65,6 @@ static void vl_api_app_attach_reply_t_handler (vl_api_app_attach_reply_t * mp) { vcl_worker_t *wrk = vcl_worker_get (0); - svm_msg_q_t *ctrl_mq; u64 segment_handle; int *fds = 0, i, rv; u32 n_fds = 0; @@ -77,9 +76,6 @@ vl_api_app_attach_reply_t_handler (vl_api_app_attach_reply_t * mp) goto failed; } - wrk->app_event_queue = uword_to_pointer (mp->app_mq, svm_msg_q_t *); - ctrl_mq = uword_to_pointer (mp->vpp_ctrl_mq, svm_msg_q_t *); - vcm->ctrl_mq = wrk->ctrl_mq = ctrl_mq; segment_handle = clib_net_to_host_u64 (mp->segment_handle); if (segment_handle == VCL_INVALID_SEGMENT_HANDLE) { @@ -100,6 +96,11 @@ vl_api_app_attach_reply_t_handler (vl_api_app_attach_reply_t * mp) fds[n_fds++])) goto failed; + vcl_segment_attach_mq (vcl_vpp_worker_segment_handle (0), + mp->vpp_ctrl_mq, mp->vpp_ctrl_mq_thread, + &wrk->ctrl_mq); + vcm->ctrl_mq = wrk->ctrl_mq; + if (mp->fd_flags & SESSION_FD_F_MEMFD_SEGMENT) { segment_name = vl_api_from_api_to_new_c_string (&mp->segment_name); @@ -111,6 +112,8 @@ vl_api_app_attach_reply_t_handler (vl_api_app_attach_reply_t * mp) goto failed; } + vcl_segment_attach_mq (segment_handle, mp->app_mq, 0, + &wrk->app_event_queue); if (mp->fd_flags & SESSION_FD_F_MQ_EVENTFD) { @@ -169,8 +172,6 @@ vl_api_app_worker_add_del_reply_t_handler (vl_api_app_worker_add_del_reply_t * return; wrk->vpp_wrk_index = clib_net_to_host_u32 (mp->wrk_index); - wrk->app_event_queue = uword_to_pointer (mp->app_event_queue_address, - svm_msg_q_t *); wrk->ctrl_mq = vcm->ctrl_mq; segment_handle = clib_net_to_host_u64 (mp->segment_handle); @@ -204,6 +205,9 @@ vl_api_app_worker_add_del_reply_t_handler (vl_api_app_worker_add_del_reply_t * goto failed; } + vcl_segment_attach_mq (segment_handle, mp->app_event_queue_address, 0, + &wrk->app_event_queue); + if (mp->fd_flags & SESSION_FD_F_MQ_EVENTFD) { svm_msg_q_set_consumer_eventfd (wrk->app_event_queue, fds[n_fds]);