summaryrefslogtreecommitdiffstats
path: root/src/svm/fifo_segment.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2021-05-08 15:29:50 -0700
committerDave Barach <openvpp@barachs.net>2021-05-10 14:38:36 +0000
commit0d31b9cb9f069f70592a83f95a7e63fab79719f6 (patch)
tree7235ba41b0ce9d24e9f5be3f7bb2d87770a297b8 /src/svm/fifo_segment.c
parent9314ed82155637d39e50a68c3119cd09dce8b0c3 (diff)
svm: try chunk alloc only if enough space available
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I3c52dd783601d50e981f75bd05a7b95c03bb5c22
Diffstat (limited to 'src/svm/fifo_segment.c')
-rw-r--r--src/svm/fifo_segment.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/svm/fifo_segment.c b/src/svm/fifo_segment.c
index cde906fe799..d8b3b259038 100644
--- a/src/svm/fifo_segment.c
+++ b/src/svm/fifo_segment.c
@@ -694,7 +694,8 @@ free_list:
if (data_bytes <= fss_fl_chunk_bytes (fss) + n_free)
{
u32 min_size = FIFO_SEGMENT_MIN_FIFO_SIZE;
-
+ if (n_free < min_size)
+ goto done;
batch = (data_bytes - fss_fl_chunk_bytes (fss)) / min_size;
batch = clib_min (batch + 1, n_free / min_size);
if (fsh_try_alloc_chunk_batch (fsh, fss, 0, batch))