props->low_watermark = opts[APP_OPTIONS_LOW_WATERMARK];
if (opts[APP_OPTIONS_PCT_FIRST_ALLOC])
props->pct_first_alloc = opts[APP_OPTIONS_PCT_FIRST_ALLOC];
+ if (opts[APP_OPTIONS_MAX_FIFO_MEMORY])
+ {
+ /* Round upwards to nearest segment_size */
+ props->max_segments =
+ (opts[APP_OPTIONS_MAX_FIFO_MEMORY] + props->segment_size - 1) /
+ props->segment_size;
+ }
props->segment_type = seg_type;
if (opts[APP_OPTIONS_FLAGS] & APP_OPTIONS_FLAGS_EVT_COLLECTOR)
s = format (s, "app-name %v app-index %u ns-index %u seg-size %U\n",
app_name, app->app_index, app->ns_index,
format_memory_size, props->add_segment_size);
- s = format (s, "rx-fifo-size %U tx-fifo-size %U workers:\n",
- format_memory_size, props->rx_fifo_size,
- format_memory_size, props->tx_fifo_size);
+ s =
+ format (s, "rx-fifo-size %U tx-fifo-size %U max-fifo-memory %U workers:\n",
+ format_memory_size, props->rx_fifo_size, format_memory_size,
+ props->tx_fifo_size, format_memory_size,
+ props->max_segments * props->segment_size);
pool_foreach (wrk_map, app->worker_maps) {
app_wrk = app_worker_get (wrk_map->wrk_index);
APP_OPTIONS_EVT_QUEUE_SIZE,
APP_OPTIONS_SEGMENT_SIZE,
APP_OPTIONS_ADD_SEGMENT_SIZE,
- APP_OPTIONS_UNUSED1,
+ APP_OPTIONS_MAX_FIFO_MEMORY,
APP_OPTIONS_RX_FIFO_SIZE,
APP_OPTIONS_TX_FIFO_SIZE,
APP_OPTIONS_PREALLOC_FIFO_PAIRS,
u8 low_watermark; /**< memory usage low watermark % */
u8 pct_first_alloc; /**< pct of fifo size to alloc */
u8 huge_page; /**< use hugepage */
+ u32 max_segments; /**< max number of segments, 0 for unlimited */
} segment_manager_props_t;
#define foreach_seg_manager_flag \