From cba87100f1dd6d8b07eab7d9914bb80d469b982f Mon Sep 17 00:00:00 2001 From: liuyacan Date: Fri, 10 Sep 2021 15:14:05 +0800 Subject: vcl: avoid duplicated events in epoll lt 1. Filter event ACCEPTED for lt (same as event RX) 2. Do lt check before vppcom_epoll_wait_xxx to avoid delivering duplicated events. Type: fix Signed-off-by: liuyacan Change-Id: Ib41c880ceb5072d49e11ab42e31e54398703c0b5 --- src/vcl/vppcom.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/vcl/vppcom.c b/src/vcl/vppcom.c index 86a0c642bfc..987a19c896a 100644 --- a/src/vcl/vppcom.c +++ b/src/vcl/vppcom.c @@ -3048,7 +3048,8 @@ vcl_epoll_wait_handle_mq_event (vcl_worker_t * wrk, session_event_t * e, break; session_events = s->vep.ev.events; sid = s->session_index; - if (!(EPOLLIN & session_events)) + if (!(EPOLLIN & session_events) || + (s->vep.lt_next != VCL_INVALID_SESSION_INDEX)) break; add_event = 1; events[*num_ev].events = EPOLLIN; @@ -3364,6 +3365,10 @@ vppcom_epoll_wait (uint32_t vep_handle, struct epoll_event *events, } vec_reset_length (wrk->unhandled_evts_vector); } + + if (PREDICT_FALSE (wrk->ep_lt_current != VCL_INVALID_SESSION_INDEX)) + vcl_epoll_wait_handle_lt (wrk, events, maxevents, &n_evts); + /* Request to only drain unhandled */ if ((int) wait_for_time == -2) return n_evts; @@ -3376,9 +3381,6 @@ vppcom_epoll_wait (uint32_t vep_handle, struct epoll_event *events, n_evts = vppcom_epoll_wait_condvar (wrk, events, maxevents, n_evts, wait_for_time); - if (PREDICT_FALSE (wrk->ep_lt_current != VCL_INVALID_SESSION_INDEX)) - vcl_epoll_wait_handle_lt (wrk, events, maxevents, &n_evts); - return n_evts; } -- cgit 1.2.3-korg