summaryrefslogtreecommitdiffstats
path: root/src/vnet/session/application.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2021-05-06 15:32:14 -0700
committerDamjan Marion <dmarion@me.com>2021-05-07 10:46:20 +0000
commit94a6df005d9e94f3b836ad3c93d1464b4a840499 (patch)
treec55259ac6ce0e373abf7633353c29ad74e305b26 /src/vnet/session/application.c
parentbd376a8ce8425f45b23074398949e8055de29280 (diff)
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 <fcoras@cisco.com> Change-Id: Iba9a8ffaab618eeb41ec2144dcfee62d006dc7a2
Diffstat (limited to 'src/vnet/session/application.c')
-rw-r--r--src/vnet/session/application.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/vnet/session/application.c b/src/vnet/session/application.c
index 2f6bfa97892..8abec7797ec 100644
--- a/src/vnet/session/application.c
+++ b/src/vnet/session/application.c
@@ -1008,7 +1008,7 @@ application_alloc_worker_and_init (application_t * app, app_worker_t ** wrk)
/*
* Setup app worker
*/
- app_wrk->first_segment_manager = segment_manager_index (sm);
+ app_wrk->connects_seg_manager = segment_manager_index (sm);
app_wrk->listeners_table = hash_create (0, sizeof (u64));
app_wrk->event_queue = segment_manager_event_queue (sm);
app_wrk->app_is_builtin = application_is_builtin (app);
@@ -1041,7 +1041,7 @@ vnet_app_worker_add_del (vnet_app_worker_add_del_args_t * a)
app_wrk->api_client_index = a->api_client_index;
application_api_table_add (app->app_index, a->api_client_index);
- sm = segment_manager_get (app_wrk->first_segment_manager);
+ sm = segment_manager_get (app_wrk->connects_seg_manager);
fs = segment_manager_get_segment_w_lock (sm, 0);
a->segment = &fs->ssvm;
a->segment_handle = segment_manager_segment_handle (sm, fs);
@@ -1157,7 +1157,7 @@ vnet_application_attach (vnet_app_attach_args_t * a)
a->app_evt_q = app_wrk->event_queue;
app_wrk->api_client_index = a->api_client_index;
- sm = segment_manager_get (app_wrk->first_segment_manager);
+ sm = segment_manager_get (app_wrk->connects_seg_manager);
fs = segment_manager_get_segment_w_lock (sm, 0);
if (application_is_proxy (app))
@@ -1165,7 +1165,7 @@ vnet_application_attach (vnet_app_attach_args_t * a)
application_setup_proxy (app);
/* The segment manager pool is reallocated because a new listener
* is added. Re-grab segment manager to avoid dangling reference */
- sm = segment_manager_get (app_wrk->first_segment_manager);
+ sm = segment_manager_get (app_wrk->connects_seg_manager);
}
ASSERT (vec_len (fs->ssvm.name) <= 128);