From 94a6df005d9e94f3b836ad3c93d1464b4a840499 Mon Sep 17 00:00:00 2001 From: Florin Coras Date: Thu, 6 May 2021 15:32:14 -0700 Subject: session: connects seg manager is always first By convention, connects segment manager will be first. Therefore it will be the one with the first segment wherein lies the app's message queue. Saves us the trouble of allocating it on first connect, if app started by listening, and we no longer need to track if it's assignable to a listener or if it can be removed. Type: improvement Signed-off-by: Florin Coras Change-Id: Iba9a8ffaab618eeb41ec2144dcfee62d006dc7a2 --- src/plugins/unittest/session_test.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/plugins/unittest/session_test.c') diff --git a/src/plugins/unittest/session_test.c b/src/plugins/unittest/session_test.c index cd99b0c5416..ad9c976f49e 100644 --- a/src/plugins/unittest/session_test.c +++ b/src/plugins/unittest/session_test.c @@ -337,6 +337,9 @@ session_test_endpoint_cfg (vlib_main_t * vm, unformat_input_t * input) attach_args.name = format (0, "session_test_server"); attach_args.namespace_id = appns_id; + /* Allow server to allocate another segment for listens. Needed + * because by default we do not allow segment additions */ + attach_args.options[APP_OPTIONS_ADD_SEGMENT_SIZE] = 32 << 20; attach_args.options[APP_OPTIONS_NAMESPACE_SECRET] = placeholder_secret; error = vnet_application_attach (&attach_args); SESSION_TEST ((error == 0), "server app attached: %U", format_clib_error, @@ -1839,7 +1842,7 @@ session_test_mq_speed (vlib_main_t * vm, unformat_input_t * input) SESSION_TEST (prod_fd != -1, "mq producer eventd valid %u", prod_fd); } - sm = app_worker_get_or_alloc_connect_segment_manager (app_wrk); + sm = app_worker_get_connect_segment_manager (app_wrk); segment_manager_alloc_session_fifos (sm, 0, &rx_fifo, &tx_fifo); s.rx_fifo = rx_fifo; s.tx_fifo = tx_fifo; -- cgit 1.2.3-korg