summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2020-09-14 10:29:29 -0700
committerDave Barach <openvpp@barachs.net>2020-09-14 19:58:18 +0000
commitf99a7d64476fc25636a1df200b256df445d9e446 (patch)
treeba4c4f784a44c109e1bfda3d3c9738f167d2861a /src
parent76770fd659420c23e43422d672a55e268f042129 (diff)
session: del app worker on socket detach
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ic904abedcd270c95e782159170d457bc396424a0
Diffstat (limited to 'src')
-rw-r--r--src/vnet/session/session_api.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/vnet/session/session_api.c b/src/vnet/session/session_api.c
index 15c5812e790..988d3e26138 100644
--- a/src/vnet/session/session_api.c
+++ b/src/vnet/session/session_api.c
@@ -1507,7 +1507,6 @@ done:
static void
sapi_socket_detach (app_namespace_t * app_ns, clib_socket_t * cs)
{
- vnet_app_detach_args_t _a = { 0 }, *a = &_a;
app_ns_api_handle_t *handle;
app_worker_t *app_wrk;
u32 api_client_handle;
@@ -1515,12 +1514,19 @@ sapi_socket_detach (app_namespace_t * app_ns, clib_socket_t * cs)
api_client_handle = appns_sapi_socket_handle (app_ns, cs);
sapi_socket_close_w_handle (api_client_handle);
- /* Cleanup everything because app closed socket or crashed */
+ /* Cleanup everything because app worker closed socket or crashed */
handle = (app_ns_api_handle_t *) & cs->private_data;
app_wrk = app_worker_get (handle->aah_app_wrk_index);
- a->app_index = app_wrk->app_index;
- a->api_client_index = api_client_handle;
- vnet_application_detach (a);
+
+ vnet_app_worker_add_del_args_t args = {
+ .app_index = app_wrk->app_index,
+ .wrk_map_index = app_wrk->wrk_map_index,
+ .api_client_index = api_client_handle,
+ .is_add = 0
+ };
+ /* Send rpc to main thread for worker barrier */
+ vlib_rpc_call_main_thread (vnet_app_worker_add_del, (u8 *) & args,
+ sizeof (args));
}
static clib_error_t *