summaryrefslogtreecommitdiffstats
path: root/src/svm/ssvm.c
diff options
context:
space:
mode:
authorJunfeng Wang <drenfong.wang@intel.com>2022-08-12 16:24:46 +0800
committerFlorin Coras <florin.coras@gmail.com>2022-09-15 23:15:26 +0000
commitc795b8836d83b4b062aa21423f842aa765269c2c (patch)
tree9c7f9835da485443b4a43477e706178661399bdd /src/svm/ssvm.c
parent0654242d1ef51566f0d58445a16053cf376e5a6e (diff)
vcl: add hugepage for vcl configure and svm
add hugepage for vcl configure and svm Type: feature Signed-off-by: Junfeng Wang <drenfong.wang@intel.com> Change-Id: I6a8905e3fec23d840e629114b1e5a403d0a258ef
Diffstat (limited to 'src/svm/ssvm.c')
-rw-r--r--src/svm/ssvm.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/svm/ssvm.c b/src/svm/ssvm.c
index 9cdde128561..bf0a1361e4a 100644
--- a/src/svm/ssvm.c
+++ b/src/svm/ssvm.c
@@ -227,8 +227,12 @@ ssvm_server_init_memfd (ssvm_private_t * memfd)
ASSERT (vec_c_string_is_terminated (memfd->name));
- memfd->fd = clib_mem_vm_create_fd (CLIB_MEM_PAGE_SZ_DEFAULT,
- (char *) memfd->name);
+ if (memfd->huge_page)
+ memfd->fd = clib_mem_vm_create_fd (CLIB_MEM_PAGE_SZ_DEFAULT_HUGE,
+ (char *) memfd->name);
+ else
+ memfd->fd =
+ clib_mem_vm_create_fd (CLIB_MEM_PAGE_SZ_DEFAULT, (char *) memfd->name);
if (memfd->fd == CLIB_MEM_ERROR)
{
@@ -270,7 +274,7 @@ ssvm_server_init_memfd (ssvm_private_t * memfd)
sh->ssvm_va = pointer_to_uword (sh);
sh->type = SSVM_SEGMENT_MEMFD;
- page_size = 1ULL << log2_page_size;
+ page_size = clib_mem_get_page_size ();
sh->heap = clib_mem_create_heap (((u8 *) sh) + page_size,
memfd->ssvm_size - page_size,
1 /* locked */ , "ssvm server memfd");