diff options
author | Florin Coras <fcoras@cisco.com> | 2021-05-08 15:29:50 -0700 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2021-05-10 14:38:36 +0000 |
commit | 0d31b9cb9f069f70592a83f95a7e63fab79719f6 (patch) | |
tree | 7235ba41b0ce9d24e9f5be3f7bb2d87770a297b8 | |
parent | 9314ed82155637d39e50a68c3119cd09dce8b0c3 (diff) |
svm: try chunk alloc only if enough space available
Type: fix
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I3c52dd783601d50e981f75bd05a7b95c03bb5c22
-rw-r--r-- | src/svm/fifo_segment.c | 3 |
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)) |