aboutsummaryrefslogtreecommitdiffstats
path: root/src/svm/svm_fifo.h
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2019-12-12 12:09:29 -0800
committerDave Barach <openvpp@barachs.net>2020-02-25 19:18:49 +0000
commitb020806806c0e6c54886cdb4347a5fd1f19504b0 (patch)
tree77322fd6c17967df0626e99c98076b5dac71d89d /src/svm/svm_fifo.h
parent5cd31ec9405d2bb2fbc8152a08c4cfb64f2a8e73 (diff)
svm: refactor fifo chunk tracking
Avoid tracking with rbtrees all of the chunks associated to a fifo. Instead, only track chunks when doing out-of-order operations (peek or ooo enqueue). Type: refactor Change-Id: I9f8bd266211746637d98e6a12ffc4b2d6346950a Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/svm/svm_fifo.h')
-rw-r--r--src/svm/svm_fifo.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/svm/svm_fifo.h b/src/svm/svm_fifo.h
index 0b7c70790c0..2b6e8542cdf 100644
--- a/src/svm/svm_fifo.h
+++ b/src/svm/svm_fifo.h
@@ -60,6 +60,7 @@ typedef struct svm_fifo_chunk_
u32 start_byte; /**< chunk start byte */
u32 length; /**< length of chunk in bytes */
struct svm_fifo_chunk_ *next; /**< pointer to next chunk in linked-lists */
+ rb_node_index_t rb_index; /**< node index if chunk in rbtree */
u8 data[0]; /**< start of chunk data */
} svm_fifo_chunk_t;
@@ -80,8 +81,8 @@ typedef struct _svm_fifo
u32 nitems; /**< usable size (size-1) */
svm_fifo_chunk_t *start_chunk;/**< first chunk in fifo chunk list */
svm_fifo_chunk_t *end_chunk; /**< end chunk in fifo chunk list */
- svm_fifo_chunk_t *new_chunks; /**< chunks yet to be added to list */
- rb_tree_t chunk_lookup; /**< rbtree for chunk lookup */
+ rb_tree_t ooo_enq_lookup; /**< rbtree for ooo enq chunk lookup */
+ rb_tree_t ooo_deq_lookup; /**< rbtree for ooo deq chunk lookup */
u8 flags; /**< fifo flags */
u8 slice_index; /**< segment slice for fifo */
@@ -96,6 +97,7 @@ typedef struct _svm_fifo
u32 segment_index; /**< segment index in segment manager */
struct _svm_fifo *next; /**< next in freelist/active chain */
struct _svm_fifo *prev; /**< prev in active chain */
+ svm_fifo_chunk_t *new_chunks; /**< chunks yet to be added to list */
u32 size_decrement; /**< bytes to remove from fifo */
CLIB_CACHE_LINE_ALIGN_MARK (consumer);