summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2022-04-04 10:10:58 -0700
committerDamjan Marion <dmarion@me.com>2022-04-04 19:08:47 +0000
commit0dde17573261d32e50d86ea584bc70f0796e0f46 (patch)
tree4bc0e0220867630beb1fc6ca1fefe38447c50cbe
parentc7ef4f391bcfb515af52cfcf9c71bb6b16006fc1 (diff)
session: use session layer rpc for evts sent to main
Fix race with connects for iperf3 udp test. Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ief725b80047911e87ba24736dc0a60aa8bcdac50
-rw-r--r--src/vnet/session/session_node.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/vnet/session/session_node.c b/src/vnet/session/session_node.c
index 89c8ab0c891..89017f00bee 100644
--- a/src/vnet/session/session_node.c
+++ b/src/vnet/session/session_node.c
@@ -30,7 +30,7 @@ static inline void
session_wrk_send_evt_to_main (session_worker_t *wrk, session_evt_elt_t *elt)
{
session_evt_elt_t *he;
- u32 thread_index;
+ uword thread_index;
u8 is_empty;
thread_index = wrk->vm->thread_index;
@@ -38,8 +38,8 @@ session_wrk_send_evt_to_main (session_worker_t *wrk, session_evt_elt_t *elt)
is_empty = clib_llist_is_empty (wrk->event_elts, evt_list, he);
clib_llist_add_tail (wrk->event_elts, evt_list, elt, he);
if (is_empty)
- vlib_rpc_call_main_thread (session_wrk_handle_evts_main_rpc,
- (u8 *) &thread_index, sizeof (thread_index));
+ session_send_rpc_evt_to_thread (0, session_wrk_handle_evts_main_rpc,
+ uword_to_pointer (thread_index, void *));
}
#define app_check_thread_and_barrier(_wrk, _elt) \
@@ -777,11 +777,13 @@ void
session_wrk_handle_evts_main_rpc (void *args)
{
session_evt_elt_t *he, *elt, *next;
+ vlib_main_t *vm = vlib_get_main ();
session_worker_t *fwrk;
u32 thread_index;
- ASSERT (vlib_thread_is_main_w_barrier ());
- thread_index = *(u32 *) args;
+ vlib_worker_thread_barrier_sync (vm);
+
+ thread_index = pointer_to_uword (args);
fwrk = session_main_get_worker (thread_index);
he = clib_llist_elt (fwrk->event_elts, fwrk->evts_pending_main);
@@ -817,6 +819,8 @@ session_wrk_handle_evts_main_rpc (void *args)
clib_llist_put (fwrk->event_elts, elt);
elt = next;
}
+
+ vlib_worker_thread_barrier_release (vm);
}
vlib_node_registration_t session_queue_node;