vcl: allow more rx events on peek
If peek touches all data in the fifo, unset fifo event to request new
events when more data is enqueued.
Type: improvement
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I878fa017f18ada5cef557600673bba920f230542
diff --git a/src/vcl/vppcom.c b/src/vcl/vppcom.c
index 58f6ac0..a557093 100644
--- a/src/vcl/vppcom.c
+++ b/src/vcl/vppcom.c
@@ -2087,7 +2087,16 @@
ASSERT (rv >= 0);
if (peek)
- return rv;
+ {
+ /* Request new notifications if more data enqueued */
+ if (rv < n || rv == svm_fifo_max_dequeue_cons (rx_fifo))
+ {
+ if (is_ct)
+ svm_fifo_unset_event (s->rx_fifo);
+ svm_fifo_unset_event (rx_fifo);
+ }
+ return rv;
+ }
n_read += rv;