summaryrefslogtreecommitdiffstats
path: root/src/svm/svm_fifo.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2020-02-02 19:30:39 +0000
committerDave Barach <openvpp@barachs.net>2020-02-25 19:18:49 +0000
commit2de9c0f92bb486072d8371a24d9b23fd85e1aa80 (patch)
treea152a70c5df089ff4a8ea2b7cabab75daa0c712e /src/svm/svm_fifo.c
parentd8f48e2166747b529aa23762ac314dd686590c89 (diff)
svm: minimal initial fifo
Type: refactor Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I4ee46a6c3c53c58199c275e20702f7fd11b60d9a
Diffstat (limited to 'src/svm/svm_fifo.c')
-rw-r--r--src/svm/svm_fifo.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/svm/svm_fifo.c b/src/svm/svm_fifo.c
index 0168c08e49c..971eda351d5 100644
--- a/src/svm/svm_fifo.c
+++ b/src/svm/svm_fifo.c
@@ -368,7 +368,7 @@ void
svm_fifo_init (svm_fifo_t * f, u32 size)
{
svm_fifo_chunk_t *c, *prev;
- u32 first_chunk, min_alloc;
+ u32 min_alloc;
f->size = size;
f->ooos_list_head = OOO_SEGMENT_INVALID_INDEX;
@@ -378,9 +378,8 @@ svm_fifo_init (svm_fifo_t * f, u32 size)
f->head_chunk = f->tail_chunk = f->start_chunk;
f->ooo_deq = f->ooo_enq = 0;
- first_chunk = f->start_chunk->length;
- min_alloc = first_chunk > 16 << 10 ? first_chunk >> 2 : 4096;
- min_alloc = clib_min (first_chunk, 64 << 10);
+ min_alloc = size > 32 << 10 ? size >> 3 : 4096;
+ min_alloc = clib_min (min_alloc, 64 << 10);
f->min_alloc = min_alloc;
/*