summaryrefslogtreecommitdiffstats
path: root/src/vcl/vppcom.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2023-05-16 13:05:28 -0700
committerFlorin Coras <fcoras@cisco.com>2023-05-16 13:05:28 -0700
commit7ff7274c6b23f53830fb52047161bd5cb988abe2 (patch)
tree191e439e61262ad6c64f345d35e151c2eda93cb9 /src/vcl/vppcom.c
parent83e73709c33ca4188a04f355ccb13bde13d63271 (diff)
vcl: avoid skipping last event in epoll lt
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ic89256d16230593b61a7b3e29582444fb3f93e4d
Diffstat (limited to 'src/vcl/vppcom.c')
-rw-r--r--src/vcl/vppcom.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/vcl/vppcom.c b/src/vcl/vppcom.c
index 8dab320afed..360b65df9d2 100644
--- a/src/vcl/vppcom.c
+++ b/src/vcl/vppcom.c
@@ -3367,7 +3367,7 @@ static void
vcl_epoll_wait_handle_lt (vcl_worker_t *wrk, struct epoll_event *events,
int maxevents, u32 *n_evts)
{
- u32 add_event = 0, next;
+ u32 add_event = 0, next, *to_remove = 0, *si;
vcl_session_t *s;
u64 evt_data;
int rv;
@@ -3415,12 +3415,17 @@ vcl_epoll_wait_handle_lt (vcl_worker_t *wrk, struct epoll_event *events,
}
else
{
- vcl_epoll_lt_del (wrk, s);
- if (wrk->ep_lt_current == VCL_INVALID_SESSION_INDEX)
- break;
+ vec_add1 (to_remove, s->session_index);
}
}
while (next != wrk->ep_lt_current);
+
+ vec_foreach (si, to_remove)
+ {
+ s = vcl_session_get (wrk, *si);
+ vcl_epoll_lt_del (wrk, s);
+ }
+ vec_free (to_remove);
}
int