diff options
author | Florin Coras <fcoras@cisco.com> | 2022-12-22 15:03:44 -0800 |
---|---|---|
committer | Dave Barach <vpp@barachs.net> | 2023-08-09 18:45:26 +0000 |
commit | 0242d30fc717aeacb758281dad8e5b2e56bf6709 (patch) | |
tree | eb7addb00bbe78061fa58442a6e9bdbd7f3e181c /src/vnet/udp/udp_input.c | |
parent | 6d733a93b2eb9c16196ee17d5cdc77db21589571 (diff) |
session: async rx event notifications
Move from synchronous flushing of io and ctrl events from transports to
applications to an async model via a new session_input input node that
runs in interrupt mode. Events are coalesced per application worker.
On the one hand, this helps by minimizing message queue locking churn.
And on the other, it opens the possibility for further optimizations of
event message generation, obviates need for rx rescheduling rpcs and is
a first step towards a fully async data/io rx path.
Type: improvement
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Id6bebcb65fc9feef8aa02ddf1af6d9ba6f6745ce
Diffstat (limited to 'src/vnet/udp/udp_input.c')
-rw-r--r-- | src/vnet/udp/udp_input.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/vnet/udp/udp_input.c b/src/vnet/udp/udp_input.c index 6e5ed158d56..33ee2cddefd 100644 --- a/src/vnet/udp/udp_input.c +++ b/src/vnet/udp/udp_input.c @@ -149,11 +149,9 @@ udp_connection_enqueue (udp_connection_t * uc0, session_t * s0, * enqueue event now while we still have the peeker lock */ if (s0->thread_index != thread_index) { - wrote0 = session_enqueue_dgram_connection (s0, hdr0, b, - TRANSPORT_PROTO_UDP, - /* queue event */ 0); - if (queue_event && !svm_fifo_has_event (s0->rx_fifo)) - session_enqueue_notify (s0); + wrote0 = session_enqueue_dgram_connection_cl ( + s0, hdr0, b, TRANSPORT_PROTO_UDP, + /* queue event */ queue_event && !svm_fifo_has_event (s0->rx_fifo)); } else { @@ -232,10 +230,9 @@ always_inline uword udp46_input_inline (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame, u8 is_ip4) { - u32 n_left_from, *from, errors, *first_buffer; + u32 thread_index = vm->thread_index, n_left_from, *from, *first_buffer; vlib_buffer_t *bufs[VLIB_FRAME_SIZE], **b; u16 err_counters[UDP_N_ERROR] = { 0 }; - u32 thread_index = vm->thread_index; from = first_buffer = vlib_frame_vector_args (frame); n_left_from = frame->n_vectors; @@ -327,9 +324,7 @@ udp46_input_inline (vlib_main_t * vm, vlib_node_runtime_t * node, } vlib_buffer_free (vm, first_buffer, frame->n_vectors); - errors = session_main_flush_enqueue_events (TRANSPORT_PROTO_UDP, - thread_index); - err_counters[UDP_ERROR_MQ_FULL] = errors; + session_main_flush_enqueue_events (TRANSPORT_PROTO_UDP, thread_index); udp_store_err_counters (vm, is_ip4, err_counters); return frame->n_vectors; } |