aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/session/session_node.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-08-31 14:31:41 -0700
committerDamjan Marion <dmarion@me.com>2018-09-06 08:35:51 +0000
commitab2f6dbf9f7b7164a9810f4c80c8abf8463e42ad (patch)
tree7fb4dd4c70bef17f09a88130eeadeeca86b6d09c /src/vnet/session/session_node.c
parented234e7f151b05a5b8375dbd9f0add24fe8ebf2f (diff)
session: support multiple worker binds
Allows app workers to listen on the same session endpoint. Incoming connects are spread across the workers in a round-robin fashion Change-Id: Ib5f5817230d9abc6127a85cdbdcad70d980c0f7f 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.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/vnet/session/session_node.c b/src/vnet/session/session_node.c
index 2c425abeaf3..119cdd812ad 100644
--- a/src/vnet/session/session_node.c
+++ b/src/vnet/session/session_node.c
@@ -43,10 +43,19 @@ 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 || ls->app_wrk_index != mp->context)
+ if (!ls)
{
- clib_warning ("server %u doesn't own local handle %llu",
+ clib_warning ("unknown local handle 0x%lx", mp->handle);
+ return;
+ }
+ app_wrk = app_worker_get (ls->app_wrk_index);
+ app = application_get (app_wrk->app_index);
+ if (app->app_index != mp->context)
+ {
+ clib_warning ("server %u doesn't own local handle 0x%lx",
mp->context, mp->handle);
return;
}
@@ -72,7 +81,7 @@ session_mq_accepted_reply_handler (void *data)
{
app_worker_t *app;
app = app_worker_get (s->app_wrk_index);
- application_send_event (app, s, FIFO_EVENT_APP_RX);
+ app_worker_send_event (app, s, FIFO_EVENT_APP_RX);
}
}
}
@@ -726,7 +735,7 @@ session_tx_fifo_dequeue_internal (vlib_main_t * vm,
stream_session_t * s, int *n_tx_pkts)
{
application_t *app;
- app = application_get (s->opaque);
+ app = application_get (s->t_app_index);
svm_fifo_unset_event (s->server_tx_fifo);
return app->cb_fns.builtin_app_tx_callback (s);
}