aboutsummaryrefslogtreecommitdiffstats
path: root/src/svm
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2020-03-05 19:44:02 +0000
committerFlorin Coras <fcoras@cisco.com>2020-03-05 19:50:15 +0000
commit75ccf7b5c51c170da45fb52bd62a6d621923f245 (patch)
tree09cd03933fd2f237ebe49f750ab795d44ff13504 /src/svm
parentb4e5e50fe898bf905aa7087e17740394b97e5cf9 (diff)
session: fix segment search on fifo alloc
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Iaa4f9b0ec31a58f7406774f73e1a089bfcf4ac30
Diffstat (limited to 'src/svm')
-rw-r--r--src/svm/fifo_segment.c6
-rw-r--r--src/svm/fifo_segment.h2
2 files changed, 8 insertions, 0 deletions
diff --git a/src/svm/fifo_segment.c b/src/svm/fifo_segment.c
index d711c87c88c..39856a1a333 100644
--- a/src/svm/fifo_segment.c
+++ b/src/svm/fifo_segment.c
@@ -1134,6 +1134,12 @@ fifo_segment_cached_bytes (fifo_segment_t * fs)
}
uword
+fifo_segment_available_bytes (fifo_segment_t * fs)
+{
+ return fsh_n_free_bytes (fs->h) + fsh_n_cached_bytes (fs->h);
+}
+
+uword
fifo_segment_fl_chunk_bytes (fifo_segment_t * fs)
{
fifo_segment_header_t *fsh = fs->h;
diff --git a/src/svm/fifo_segment.h b/src/svm/fifo_segment.h
index 00914e6c227..2e193029e85 100644
--- a/src/svm/fifo_segment.h
+++ b/src/svm/fifo_segment.h
@@ -243,6 +243,8 @@ void fifo_segment_update_free_bytes (fifo_segment_t * fs);
*/
uword fifo_segment_cached_bytes (fifo_segment_t * fs);
+uword fifo_segment_available_bytes (fifo_segment_t * fs);
+
/**
* Number of bytes on chunk free lists
*