diff options
author | Florin Coras <fcoras@cisco.com> | 2018-11-29 17:02:29 -0800 |
---|---|---|
committer | Ole Trøan <otroan@employees.org> | 2018-11-30 09:33:30 +0000 |
commit | d85de68ec3f72888099172fffd45a90a43018155 (patch) | |
tree | bc09880ec51bdccfbe4abd47b258598df9a4854e /src/vnet/session | |
parent | e4f849c137101871b1caa0d959c7ea794e7d77f7 (diff) |
vcl: wait for segments with segment handle
Instead of waiting for notification from binary api.
Change-Id: I5ecab857d6bcdbed62d6bb06709570c4cf6b19ea
Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/session')
-rw-r--r-- | src/vnet/session/application.c | 7 | ||||
-rw-r--r-- | src/vnet/session/application_interface.c | 1 | ||||
-rw-r--r-- | src/vnet/session/application_interface.h | 1 | ||||
-rw-r--r-- | src/vnet/session/session.api | 4 | ||||
-rwxr-xr-x | src/vnet/session/session_api.c | 1 |
5 files changed, 12 insertions, 2 deletions
diff --git a/src/vnet/session/application.c b/src/vnet/session/application.c index 69f33290a73..f3628966ae5 100644 --- a/src/vnet/session/application.c +++ b/src/vnet/session/application.c @@ -1591,8 +1591,8 @@ application_local_session_connect (app_worker_t * client_wrk, local_session_t * ll, u32 opaque) { u32 seg_size, evt_q_sz, evt_q_elts, margin = 16 << 10; + u32 round_rx_fifo_sz, round_tx_fifo_sz, sm_index; segment_manager_properties_t *props, *cprops; - u32 round_rx_fifo_sz, round_tx_fifo_sz; int rv, has_transport, seg_index; svm_fifo_segment_private_t *seg; application_t *server, *client; @@ -1654,8 +1654,13 @@ application_local_session_connect (app_worker_t * client_wrk, segment_manager_segment_reader_unlock (sm); goto failed; } + sm_index = segment_manager_index (sm); ls->server_rx_fifo->ct_session_index = ls->session_index; ls->server_tx_fifo->ct_session_index = ls->session_index; + ls->server_rx_fifo->segment_manager = sm_index; + ls->server_tx_fifo->segment_manager = sm_index; + ls->server_rx_fifo->segment_index = seg_index; + ls->server_tx_fifo->segment_index = seg_index; ls->svm_segment_index = seg_index; ls->listener_index = ll->session_index; ls->client_wrk_index = client_wrk->wrk_index; diff --git a/src/vnet/session/application_interface.c b/src/vnet/session/application_interface.c index ace9ed2f868..d254b9bb55a 100644 --- a/src/vnet/session/application_interface.c +++ b/src/vnet/session/application_interface.c @@ -558,6 +558,7 @@ vnet_application_attach (vnet_app_attach_args_t * a) ASSERT (vec_len (fs->ssvm.name) <= 128); a->segment = &fs->ssvm; + a->segment_handle = segment_manager_segment_handle (sm, fs); segment_manager_segment_reader_unlock (sm); vec_free (app_name); diff --git a/src/vnet/session/application_interface.h b/src/vnet/session/application_interface.h index ecd99d8755b..dfb45a78fc9 100644 --- a/src/vnet/session/application_interface.h +++ b/src/vnet/session/application_interface.h @@ -28,6 +28,7 @@ typedef struct _vnet_app_attach_args_t #undef _ ssvm_private_t * segment; svm_msg_q_t *app_evt_q; + u64 segment_handle; } vnet_app_attach_args_t; typedef struct _vnet_app_detach_args_t diff --git a/src/vnet/session/session.api b/src/vnet/session/session.api index 3dc0cc8d360..084678f2518 100644 --- a/src/vnet/session/session.api +++ b/src/vnet/session/session.api @@ -13,7 +13,7 @@ * limitations under the License. */ -option version = "1.4.0"; +option version = "1.5.0"; /** \brief client->vpp, attach application to session layer @param client_index - opaque cookie to identify the sender @@ -45,6 +45,7 @@ option version = "1.4.0"; @param segment_name_length - length of segment name @param segment_name - name of segment client needs to attach to @param app_index - index of the newly created app + @param segment_handle - handle for segment */ define application_attach_reply { u32 context; @@ -56,6 +57,7 @@ define application_attach_reply { u8 segment_name_length; u8 segment_name[128]; u32 app_index; + u64 segment_handle; }; /** \brief Application add TLS certificate diff --git a/src/vnet/session/session_api.c b/src/vnet/session/session_api.c index d37b3c995d0..6ce9e1feac3 100755 --- a/src/vnet/session/session_api.c +++ b/src/vnet/session/session_api.c @@ -825,6 +825,7 @@ done: rmp->app_event_queue_address = pointer_to_uword (a->app_evt_q); rmp->n_fds = n_fds; rmp->fd_flags = fd_flags; + rmp->segment_handle = clib_host_to_net_u64 (a->segment_handle); } })); /* *INDENT-ON* */ |