diff options
author | Florin Coras <fcoras@cisco.com> | 2023-02-28 21:13:50 -0800 |
---|---|---|
committer | Dave Barach <vpp@barachs.net> | 2023-03-01 16:59:30 +0000 |
commit | c2a1417c5af9f29a0f267e49cfd164aa3085842c (patch) | |
tree | ff95dd68e0eeec26e0a56f733504a2c7f0811c0a /src/vcl/vppcom.c | |
parent | 56bfc63b289cbf7e7f8ebf5bee97d7f2ec78ae1a (diff) |
vcl: only add sessions to lt list if needed
Type: fix
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I777979dbb89f9af774533cb280e77af58b81fb29
Diffstat (limited to 'src/vcl/vppcom.c')
-rw-r--r-- | src/vcl/vppcom.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/vcl/vppcom.c b/src/vcl/vppcom.c index e3fb14fa4e5..d51f69f8a41 100644 --- a/src/vcl/vppcom.c +++ b/src/vcl/vppcom.c @@ -1465,6 +1465,8 @@ vcl_epoll_lt_add (vcl_worker_t *wrk, vcl_session_t *s) { vcl_session_t *cur, *prev; + ASSERT (s->vep.lt_next == VCL_INVALID_SESSION_INDEX); + if (wrk->ep_lt_current == VCL_INVALID_SESSION_INDEX) { wrk->ep_lt_current = s->session_index; @@ -1488,10 +1490,13 @@ vcl_epoll_lt_del (vcl_worker_t *wrk, vcl_session_t *s) { vcl_session_t *prev, *next; + ASSERT (s->vep.lt_next != VCL_INVALID_SESSION_INDEX); + if (s->vep.lt_next == s->session_index) { wrk->ep_lt_current = VCL_INVALID_SESSION_INDEX; s->vep.lt_next = VCL_INVALID_SESSION_INDEX; + s->vep.lt_prev = VCL_INVALID_SESSION_INDEX; return; } @@ -1505,6 +1510,7 @@ vcl_epoll_lt_del (vcl_worker_t *wrk, vcl_session_t *s) wrk->ep_lt_current = s->vep.lt_next; s->vep.lt_next = VCL_INVALID_SESSION_INDEX; + s->vep.lt_prev = VCL_INVALID_SESSION_INDEX; } int @@ -2761,7 +2767,8 @@ vcl_epoll_ctl_add_unhandled_event (vcl_worker_t *wrk, vcl_session_t *s, { if (!is_epollet) { - vcl_epoll_lt_add (wrk, s); + if (s->vep.lt_next == VCL_INVALID_SESSION_INDEX) + vcl_epoll_lt_add (wrk, s); return; } |