aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/session
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/session')
-rw-r--r--src/vnet/session/application.c2
-rw-r--r--src/vnet/session/application_interface.h1
-rw-r--r--src/vnet/session/segment_manager.c1
-rw-r--r--src/vnet/session/segment_manager.h1
-rw-r--r--src/vnet/session/session.api4
5 files changed, 7 insertions, 2 deletions
diff --git a/src/vnet/session/application.c b/src/vnet/session/application.c
index 7777c7275b3..7923d2d050e 100644
--- a/src/vnet/session/application.c
+++ b/src/vnet/session/application.c
@@ -556,6 +556,8 @@ application_alloc_and_init (app_init_args_t * a)
props->high_watermark = options[APP_OPTIONS_HIGH_WATERMARK];
if (options[APP_OPTIONS_LOW_WATERMARK])
props->low_watermark = options[APP_OPTIONS_LOW_WATERMARK];
+ if (options[APP_OPTIONS_PCT_FIRST_ALLOC])
+ props->pct_first_alloc = options[APP_OPTIONS_PCT_FIRST_ALLOC];
props->segment_type = seg_type;
/* Add app to lookup by api_client_index table */
diff --git a/src/vnet/session/application_interface.h b/src/vnet/session/application_interface.h
index 2ecabb03204..bf946769028 100644
--- a/src/vnet/session/application_interface.h
+++ b/src/vnet/session/application_interface.h
@@ -208,6 +208,7 @@ typedef enum
APP_OPTIONS_MAX_FIFO_SIZE,
APP_OPTIONS_HIGH_WATERMARK,
APP_OPTIONS_LOW_WATERMARK,
+ APP_OPTIONS_PCT_FIRST_ALLOC,
APP_OPTIONS_N_OPTIONS
} app_attach_options_index_t;
diff --git a/src/vnet/session/segment_manager.c b/src/vnet/session/segment_manager.c
index eb3f63c9a6c..db38097602c 100644
--- a/src/vnet/session/segment_manager.c
+++ b/src/vnet/session/segment_manager.c
@@ -171,6 +171,7 @@ segment_manager_add_segment (segment_manager_t * sm, uword segment_size)
*/
fs->h->high_watermark = sm->high_watermark;
fs->h->low_watermark = sm->low_watermark;
+ fs->h->pct_first_alloc = props->pct_first_alloc;
fs->h->flags &= ~FIFO_SEGMENT_F_MEM_LIMIT;
done:
diff --git a/src/vnet/session/segment_manager.h b/src/vnet/session/segment_manager.h
index 688711a3312..cd02d5480ae 100644
--- a/src/vnet/session/segment_manager.h
+++ b/src/vnet/session/segment_manager.h
@@ -38,6 +38,7 @@ typedef struct _segment_manager_props
u32 max_fifo_size; /**< max fifo size */
u8 high_watermark; /**< memory usage high watermark % */
u8 low_watermark; /**< memory usage low watermark % */
+ u8 pct_first_alloc; /**< pct of fifo size to alloc */
} segment_manager_props_t;
typedef struct _segment_manager
diff --git a/src/vnet/session/session.api b/src/vnet/session/session.api
index 4f9ae12eeb3..8cfac3d048d 100644
--- a/src/vnet/session/session.api
+++ b/src/vnet/session/session.api
@@ -29,7 +29,7 @@ option version = "1.7.0";
u32 client_index;
u32 context;
u32 initial_segment_size;
- u64 options[16];
+ u64 options[17];
u8 namespace_id_len;
u8 namespace_id [64];
};
@@ -72,7 +72,7 @@ define application_attach_reply {
define app_attach {
u32 client_index;
u32 context;
- u64 options[16];
+ u64 options[17];
u8 namespace_id_len;
u8 namespace_id[64];
};