svm: fix multi-chunk fifo alloc and add more tests 67/20467/9
authorFlorin Coras <fcoras@cisco.com>
Tue, 2 Jul 2019 20:07:37 +0000 (13:07 -0700)
committerDave Barach <openvpp@barachs.net>
Wed, 3 Jul 2019 11:26:36 +0000 (11:26 +0000)
commiteaacce4753c33342a6512039fe4153b15b476fb3
treeb7465c6da3970f28db0aca7ab92b12b3c7fbaa5d
parentb5ef26d1ed524d1f2f59ffd5546d1c581f4c88a2
svm: fix multi-chunk fifo alloc and add more tests

Type: fix

- make sure that chunks and the rbtree are initialized if fifo segment
allocates multiple chunks for the fifo.
- ensure head/tail chunks are updated on all enqueue/dequeue events,
including when dropping data.
- more unit tests

Also fixes dequeue drop updates of head chunk.

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