aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2020-08-12 18:58:25 -0700
committerDave Barach <openvpp@barachs.net>2020-08-14 20:22:47 +0000
commitc34118b5915bb2f4e55accaaf9045c05426104b4 (patch)
tree3b88e3c1cb64b77625e0e6b713d9a6062b8734fc /src
parentf382b06febf2b26c37fd384824a1915e16517a2b (diff)
vcl: minimize vpp to vcl rx events
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I2015162bd315927e45b9fe583324b1458fe69d8f
Diffstat (limited to 'src')
-rw-r--r--src/vcl/vppcom.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/vcl/vppcom.c b/src/vcl/vppcom.c
index 1622409c0f9..d52d9a995a0 100644
--- a/src/vcl/vppcom.c
+++ b/src/vcl/vppcom.c
@@ -1941,7 +1941,17 @@ vppcom_session_read_internal (uint32_t session_handle, void *buf, int n,
n_read = app_recv_stream_raw (rx_fifo, buf, n, 0, peek);
if (svm_fifo_is_empty_cons (rx_fifo))
- svm_fifo_unset_event (s->rx_fifo);
+ {
+ svm_fifo_unset_event (s->rx_fifo);
+ if (!svm_fifo_is_empty_cons (rx_fifo)
+ && svm_fifo_set_event (s->rx_fifo) && is_nonblocking)
+ {
+ session_event_t *e;
+ vec_add2 (wrk->unhandled_evts_vector, e, 1);
+ e->event_type = SESSION_IO_EVT_RX;
+ e->session_index = s->session_index;
+ }
+ }
/* Cut-through sessions might request tx notifications on rx fifos */
if (PREDICT_FALSE (rx_fifo->want_deq_ntf))