udp: do not send received packets to error-drop
This tends to pollute the error counter.
Type: fix
@@ -80,25 +80,17 @@ 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, *to_next;
- u32 next_index, errors;
+ u32 n_left_from, *from;
+ u32 errors, *first_buffer;
u32 my_thread_index = vm->thread_index;
- from = vlib_frame_vector_args (frame);
+ from = first_buffer = vlib_frame_vector_args (frame);
n_left_from = frame->n_vectors;
- next_index = node->cached_next_index;
while (n_left_from > 0)
- {
- u32 n_left_to_next;
-
- vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next);
-
- while (n_left_from > 0 && n_left_to_next > 0)
{
u32 bi0, fib_index0;
vlib_buffer_t *b0;
- u32 next0 = UDP_INPUT_NEXT_DROP;
u32 error0 = UDP_ERROR_ENQUEUED;
udp_header_t *udp0;
ip4_header_t *ip40;
@@ -114,11 +106,8 @@ udp46_input_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
/* speculatively enqueue b0 to the current next frame */
bi0 = from[0];
- to_next[0] = bi0;
from += 1;
- to_next += 1;
n_left_from -= 1;
- n_left_to_next -= 1;
b0 = vlib_get_buffer (vm, bi0);
@@ -219,14 +208,12 @@ udp46_input_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
child0->flags |= UDP_CONN_F_CONNECTED;
if (session_stream_accept (&child0->connection,
- tc0->s_index, tc0->thread_index,
- 1))
+ tc0->s_index, tc0->thread_index, 1))
{
error0 = UDP_ERROR_CREATE_SESSION;
goto trace0;
}
- s0 = session_get (child0->c_s_index,
- child0->c_thread_index);
+ s0 = session_get (child0->c_s_index, child0->c_thread_index);
s0->session_state = SESSION_STATE_READY;
tc0 = &child0->connection;
uc0 = udp_get_connection_from_transport (tc0);
@@ -291,15 +278,9 @@ udp46_input_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
t->disposition = error0;
t->thread_index = my_thread_index;
}
-
- vlib_validate_buffer_enqueue_x1 (vm, node, next_index,
- to_next, n_left_to_next,
- bi0, next0);
- }
-
- vlib_put_next_frame (vm, node, next_index, n_left_to_next);
}
+ vlib_buffer_free (vm, first_buffer, frame->n_vectors);
errors = session_main_flush_enqueue_events (TRANSPORT_PROTO_UDP,
my_thread_index);
udp_input_inc_counter (vm, is_ip4, UDP_ERROR_EVENT_FIFO_FULL, errors);
