summaryrefslogtreecommitdiffstats
path: root/src/vcl/vppcom.c
diff options
context:
space:
mode:
authorliuyacan <liuyacan@corp.netease.com>2021-09-10 15:14:05 +0800
committerFlorin Coras <florin.coras@gmail.com>2021-09-10 21:28:44 +0000
commitcba87100f1dd6d8b07eab7d9914bb80d469b982f (patch)
tree4bbb8a8c082dd786a0cc748491711cd3eb4552ca /src/vcl/vppcom.c
parent8cc9321f38c041bc9359bf0aae00091b4985c5cb (diff)
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 <liuyacan@corp.netease.com> Change-Id: Ib41c880ceb5072d49e11ab42e31e54398703c0b5
Diffstat (limited to 'src/vcl/vppcom.c')
-rw-r--r--src/vcl/vppcom.c10
1 files changed, 6 insertions, 4 deletions
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;
}