summaryrefslogtreecommitdiffstats
path: root/src/vnet/session/application_interface.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-01-31 06:52:17 -0800
committerDave Barach <openvpp@barachs.net>2018-02-05 21:45:28 +0000
commita332c46a51f9b4e13963340dfee1318e7513c124 (patch)
treefde1056972c5b164987bd15ce0530a3d48d1bbd7 /src/vnet/session/application_interface.c
parente71eb5922a293eca36dbd323970741daaca3c5c7 (diff)
session: segment manager refactor
- use valloc as a 'central' segment baseva manager - use per segment manager segment pools and use rwlocks to guard them - add session test that exercises segment creation - embed segment manager properties into application since they're shared - fix rw locks Change-Id: I761164c147275d9e8a926f1eda395e090d231f9a Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/session/application_interface.c')
-rw-r--r--src/vnet/session/application_interface.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/vnet/session/application_interface.c b/src/vnet/session/application_interface.c
index ad4c28b3c77..efdd3dde9ad 100644
--- a/src/vnet/session/application_interface.c
+++ b/src/vnet/session/application_interface.c
@@ -406,7 +406,7 @@ vnet_application_attach (vnet_app_attach_args_t * a)
a->app_event_queue_address = pointer_to_uword (app->event_queue);
sm = segment_manager_get (app->first_segment_manager);
- fs = segment_manager_get_segment (sm->segment_indices[0]);
+ fs = segment_manager_get_segment_w_lock (sm, 0);
if (application_is_proxy (app))
application_setup_proxy (app);
@@ -415,6 +415,8 @@ vnet_application_attach (vnet_app_attach_args_t * a)
a->segment = &fs->ssvm;
a->app_index = app->index;
+ segment_manager_segment_reader_unlock (sm);
+
return 0;
}