diff options
author | 2016-08-03 14:34:38 -0400 | |
---|---|---|
committer | 2016-08-15 13:57:25 +0000 | |
commit | b3d93dacfde8ab21bbce171fff2971b2ed7bce6a (patch) | |
tree | 8d3b44e8a8fcbf155979114a929590fc9473b914 /vlib-api/vlibmemory/memory_shared.c | |
parent | c53191deb39231cf8408cf9eb0adf5c878ddda68 (diff) |
VPP-236 Support 64-bit vector lengths, shared memory segments >4 GB
Change-Id: I02aee33e96e7ae32094b9f82f6a667d30bb52f59
Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'vlib-api/vlibmemory/memory_shared.c')
-rw-r--r-- | vlib-api/vlibmemory/memory_shared.c | 43 |
1 files changed, 42 insertions, 1 deletions
diff --git a/vlib-api/vlibmemory/memory_shared.c b/vlib-api/vlibmemory/memory_shared.c index 53976fbe..a2f22771 100644 --- a/vlib-api/vlibmemory/memory_shared.c +++ b/vlib-api/vlibmemory/memory_shared.c @@ -228,6 +228,46 @@ vl_set_memory_gid (int gid) am->api_gid = gid; } +void +vl_set_global_memory_baseva (u64 baseva) +{ + api_main_t *am = &api_main; + + am->global_baseva = baseva; +} + +void +vl_set_global_memory_size (u64 size) +{ + api_main_t *am = &api_main; + + am->global_size = size; +} + +void +vl_set_api_memory_size (u64 size) +{ + api_main_t *am = &api_main; + + am->api_size = size; +} + +void +vl_set_global_pvt_heap_size (u64 size) +{ + api_main_t *am = &api_main; + + am->global_pvt_heap_size = size; +} + +void +vl_set_api_pvt_heap_size (u64 size) +{ + api_main_t *am = &api_main; + + am->api_pvt_heap_size = size; +} + int vl_map_shmem (char *region_name, int is_vlib) { @@ -245,10 +285,11 @@ vl_map_shmem (char *region_name, int is_vlib) memset (a, 0, sizeof (*a)); a->name = region_name; - a->size = 16 << 20; + a->size = am->api_size ? am->api_size: (16 << 20); a->flags = SVM_FLAGS_MHEAP; a->uid = am->api_uid; a->gid = am->api_gid; + a->pvt_heap_size = am->api_pvt_heap_size; vlib_rp = svm_region_find_or_create (a); |