aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/session/application.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/session/application.c')
-rw-r--r--src/vnet/session/application.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/vnet/session/application.c b/src/vnet/session/application.c
index 380c960bdaf..69f33290a73 100644
--- a/src/vnet/session/application.c
+++ b/src/vnet/session/application.c
@@ -924,6 +924,7 @@ vnet_app_worker_add_del (vnet_app_worker_add_del_args_t * a)
sm = segment_manager_get (app_wrk->first_segment_manager);
fs = segment_manager_get_segment_w_lock (sm, 0);
a->segment = &fs->ssvm;
+ a->segment_handle = segment_manager_segment_handle (sm, fs);
segment_manager_segment_reader_unlock (sm);
a->evt_q = app_wrk->event_queue;
a->wrk_map_index = app_wrk->wrk_map_index;
@@ -1007,11 +1008,12 @@ application_use_mq_for_ctrl (application_t * app)
* Send an API message to the external app, to map new segment
*/
int
-app_worker_add_segment_notify (u32 app_wrk_index, ssvm_private_t * fs)
+app_worker_add_segment_notify (u32 app_wrk_index, u64 segment_handle)
{
app_worker_t *app_wrk = app_worker_get (app_wrk_index);
application_t *app = application_get (app_wrk->app_index);
- return app->cb_fns.add_segment_callback (app_wrk->api_client_index, fs);
+ return app->cb_fns.add_segment_callback (app_wrk->api_client_index,
+ segment_handle);
}
u32
@@ -1597,6 +1599,7 @@ application_local_session_connect (app_worker_t * client_wrk,
segment_manager_t *sm;
local_session_t *ls;
svm_msg_q_t *sq, *cq;
+ u64 segment_handle;
ls = application_local_session_alloc (server_wrk);
server = application_get (server_wrk->app_index);
@@ -1660,8 +1663,9 @@ application_local_session_connect (app_worker_t * client_wrk,
ls->listener_session_type = ll->session_type;
ls->session_state = SESSION_STATE_READY;
+ segment_handle = segment_manager_segment_handle (sm, seg);
if ((rv = server->cb_fns.add_segment_callback (server_wrk->api_client_index,
- &seg->ssvm)))
+ segment_handle)))
{
clib_warning ("failed to notify server of new segment");
segment_manager_segment_reader_unlock (sm);
@@ -1706,6 +1710,7 @@ application_local_session_connect_notify (local_session_t * ls)
segment_manager_t *sm;
application_t *client;
int rv, is_fail = 0;
+ u64 segment_handle;
uword client_key;
client_wrk = app_worker_get (ls->client_wrk_index);
@@ -1714,8 +1719,9 @@ application_local_session_connect_notify (local_session_t * ls)
sm = application_get_local_segment_manager_w_session (server_wrk, ls);
seg = segment_manager_get_segment_w_lock (sm, ls->svm_segment_index);
+ segment_handle = segment_manager_segment_handle (sm, seg);
if ((rv = client->cb_fns.add_segment_callback (client_wrk->api_client_index,
- &seg->ssvm)))
+ segment_handle)))
{
clib_warning ("failed to notify client %u of new segment",
ls->client_wrk_index);
@@ -1770,13 +1776,14 @@ application_local_session_cleanup (app_worker_t * client_wrk,
if (!has_transport)
{
application_t *server = application_get (server_wrk->app_index);
+ u64 segment_handle = segment_manager_segment_handle (sm, seg);
server->cb_fns.del_segment_callback (server_wrk->api_client_index,
- &seg->ssvm);
+ segment_handle);
if (client_wrk)
{
application_t *client = application_get (client_wrk->app_index);
client->cb_fns.del_segment_callback (client_wrk->api_client_index,
- &seg->ssvm);
+ segment_handle);
}
segment_manager_del_segment (sm, seg);
}