aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2019-08-05 09:39:47 -0700
committerFlorin Coras <fcoras@cisco.com>2019-08-05 10:07:09 -0700
commit0a6562c78091d03370228e3e8bd2bddf87fe524f (patch)
tree9e956b2cf9e7ccf551af54064bc8936341cad1c2 /src
parent0048223baad2b58a4e91aaeb2d05886499bbe004 (diff)
svm: fix fifo growth on dequeue with drop
Type:fix Change-Id: I39c339abf1b51105ef1bcf3d6f0f4f6ded54f32d Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src')
-rw-r--r--src/svm/svm_fifo.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/svm/svm_fifo.c b/src/svm/svm_fifo.c
index 56f53a3d339..b6f0df7d88d 100644
--- a/src/svm/svm_fifo.c
+++ b/src/svm/svm_fifo.c
@@ -967,6 +967,9 @@ svm_fifo_dequeue_drop (svm_fifo_t * f, u32 len)
if (!svm_fifo_chunk_includes_pos (f->head_chunk, head))
f->head_chunk = svm_fifo_find_chunk (f, head);
+ if (PREDICT_FALSE (f->flags & SVM_FIFO_F_GROW))
+ svm_fifo_try_grow (f, head);
+
/* store-rel: consumer owned index (paired with load-acq in producer) */
clib_atomic_store_rel_n (&f->head, head);
@@ -982,6 +985,9 @@ svm_fifo_dequeue_drop_all (svm_fifo_t * f)
if (!svm_fifo_chunk_includes_pos (f->head_chunk, tail))
f->head_chunk = svm_fifo_find_chunk (f, tail);
+ if (PREDICT_FALSE (f->flags & SVM_FIFO_F_GROW))
+ svm_fifo_try_grow (f, tail);
+
/* store-rel: consumer owned index (paired with load-acq in producer) */
clib_atomic_store_rel_n (&f->head, tail);
}