From 40a5da8e96a910287001e9db119d1f0134fc9fb8 Mon Sep 17 00:00:00 2001 From: Florin Coras Date: Fri, 18 Dec 2020 09:19:18 -0800 Subject: tls: use fifo segments instead of chunks Type: refactor Signed-off-by: Florin Coras Change-Id: Id67cf8a3e1c5c9b4160689fde5de9ce7ed8a2ee3 --- src/svm/svm_fifo.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/svm/svm_fifo.h') diff --git a/src/svm/svm_fifo.h b/src/svm/svm_fifo.h index 4239e9d78ea..2a054526865 100644 --- a/src/svm/svm_fifo.h +++ b/src/svm/svm_fifo.h @@ -207,6 +207,21 @@ svm_fifo_chunk_t *svm_fifo_chunk_alloc (u32 size); * @param f fifo */ int svm_fifo_fill_chunk_list (svm_fifo_t * f); +/** + * Provision and return chunks for number of bytes requested + * + * Allocates enough chunks to cover the bytes requested and returns them + * in the fifo segment array. The number of bytes provisioned may be less + * than requested if not enough segments were provided. + * + * @param f fifo + * @param fs array of fifo segments + * @param n_segs length of fifo segments array + * @param len number of bytes to preallocate + * @return number of fifo segments provisioned or error + */ +int svm_fifo_provision_chunks (svm_fifo_t *f, svm_fifo_seg_t *fs, u32 n_segs, + u32 len); /** * Initialize rbtrees used for ooo lookups * -- cgit 1.2.3-korg