- if (PREDICT_FALSE (error0 == TCP_ERROR_DISPATCH
- || next0 == TCP_INPUT_NEXT_RESET))
- {
- /* Overload tcp flags to store state */
- tcp_state_t state0 = tc0->state;
- vnet_buffer (b0)->tcp.flags = tc0->state;
-
- if (error0 == TCP_ERROR_DISPATCH)
- clib_warning ("disp error state %U flags %U",
- format_tcp_state, state0, format_tcp_flags,
- (int) flags0);
- }
+always_inline uword
+tcp46_input_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
+ vlib_frame_t * frame, int is_ip4)
+{
+ u32 n_left_from, *from, thread_index = vm->thread_index;
+ tcp_main_t *tm = vnet_get_tcp_main ();
+ vlib_buffer_t *bufs[VLIB_FRAME_SIZE], **b;
+ u16 nexts[VLIB_FRAME_SIZE], *next;
+
+ tcp_set_time_now (thread_index);
+
+ from = vlib_frame_vector_args (frame);
+ n_left_from = frame->n_vectors;
+ vlib_get_buffers (vm, from, bufs, n_left_from);
+
+ b = bufs;
+ next = nexts;
+
+ while (n_left_from >= 4)
+ {
+ u32 error0 = TCP_ERROR_NO_LISTENER, error1 = TCP_ERROR_NO_LISTENER;
+ tcp_connection_t *tc0, *tc1;
+
+ {
+ vlib_prefetch_buffer_header (b[2], STORE);
+ CLIB_PREFETCH (b[2]->data, 2 * CLIB_CACHE_LINE_BYTES, LOAD);
+
+ vlib_prefetch_buffer_header (b[3], STORE);
+ CLIB_PREFETCH (b[3]->data, 2 * CLIB_CACHE_LINE_BYTES, LOAD);
+ }
+
+ next[0] = next[1] = TCP_INPUT_NEXT_DROP;
+
+ tc0 = tcp_input_lookup_buffer (b[0], thread_index, &error0, is_ip4);
+ tc1 = tcp_input_lookup_buffer (b[1], thread_index, &error1, is_ip4);
+
+ if (PREDICT_TRUE (!tc0 + !tc1 == 0))
+ {
+ ASSERT (tcp_lookup_is_valid (tc0, tcp_buffer_hdr (b[0])));
+ ASSERT (tcp_lookup_is_valid (tc1, tcp_buffer_hdr (b[1])));
+
+ vnet_buffer (b[0])->tcp.connection_index = tc0->c_c_index;
+ vnet_buffer (b[1])->tcp.connection_index = tc1->c_c_index;
+
+ tcp_input_dispatch_buffer (tm, tc0, b[0], &next[0], &error0);
+ tcp_input_dispatch_buffer (tm, tc1, b[1], &next[1], &error1);
+ }
+ else
+ {
+ if (PREDICT_TRUE (tc0 != 0))
+ {
+ ASSERT (tcp_lookup_is_valid (tc0, tcp_buffer_hdr (b[0])));
+ vnet_buffer (b[0])->tcp.connection_index = tc0->c_c_index;
+ tcp_input_dispatch_buffer (tm, tc0, b[0], &next[0], &error0);