aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/session/session_node.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-09-09 09:40:51 -0700
committerFlorin Coras <florin.coras@gmail.com>2018-09-10 03:15:16 +0000
commit2179513b71963a0b42ca6f1f2b641e79ce89447b (patch)
tree049f4f13ad1aa81d59be4a153b501288be497e10 /src/vnet/session/session_node.c
parent97f592f474ebaeba0c9a0f50db8f5627cc444aca (diff)
session: lock app worker mq for io events
Also fixes vcl client/server stats and closing procedure. Change-Id: I7d5a274ea0a3c8ea13062bf61bf402248dfe1a19 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/session/session_node.c')
-rw-r--r--src/vnet/session/session_node.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/vnet/session/session_node.c b/src/vnet/session/session_node.c
index 119cdd812ad..f5aed7490ea 100644
--- a/src/vnet/session/session_node.c
+++ b/src/vnet/session/session_node.c
@@ -29,6 +29,7 @@ session_mq_accepted_reply_handler (void *data)
{
session_accepted_reply_msg_t *mp = (session_accepted_reply_msg_t *) data;
vnet_disconnect_args_t _a = { 0 }, *a = &_a;
+ app_worker_t *app_wrk;
local_session_t *ls;
stream_session_t *s;
@@ -43,8 +44,6 @@ session_mq_accepted_reply_handler (void *data)
if (session_handle_is_local (mp->handle))
{
- app_worker_t *app_wrk;
- application_t *app;
ls = application_get_local_session_from_handle (mp->handle);
if (!ls)
{
@@ -52,8 +51,7 @@ session_mq_accepted_reply_handler (void *data)
return;
}
app_wrk = app_worker_get (ls->app_wrk_index);
- app = application_get (app_wrk->app_index);
- if (app->app_index != mp->context)
+ if (app_wrk->app_index != mp->context)
{
clib_warning ("server %u doesn't own local handle 0x%lx",
mp->context, mp->handle);
@@ -71,18 +69,15 @@ session_mq_accepted_reply_handler (void *data)
clib_warning ("session doesn't exist");
return;
}
- if (s->app_wrk_index != mp->context)
+ app_wrk = app_worker_get (s->app_wrk_index);
+ if (app_wrk->app_index != mp->context)
{
clib_warning ("app doesn't own session");
return;
}
s->session_state = SESSION_STATE_READY;
if (!svm_fifo_is_empty (s->server_rx_fifo))
- {
- app_worker_t *app;
- app = app_worker_get (s->app_wrk_index);
- app_worker_send_event (app, s, FIFO_EVENT_APP_RX);
- }
+ app_worker_lock_and_send_event (app_wrk, s, FIFO_EVENT_APP_RX);
}
}