aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/session/session.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2019-07-31 16:46:24 -0700
committerFlorin Coras <florin.coras@gmail.com>2019-08-01 22:50:09 +0000
commit49568afd2096600f5d6745385d81d873c8893e29 (patch)
tree7b8a43fbb76c9084986157351972b0f4cb251b17 /src/vnet/session/session.c
parent4f9446444d0c718886570626d6e7a25d07610f1b (diff)
session: session pool migration notification
Type: feature Change-Id: Ia9a5b1a6d85c7f3f2e6db583b33b5b20029a1e88 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/session/session.c')
-rw-r--r--src/vnet/session/session.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/vnet/session/session.c b/src/vnet/session/session.c
index 318e01dbf54..3d22cc27ef4 100644
--- a/src/vnet/session/session.c
+++ b/src/vnet/session/session.c
@@ -715,17 +715,32 @@ typedef struct _session_switch_pool_args
u32 new_session_index;
} session_switch_pool_args_t;
+/**
+ * Notify old thread of the session pool switch
+ */
static void
session_switch_pool (void *cb_args)
{
session_switch_pool_args_t *args = (session_switch_pool_args_t *) cb_args;
+ app_worker_t *app_wrk;
session_t *s;
+
ASSERT (args->thread_index == vlib_get_thread_index ());
s = session_get (args->session_index, args->thread_index);
s->tx_fifo->master_session_index = args->new_session_index;
s->tx_fifo->master_thread_index = args->new_thread_index;
transport_cleanup (session_get_transport_proto (s), s->connection_index,
s->thread_index);
+
+ app_wrk = app_worker_get_if_valid (s->app_wrk_index);
+ if (app_wrk)
+ {
+ session_handle_t new_sh;
+ new_sh = session_make_handle (args->new_session_index,
+ args->new_thread_index);
+ app_worker_migrate_notify (app_wrk, s, new_sh);
+ }
+
session_free (s);
clib_mem_free (cb_args);
}