aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/session/segment_manager.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2020-09-29 19:18:46 -0700
committerFlorin Coras <florin.coras@gmail.com>2020-09-30 22:02:56 +0000
commita107f4039e74ea030ebd40e7a9920ac62855e3e0 (patch)
tree378f4ae86d9c67bb2f7a1d2cc1567856163b1104 /src/vnet/session/segment_manager.c
parent5220a26af059d7578abcbad2aea158b32cdb22b9 (diff)
session: init size and watermarks on all seg managers
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I0cfe04277d80d9c81499651f893fb2d126ac8c85
Diffstat (limited to 'src/vnet/session/segment_manager.c')
-rw-r--r--src/vnet/session/segment_manager.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/src/vnet/session/segment_manager.c b/src/vnet/session/segment_manager.c
index d734d64172e..53be0bfdd76 100644
--- a/src/vnet/session/segment_manager.c
+++ b/src/vnet/session/segment_manager.c
@@ -333,21 +333,12 @@ segment_manager_alloc (void)
return sm;
}
-/**
- * Initializes segment manager based on options provided.
- * Returns error if ssvm segment(s) allocation fails.
- */
int
segment_manager_init (segment_manager_t * sm)
{
segment_manager_props_t *props;
- uword first_seg_size;
- fifo_segment_t *fs;
- int fs_index, i;
props = segment_manager_properties_get (sm);
- first_seg_size = clib_max (props->segment_size,
- sm_main.default_segment_size);
sm->max_fifo_size = props->max_fifo_size ?
props->max_fifo_size : sm_main.default_max_fifo_size;
@@ -356,6 +347,25 @@ segment_manager_init (segment_manager_t * sm)
segment_manager_set_watermarks (sm,
props->high_watermark,
props->low_watermark);
+ return 0;
+}
+
+/**
+ * Initializes segment manager based on options provided.
+ * Returns error if ssvm segment(s) allocation fails.
+ */
+int
+segment_manager_init_first (segment_manager_t * sm)
+{
+ segment_manager_props_t *props;
+ uword first_seg_size;
+ fifo_segment_t *fs;
+ int fs_index, i;
+
+ segment_manager_init (sm);
+ props = segment_manager_properties_get (sm);
+ first_seg_size = clib_max (props->segment_size,
+ sm_main.default_segment_size);
if (props->prealloc_fifos)
{