svm: basic support for fifo shrinking 83/19283/21
authorFlorin Coras <fcoras@cisco.com>
Thu, 2 May 2019 19:52:19 +0000 (12:52 -0700)
committerDave Barach <openvpp@barachs.net>
Fri, 3 May 2019 20:20:42 +0000 (20:20 +0000)
commita7570b0378b071129937a89a5632011a962cdb43
treec5d33ab51e937ca32dd75fcd0a2211060739fe83
parent4681e07a02c2e1681048c4e3a018433c055a91b1
svm: basic support for fifo shrinking

As opposed to growing, this is not a bulk operation, instead dependent
on how the producer/consumer advance head and tail, the fifo will shrink
in one or multiple steps.

Only once the fifo's nitems and size are reduced to their appropriate
values, equal or larger to what was requested, can the fifo chunks be
collected by the owner. Chunk collection must be done with the segment
heap pushed.

Change-Id: Iae407ccf48d85320aa3c1e0304df56c5972c88c1
Signed-off-by: Florin Coras <fcoras@cisco.com>
src/plugins/unittest/svm_fifo_test.c
src/svm/svm_fifo.c
src/svm/svm_fifo.h