aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/session/application.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-11-29 12:40:10 -0800
committerOle Trøan <otroan@employees.org>2018-11-30 07:21:02 +0000
commitfa76a76bf3388f09d55d0c83e7aea507c44f9619 (patch)
treeee9f51236f6e4acf5627f11f27aff73de9d1fe15 /src/vnet/session/application.c
parent4744ddbfe0012861895dbd33487569e46b81554b (diff)
session: segment handle in accept/connect notifications
Change-Id: I03884b6cde9d4c38ae13d1994fd8d37d44016ef0 Signed-off-by: Florin Coras <fcoras@cisco.com>
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);
}