summaryrefslogtreecommitdiffstats
path: root/src/svm/fifo_segment.h
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2020-02-05 21:13:18 +0000
committerDave Barach <openvpp@barachs.net>2020-02-26 00:51:15 +0000
commit9e61d9a1aafbaecbc7b316fd94122b80c3f99905 (patch)
tree93b153faa3494a283b0d50314143bf3fec9630de /src/svm/fifo_segment.h
parentf7ab7b2d9bc0f42c1e766d22d49dd0dc4f28abb6 (diff)
svm: remove chunk add function
Type: refactor Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I606eabbe0f3f387529e77d2483f5d63db7bde88a
Diffstat (limited to 'src/svm/fifo_segment.h')
-rw-r--r--src/svm/fifo_segment.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/svm/fifo_segment.h b/src/svm/fifo_segment.h
index 4e950f6b4f0..00914e6c227 100644
--- a/src/svm/fifo_segment.h
+++ b/src/svm/fifo_segment.h
@@ -164,11 +164,27 @@ void fifo_segment_preallocate_fifo_pairs (fifo_segment_t * fs,
u32 tx_fifo_size,
u32 * n_fifo_pairs);
+/**
+ * Allocate chunks in fifo segment
+ *
+ * @param fsh fifo segment header
+ * @param slice_index slice where chunks should be alocated
+ * @param chunk_size chunk size needed
+ * @return chunk (or chunks) that cover at least chunk_size bytes
+ * on success, 0 on failure.
+ */
svm_fifo_chunk_t *fsh_alloc_chunk (fifo_segment_header_t * fsh,
u32 slice_index, u32 chunk_size);
+/**
+ * Return chunks to fifo segment
+ *
+ * @param fsh fifo segment header
+ * @param slice_index slice where chunks should be returned
+ * @param c pointer to first chunk in 0 terminated linked list
+ */
void fsh_collect_chunks (fifo_segment_header_t * fsh, u32 slice_index,
- svm_fifo_chunk_t * cur);
+ svm_fifo_chunk_t * c);
/**
* Fifo segment has reached mem limit