summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2021-05-17 16:05:41 -0700
committerDamjan Marion <dmarion@me.com>2021-05-18 08:29:28 +0000
commit09843951dc200f4bf52e0e09a9a63a477fa6c3b1 (patch)
treeedf8aa3727df5c9c11824705a39f1b814d6101d8 /src
parent1d7a663f4b86f1d14b77fef13672a17fb02d6144 (diff)
session: only handle old ctrl events per dispatch
Avoids dispatching ctrl events generated while handling the current pending list. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ibeaf901ba4cf58a68fbd88e5ec3c23f6c2f6f145
Diffstat (limited to 'src')
-rw-r--r--src/vnet/session/session_node.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/vnet/session/session_node.c b/src/vnet/session/session_node.c
index fa66119abe2..a0b566e5a51 100644
--- a/src/vnet/session/session_node.c
+++ b/src/vnet/session/session_node.c
@@ -1689,12 +1689,18 @@ session_queue_node_fn (vlib_main_t * vm, vlib_node_runtime_t * node,
* Handle control events
*/
- ctrl_he = pool_elt_at_index (wrk->event_elts, wrk->ctrl_head);
-
- clib_llist_foreach_safe (wrk->event_elts, evt_list, ctrl_he, elt, ({
- clib_llist_remove (wrk->event_elts, evt_list, elt);
- session_event_dispatch_ctrl (wrk, elt);
- }));
+ ei = wrk->ctrl_head;
+ ctrl_he = pool_elt_at_index (wrk->event_elts, ei);
+ next_ei = clib_llist_next_index (ctrl_he, evt_list);
+ old_ti = clib_llist_prev_index (ctrl_he, evt_list);
+ while (ei != old_ti)
+ {
+ ei = next_ei;
+ elt = pool_elt_at_index (wrk->event_elts, next_ei);
+ next_ei = clib_llist_next_index (elt, evt_list);
+ clib_llist_remove (wrk->event_elts, evt_list, elt);
+ session_event_dispatch_ctrl (wrk, elt);
+ }
SESSION_EVT (SESSION_EVT_DSP_CNTRS, CTRL_EVTS, wrk);