diff options
author | Florin Coras <fcoras@cisco.com> | 2020-09-28 23:40:28 -0700 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2020-09-30 10:11:21 +0000 |
commit | 2a7c0b6fc027e86727c08d98b66e19ad8768c82b (patch) | |
tree | cf037f459b5620fcf4151d272b3fad3d5fa82a19 /src/vnet/session/segment_manager.c | |
parent | 5aa34d54de1e3dcdab1b74207ef8a24cc67a0f5d (diff) |
svm session: use new clib mem apis for segments
"sh memory map" now reports shared memory segments mapped by session
layer for applications.
Type: improvement
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I7debdcd06c7728abfb5cf817a1ccc37de495472c
Diffstat (limited to 'src/vnet/session/segment_manager.c')
-rw-r--r-- | src/vnet/session/segment_manager.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/vnet/session/segment_manager.c b/src/vnet/session/segment_manager.c index dbeff6e4acf..44ff5fefd70 100644 --- a/src/vnet/session/segment_manager.c +++ b/src/vnet/session/segment_manager.c @@ -138,11 +138,16 @@ segment_manager_add_segment (segment_manager_t * sm, uword segment_size) } } else - seg_name = format (0, "%s%c", "process-private", 0); + { + app_worker_t *app_wrk = app_worker_get (sm->app_wrk_index); + application_t *app = application_get (app_wrk->app_index); + seg_name = format (0, "%v segment%c", app->name, 0); + } fs->ssvm.ssvm_size = segment_size; fs->ssvm.name = seg_name; - fs->ssvm.requested_va = baseva; + /* clib_mem_vm_map_shared consumes first page before requested_va */ + fs->ssvm.requested_va = baseva + page_size; if ((rv = ssvm_master_init (&fs->ssvm, props->segment_type))) { @@ -192,7 +197,9 @@ segment_manager_del_segment (segment_manager_t * sm, fifo_segment_t * fs) if (ssvm_type (&fs->ssvm) != SSVM_SEGMENT_PRIVATE) { - clib_valloc_free (&smm->va_allocator, fs->ssvm.requested_va); + /* clib_mem_vm_map_shared consumes first page before requested_va */ + clib_valloc_free (&smm->va_allocator, + fs->ssvm.requested_va - clib_mem_get_page_size ()); if (!segment_manager_app_detached (sm)) { @@ -947,6 +954,7 @@ segment_manager_show_fn (vlib_main_t * vm, unformat_input_t * input, })); /* *INDENT-ON* */ + vlib_cli_output (vm, "\n"); } if (show_segments) { |