diff options
author | Nathan Skrzypczak <nathan.skrzypczak@gmail.com> | 2019-11-07 17:55:01 +0100 |
---|---|---|
committer | Andrew Yourtchenko <ayourtch@gmail.com> | 2020-08-07 21:45:43 +0000 |
commit | 59502edc4f4b71168f9c209409550dd4d952c8e8 (patch) | |
tree | 761cb70be59c10c5efdd02c1f4c1b2011495afb1 /src/vnet | |
parent | 215c55ad6d08b41c8ab4e9d45825456e930d7db0 (diff) |
session: session enable in multiworker
Having session enable in config file wasn't
working for multiple workers
Type: fix
Change-Id: Ib29ba540a6e1d714e7e470f4c7518e3d266fe7ca
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
(cherry picked from commit 31bd035621bdc57deb757613b534bd6c2b032814)
Diffstat (limited to 'src/vnet')
-rw-r--r-- | src/vnet/session/session.c | 17 | ||||
-rw-r--r-- | src/vnet/session/session.h | 2 |
2 files changed, 18 insertions, 1 deletions
diff --git a/src/vnet/session/session.c b/src/vnet/session/session.c index c6e64544623..c0863007a51 100644 --- a/src/vnet/session/session.c +++ b/src/vnet/session/session.c @@ -1634,10 +1634,25 @@ session_manager_main_init (vlib_main_t * vm) smm->evt_qs_segment_size = 1 << 20; #endif smm->is_enabled = 0; + smm->session_enable_asap = 0; + return 0; +} + +static clib_error_t * +session_main_init (vlib_main_t * vm) +{ + session_main_t *smm = &session_main; + if (smm->session_enable_asap) + { + vlib_worker_thread_barrier_sync (vm); + vnet_session_enable_disable (vm, 1 /* is_en */ ); + vlib_worker_thread_barrier_release (vm); + } return 0; } VLIB_INIT_FUNCTION (session_manager_main_init); +VLIB_MAIN_LOOP_ENTER_FUNCTION (session_main_init); static clib_error_t * session_config_fn (vlib_main_t * vm, unformat_input_t * input) @@ -1719,7 +1734,7 @@ session_config_fn (vlib_main_t * vm, unformat_input_t * input) &smm->evt_qs_segment_size)) ; else if (unformat (input, "enable")) - vnet_session_enable_disable (vm, 1 /* is_en */ ); + smm->session_enable_asap = 1; else return clib_error_return (0, "unknown input `%U'", format_unformat_error, input); diff --git a/src/vnet/session/session.h b/src/vnet/session/session.h index 34dab61631b..7b7addb0fb8 100644 --- a/src/vnet/session/session.h +++ b/src/vnet/session/session.h @@ -166,6 +166,8 @@ typedef struct session_main_ /** Session manager is enabled */ u8 is_enabled; + /** Enable session manager at startup */ + u8 session_enable_asap; /** vpp fifo event queue configured length */ u32 configured_event_queue_length; |