svm: try chunk alloc only if enough space available 60/32260/3
authorFlorin Coras <fcoras@cisco.com>
Sat, 8 May 2021 22:29:50 +0000 (15:29 -0700)
committerDave Barach <openvpp@barachs.net>
Mon, 10 May 2021 14:38:36 +0000 (14:38 +0000)
Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I3c52dd783601d50e981f75bd05a7b95c03bb5c22

src/svm/fifo_segment.c

index cde906f..d8b3b25 100644 (file)
@@ -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))