aboutsummaryrefslogtreecommitdiffstats
path: root/src/svm/ssvm.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2019-05-11 16:55:53 -0700
committerDave Barach <openvpp@barachs.net>2019-05-14 18:40:20 +0000
commitf9d4ab42724b260d5c242f7291d05f74cd725d7d (patch)
treee73966462c7c8ebc36cc2d7f0147ee1f81e4ba25 /src/svm/ssvm.c
parent0224514c28bdee05ea11a89a721c810e5f99ede2 (diff)
svm: improve fifo segment prealloc support
- track fifo segment free and chunk freelist memory - improve fifo alloc. If there are enough chunks to satisfy a fifo allocation request but not enough free memory, allocate a multi-chunk fifo - add apis to preallocate chunks and fifo headers - more tests Change-Id: If18dba7ab856272c9f565d36ac36365139793e0b Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/svm/ssvm.c')
-rw-r--r--src/svm/ssvm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/svm/ssvm.c b/src/svm/ssvm.c
index 3e45175da0e..2a6e6bf78da 100644
--- a/src/svm/ssvm.c
+++ b/src/svm/ssvm.c
@@ -352,8 +352,8 @@ ssvm_master_init_private (ssvm_private_t * ssvm)
u32 rnd_size = 0;
u8 *heap;
- rnd_size = (ssvm->ssvm_size + (pagesize - 1)) & ~(pagesize - 1);
- rnd_size = clib_min (rnd_size, ((u64) 1 << 32) - pagesize);
+ rnd_size = clib_max (ssvm->ssvm_size + (pagesize - 1), ssvm->ssvm_size);
+ rnd_size &= ~(pagesize - 1);
#if USE_DLMALLOC == 0
{