From aeb7c1cb6e11dde259d954f7fabb95073a3b4c54 Mon Sep 17 00:00:00 2001 From: Florin Coras Date: Fri, 10 Mar 2023 10:22:21 -0800 Subject: session vcl: refactor builtin tx event for main tx Rename unused SESSION_IO_EVT_BUILTIN_TX to SESSION_IO_EVT_TX_MAIN and leverage it for non-connected udp tx. Non-connected udp sessions are listeners and are therefore allocated on main thread. Consequently, whenever session queue node is not polling main, tx events generated by external applications might be missed or processed with some delay. To solve this, request that apps use SESSION_IO_EVT_TX_MAIN tx events as opposed to SESSION_IO_EVT_TX and send that to first worker as opposed to main. Type: fix Signed-off-by: Florin Coras Change-Id: I5df5ac3dc80c0f192b2eefb1d465e9deefe8786b --- src/vnet/session/session_node.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/vnet/session/session_node.c') diff --git a/src/vnet/session/session_node.c b/src/vnet/session/session_node.c index f1a006722fe..c61e89bf398 100644 --- a/src/vnet/session/session_node.c +++ b/src/vnet/session/session_node.c @@ -1776,11 +1776,13 @@ session_event_dispatch_io (session_worker_t * wrk, vlib_node_runtime_t * node, app_wrk = app_worker_get (s->app_wrk_index); app_worker_builtin_rx (app_wrk, s); break; - case SESSION_IO_EVT_BUILTIN_TX: - s = session_get_from_handle_if_valid (e->session_handle); + case SESSION_IO_EVT_TX_MAIN: + s = session_get_if_valid (e->session_index, 0 /* main thread */); + if (PREDICT_FALSE (!s)) + break; wrk->ctx.s = s; if (PREDICT_TRUE (s != 0)) - session_tx_fifo_dequeue_internal (wrk, node, elt, n_tx_packets); + (smm->session_tx_fns[s->session_type]) (wrk, node, elt, n_tx_packets); break; default: clib_warning ("unhandled event type %d", e->event_type); -- cgit 1.2.3-korg