X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fudp%2Fudp_input.c;h=e701ca5d12eba89b7be1282b071f26c28fb5ab1c;hb=6bd8d3fbba74f8f80a0c09f87c6cbfddd054042f;hp=95595c394e48f491a5ab8a09ea03d2df18591e8f;hpb=92bbfc297c1e01037eb80a24bb42f8fe54e8a9b1;p=vpp.git diff --git a/src/vnet/udp/udp_input.c b/src/vnet/udp/udp_input.c index 95595c394e4..e701ca5d12e 100644 --- a/src/vnet/udp/udp_input.c +++ b/src/vnet/udp/udp_input.c @@ -21,14 +21,13 @@ #include #include -#include #include #include #include #include -static char *udp_error_strings[] = { -#define udp_error(n,s) s, +static vlib_error_desc_t udp_error_counters[] = { +#define udp_error(f, n, s, d) { #n, d, VL_COUNTER_SEVERITY_##s }, #include "udp_error.def" #undef udp_error }; @@ -135,7 +134,8 @@ udp_connection_enqueue (udp_connection_t * uc0, session_t * s0, { int wrote0; - clib_spinlock_lock (&uc0->rx_lock); + if (!(uc0->flags & UDP_CONN_F_CONNECTED)) + clib_spinlock_lock (&uc0->rx_lock); if (svm_fifo_max_enqueue_prod (s0->rx_fifo) < hdr0->data_length + sizeof (session_dgram_hdr_t)) @@ -164,7 +164,8 @@ udp_connection_enqueue (udp_connection_t * uc0, session_t * s0, unlock_rx_lock: - clib_spinlock_unlock (&uc0->rx_lock); + if (!(uc0->flags & UDP_CONN_F_CONNECTED)) + clib_spinlock_unlock (&uc0->rx_lock); } always_inline session_t * @@ -272,10 +273,8 @@ udp46_input_inline (vlib_main_t * vm, vlib_node_runtime_t * node, ASSERT (s0->session_index == uc0->c_s_index); /* - * Drop the peeker lock on pool resize and ask session - * layer for a new session. + * Ask session layer for a new session. */ - session_pool_remove_peeker (s0->thread_index); session_dgram_connect_notify (&uc0->connection, s0->thread_index, &s0); queue_event = 0; @@ -285,7 +284,6 @@ udp46_input_inline (vlib_main_t * vm, vlib_node_runtime_t * node, } udp_connection_enqueue (uc0, s0, &hdr0, thread_index, b[0], queue_event, &error0); - session_pool_remove_peeker (s0->thread_index); } else if (s0->session_state == SESSION_STATE_READY) { @@ -313,18 +311,16 @@ udp46_input_inline (vlib_main_t * vm, vlib_node_runtime_t * node, else { error0 = UDP_ERROR_NOT_READY; - session_pool_remove_peeker (s0->thread_index); } done: + if (PREDICT_FALSE (node->flags & VLIB_NODE_FLAG_TRACE)) + udp_trace_buffer (vm, node, b[0], s0, error0); b += 1; n_left_from -= 1; udp_inc_err_counter (err_counters, error0, 1); - - if (PREDICT_FALSE (node->flags & VLIB_NODE_FLAG_TRACE)) - udp_trace_buffer (vm, node, b[0], s0, error0); } vlib_buffer_free (vm, first_buffer, frame->n_vectors); @@ -350,8 +346,8 @@ VLIB_REGISTER_NODE (udp4_input_node) = .vector_size = sizeof (u32), .format_trace = format_udp_input_trace, .type = VLIB_NODE_TYPE_INTERNAL, - .n_errors = ARRAY_LEN (udp_error_strings), - .error_strings = udp_error_strings, + .n_errors = UDP_N_ERROR, + .error_counters = udp_error_counters, .n_next_nodes = UDP_INPUT_N_NEXT, .next_nodes = { #define _(s, n) [UDP_INPUT_NEXT_##s] = n, @@ -376,8 +372,8 @@ VLIB_REGISTER_NODE (udp6_input_node) = .vector_size = sizeof (u32), .format_trace = format_udp_input_trace, .type = VLIB_NODE_TYPE_INTERNAL, - .n_errors = ARRAY_LEN (udp_error_strings), - .error_strings = udp_error_strings, + .n_errors = UDP_N_ERROR, + .error_counters = udp_error_counters, .n_next_nodes = UDP_INPUT_N_NEXT, .next_nodes = { #define _(s, n) [UDP_INPUT_NEXT_##s] = n,