summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2022-04-21 18:03:12 -0700
committerFlorin Coras <florin.coras@gmail.com>2022-04-22 01:05:06 +0000
commit94ba931b32ac71c312e6f64a4af9f6722c3ea0c0 (patch)
treeece7b8188fea90144f7c83917a0a4c6fae97d2b4 /src
parent80d100cd59015d91c4f0abfaf07b6876088ecbf1 (diff)
session: fix ctrl evt rpc elt pool realloc
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I79bfe91e81983b619c61a32285d8e038c2654147
Diffstat (limited to 'src')
-rw-r--r--src/vnet/session/session_node.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/vnet/session/session_node.c b/src/vnet/session/session_node.c
index 89017f00bee..510ffa2617f 100644
--- a/src/vnet/session/session_node.c
+++ b/src/vnet/session/session_node.c
@@ -776,8 +776,9 @@ session_mq_transport_attr_handler (void *data)
void
session_wrk_handle_evts_main_rpc (void *args)
{
- session_evt_elt_t *he, *elt, *next;
vlib_main_t *vm = vlib_get_main ();
+ clib_llist_index_t ei, next_ei;
+ session_evt_elt_t *he, *elt;
session_worker_t *fwrk;
u32 thread_index;
@@ -787,11 +788,12 @@ session_wrk_handle_evts_main_rpc (void *args)
fwrk = session_main_get_worker (thread_index);
he = clib_llist_elt (fwrk->event_elts, fwrk->evts_pending_main);
- elt = clib_llist_next (fwrk->event_elts, evt_list, he);
+ ei = clib_llist_next_index (he, evt_list);
- while (elt != he)
+ while (ei != fwrk->evts_pending_main)
{
- next = clib_llist_next (fwrk->event_elts, evt_list, elt);
+ elt = clib_llist_elt (fwrk->event_elts, ei);
+ next_ei = clib_llist_next_index (elt, evt_list);
clib_llist_remove (fwrk->event_elts, evt_list, elt);
switch (elt->evt.event_type)
{
@@ -815,9 +817,12 @@ session_wrk_handle_evts_main_rpc (void *args)
ALWAYS_ASSERT (0);
break;
}
+
+ /* Regrab element in case pool moved */
+ elt = clib_llist_elt (fwrk->event_elts, ei);
session_evt_ctrl_data_free (fwrk, elt);
clib_llist_put (fwrk->event_elts, elt);
- elt = next;
+ ei = next_ei;
}
vlib_worker_thread_barrier_release (vm);