From b3d93dacfde8ab21bbce171fff2971b2ed7bce6a Mon Sep 17 00:00:00 2001 From: Dave Barach Date: Wed, 3 Aug 2016 14:34:38 -0400 Subject: VPP-236 Support 64-bit vector lengths, shared memory segments >4 GB Change-Id: I02aee33e96e7ae32094b9f82f6a667d30bb52f59 Signed-off-by: Dave Barach --- vpp/vpp-api/api.c | 29 +++++++++++++++++++++++++++-- vpp/vpp-api/gmon.c | 4 ++-- 2 files changed, 29 insertions(+), 4 deletions(-) (limited to 'vpp') diff --git a/vpp/vpp-api/api.c b/vpp/vpp-api/api.c index 8a341597..ee3ced43 100644 --- a/vpp/vpp-api/api.c +++ b/vpp/vpp-api/api.c @@ -8111,7 +8111,8 @@ VLIB_INIT_FUNCTION (vpe_api_init); static clib_error_t * api_segment_config (vlib_main_t * vm, unformat_input_t * input) { - u8 *chroot_path; + u8 * chroot_path; + u64 baseva, size, pvt_heap_size; int uid, gid, rv; const int max_buf_size = 4096; char *s, *buf; @@ -8129,7 +8130,31 @@ api_segment_config (vlib_main_t * vm, unformat_input_t * input) else if (unformat (input, "uid %d", &uid)) vl_set_memory_uid (uid); else if (unformat (input, "gid %d", &gid)) - vl_set_memory_gid (gid); + vl_set_memory_gid (gid); + else if (unformat (input, "baseva %llx", &baseva)) + vl_set_global_memory_baseva (baseva); + else if (unformat (input, "global-size %lldM", &size)) + vl_set_global_memory_size (size * (1ULL<<20)); + else if (unformat (input, "global-size %lldG", &size)) + vl_set_global_memory_size (size * (1ULL<<30)); + else if (unformat (input, "global-size %lld", &size)) + vl_set_global_memory_size (size); + else if (unformat (input, "global-pvt-heap-size %lldM", &pvt_heap_size)) + vl_set_global_pvt_heap_size (pvt_heap_size * (1ULL<<20)); + else if (unformat (input, "global-pvt-heap-size size %lld", + &pvt_heap_size)) + vl_set_global_pvt_heap_size (pvt_heap_size); + else if (unformat (input, "api-pvt-heap-size %lldM", &pvt_heap_size)) + vl_set_api_pvt_heap_size (pvt_heap_size * (1ULL<<20)); + else if (unformat (input, "api-pvt-heap-size size %lld", + &pvt_heap_size)) + vl_set_api_pvt_heap_size (pvt_heap_size); + else if (unformat (input, "api-size %lldM", &size)) + vl_set_api_memory_size (size * (1ULL<<20)); + else if (unformat (input, "api-size %lldG", &size)) + vl_set_api_memory_size (size * (1ULL<<30)); + else if (unformat (input, "api-size %lld", &size)) + vl_set_api_memory_size (size); else if (unformat (input, "uid %s", &s)) { /* lookup the username */ diff --git a/vpp/vpp-api/gmon.c b/vpp/vpp-api/gmon.c index ea4a25ef..330dc9fe 100644 --- a/vpp/vpp-api/gmon.c +++ b/vpp/vpp-api/gmon.c @@ -180,8 +180,8 @@ gmon_init (vlib_main_t * vm) if ((error = vlib_call_init_function (vm, vpe_api_init))) return (error); - /* Make sure that /global-vm is owned as directed */ - svm_region_init_chroot_uid_gid (am->root_path, am->api_uid, am->api_gid); + if ((error = vlib_call_init_function(vm, vlibmemory_init))) + return(error); gm->vlib_main = vm; -- cgit 1.2.3-korg