aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/session/segment_manager.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/session/segment_manager.c')
-rw-r--r--src/vnet/session/segment_manager.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/vnet/session/segment_manager.c b/src/vnet/session/segment_manager.c
index 14e4e219996..c14cffa66a2 100644
--- a/src/vnet/session/segment_manager.c
+++ b/src/vnet/session/segment_manager.c
@@ -127,7 +127,15 @@ segment_manager_add_segment_inline (segment_manager_t *sm, uword segment_size,
sizeof (fifo_segment_header_t) +
vlib_thread_main.n_vlib_mains * sizeof (fifo_segment_slice_t) +
FIFO_SEGMENT_ALLOC_OVERHEAD;
- segment_size = round_pow2 (segment_size, clib_mem_get_page_size ());
+
+ if (props->huge_page)
+ {
+ uword hugepage_size = clib_mem_get_default_hugepage_size ();
+ segment_size = round_pow2 (segment_size, hugepage_size);
+ fs->ssvm.huge_page = 1;
+ }
+ else
+ segment_size = round_pow2 (segment_size, clib_mem_get_page_size ());
seg_name = format (0, "seg-%u-%u-%u%c", app_wrk->app_index,
app_wrk->wrk_index, smm->seg_name_counter++, 0);