aboutsummaryrefslogtreecommitdiffstats
path: root/src/vcl/vppcom.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2019-01-22 19:05:52 -0800
committerDamjan Marion <dmarion@me.com>2019-01-23 11:02:24 +0000
commit72f7782dc57305ac86094dd16d7eccf8e0b74559 (patch)
tree57f2e1849e4a0b2c1d2864fbac53456ac800b3c8 /src/vcl/vppcom.c
parent31df49c39f2e3bea3cf85150cdac170845f2efd7 (diff)
vcl: generate epoll events only if requested
Change-Id: I6e96607f09c18755eead2c7099e1f546bdae7b88 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vcl/vppcom.c')
-rw-r--r--src/vcl/vppcom.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/vcl/vppcom.c b/src/vcl/vppcom.c
index f181f35ee27..c91d0f4b8b6 100644
--- a/src/vcl/vppcom.c
+++ b/src/vcl/vppcom.c
@@ -2601,31 +2601,34 @@ vcl_epoll_wait_handle_mq_event (vcl_worker_t * wrk, session_event_t * e,
if (!(session = vcl_session_get (wrk, sid)))
break;
session_events = session->vep.ev.events;
- if (EPOLLOUT & session_events)
- {
- add_event = 1;
- events[*num_ev].events |= EPOLLOUT;
- session_evt_data = session->vep.ev.data.u64;
- }
+ if (!(EPOLLOUT & session_events))
+ break;
+ add_event = 1;
+ events[*num_ev].events |= EPOLLOUT;
+ session_evt_data = session->vep.ev.data.u64;
break;
case SESSION_CTRL_EVT_DISCONNECTED:
disconnected_msg = (session_disconnected_msg_t *) e->data;
session = vcl_session_disconnected_handler (wrk, disconnected_msg);
if (!session)
break;
+ session_events = session->vep.ev.events;
+ if (!((EPOLLHUP | EPOLLRDHUP) & session_events))
+ break;
add_event = 1;
events[*num_ev].events |= EPOLLHUP | EPOLLRDHUP;
session_evt_data = session->vep.ev.data.u64;
- session_events = session->vep.ev.events;
break;
case SESSION_CTRL_EVT_RESET:
sid = vcl_session_reset_handler (wrk, (session_reset_msg_t *) e->data);
if (!(session = vcl_session_get (wrk, sid)))
break;
+ session_events = session->vep.ev.events;
+ if (!((EPOLLHUP | EPOLLRDHUP) & session_events))
+ break;
add_event = 1;
events[*num_ev].events |= EPOLLHUP | EPOLLRDHUP;
session_evt_data = session->vep.ev.data.u64;
- session_events = session->vep.ev.events;
break;
case SESSION_CTRL_EVT_REQ_WORKER_UPDATE:
vcl_session_req_worker_update_handler (wrk, e->data);
@@ -2710,7 +2713,7 @@ vppcom_epoll_wait_condvar (vcl_worker_t * wrk, struct epoll_event *events,
double total_wait = 0, wait_slice;
int rv;
- wait_for_time = (wait_for_time == -1) ? (double) 10e9 : wait_for_time;
+ wait_for_time = (wait_for_time == -1) ? (double) 1e6 : wait_for_time;
wait_slice = wrk->cut_through_registrations ? 10e-6 : wait_for_time;
do