summaryrefslogtreecommitdiffstats
path: root/src/vcl
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2020-10-28 00:37:15 -0700
committerDave Barach <openvpp@barachs.net>2020-10-29 21:31:04 +0000
commitd6894568709b59625f03e92595e0686b05f2167a (patch)
treebbe259235a3530043be581e5021e0e7a7b54702e /src/vcl
parent108b15b4ef4844ef782639b9d9c3c71c222b5d9f (diff)
vcl session: minimize ct io events
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ic4072fbc182fff38a28b415be0bb16f0559a4064
Diffstat (limited to 'src/vcl')
-rw-r--r--src/vcl/vppcom.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/vcl/vppcom.c b/src/vcl/vppcom.c
index 16f1076e8aa..95d8b41bccb 100644
--- a/src/vcl/vppcom.c
+++ b/src/vcl/vppcom.c
@@ -1884,7 +1884,9 @@ vppcom_session_read_internal (uint32_t session_handle, void *buf, int n,
{
if (vcl_session_is_closing (s))
return vcl_session_closing_error (s);
- svm_fifo_unset_event (s->rx_fifo);
+ if (is_ct)
+ svm_fifo_unset_event (s->rx_fifo);
+ svm_fifo_unset_event (rx_fifo);
return VPPCOM_EWOULDBLOCK;
}
while (svm_fifo_is_empty_cons (rx_fifo))
@@ -1892,7 +1894,9 @@ vppcom_session_read_internal (uint32_t session_handle, void *buf, int n,
if (vcl_session_is_closing (s))
return vcl_session_closing_error (s);
- svm_fifo_unset_event (s->rx_fifo);
+ if (is_ct)
+ svm_fifo_unset_event (s->rx_fifo);
+ svm_fifo_unset_event (rx_fifo);
svm_msg_q_lock (mq);
if (svm_msg_q_is_empty (mq))
svm_msg_q_wait (mq);
@@ -1918,9 +1922,11 @@ read_again:
if (svm_fifo_is_empty_cons (rx_fifo))
{
- svm_fifo_unset_event (s->rx_fifo);
+ if (is_ct)
+ svm_fifo_unset_event (s->rx_fifo);
+ svm_fifo_unset_event (rx_fifo);
if (!svm_fifo_is_empty_cons (rx_fifo)
- && svm_fifo_set_event (s->rx_fifo) && is_nonblocking)
+ && svm_fifo_set_event (rx_fifo) && is_nonblocking)
{
vec_add2 (wrk->unhandled_evts_vector, e, 1);
e->event_type = SESSION_IO_EVT_RX;