X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fsvm%2Fsvm_fifo.c;h=6bd6f9157bc0b000fe668b92363d4a09731131b3;hb=254c1b0ddf8283284c538cf7d7a136001304d81b;hp=56f53a3d339542103d9cb722ad7d65d31d8cadb7;hpb=eaacce4753c33342a6512039fe4153b15b476fb3;p=vpp.git diff --git a/src/svm/svm_fifo.c b/src/svm/svm_fifo.c index 56f53a3d339..6bd6f9157bc 100644 --- a/src/svm/svm_fifo.c +++ b/src/svm/svm_fifo.c @@ -400,7 +400,7 @@ svm_fifo_init (svm_fifo_t * f, u32 size) f->ooos_list_head = OOO_SEGMENT_INVALID_INDEX; f->segment_index = SVM_FIFO_INVALID_INDEX; f->refcnt = 1; - f->flags = 0; + f->head = f->tail = f->flags = 0; f->head_chunk = f->tail_chunk = f->ooo_enq = f->ooo_deq = f->start_chunk; } @@ -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); }