aboutsummaryrefslogtreecommitdiffstats
path: root/src/vlibmemory/memory_shared.c
diff options
context:
space:
mode:
authorJan Srnicek <jsrnicek@cisco.com>2017-03-24 10:18:11 +0100
committerJan Srnicek <jsrnicek@cisco.com>2017-08-14 12:19:31 +0000
commit5beec81360146536086f1996869b4ee32ca37ddc (patch)
treed82ccff22185b5c23c3eb624bbaa53f68abcd84b /src/vlibmemory/memory_shared.c
parent0117d24a1f6d018933c8f3e4ecca269f57f431ab (diff)
jvpp: make shm_prefix configurable (VPP-591)
svm.c - set default map region root path only if root path is not already present memory_shared.c - added option for tests to send memory region name and root path in one variable, if so name and root path are separated here and set to map region structure so find function can find it properly jvpp-registry.c - added parameters shmPrefix to be able pass + removed sudo restriction specific shared memory prefix that is used while starting python tests(see framework.py) JVppRegistyImpl - added option to specify shmPrefix VppJNIConnection - added option to specify shmPrefix Change-Id: I3f89f867fb9b20eef00fbd497cb0e41b25d6eab7 Signed-off-by: Jan Srnicek <jsrnicek@cisco.com> Signed-off-by: Matej Perina <mperina@cisco.com>
Diffstat (limited to 'src/vlibmemory/memory_shared.c')
-rw-r--r--src/vlibmemory/memory_shared.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/vlibmemory/memory_shared.c b/src/vlibmemory/memory_shared.c
index 41aa1231f6c..9bab65730ef 100644
--- a/src/vlibmemory/memory_shared.c
+++ b/src/vlibmemory/memory_shared.c
@@ -341,12 +341,25 @@ vl_map_shmem (const char *region_name, int is_vlib)
struct timespec ts, tsrem;
u32 vlib_input_queue_length;
+ memset (a, 0, sizeof (*a));
+
+ if (strstr (region_name, "-vpe-api"))
+ {
+ char root_path[strlen (region_name)];
+ strncpy (root_path, region_name, strlen (region_name) - 8);
+ a->root_path = root_path;
+ am->root_path = root_path;
+ }
+
if (is_vlib == 0)
svm_region_init_chroot (am->root_path);
- memset (a, 0, sizeof (*a));
-
- a->name = region_name;
+ if (a->root_path != NULL)
+ {
+ a->name = "/vpe-api";
+ }
+ else
+ a->name = region_name;
a->size = am->api_size ? am->api_size : (16 << 20);
a->flags = SVM_FLAGS_MHEAP;
a->uid = am->api_uid;