tcp: avoid regrabing error node in input and output
[vpp.git] / src / vnet / tcp / tcp_input.c
index 713e11f..b82eab0 100755 (executable)
@@ -1985,7 +1985,8 @@ tcp46_syn_sent_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
 
          /* Notify app that we have connection. If session layer can't
           * allocate session send reset */
-         if (session_stream_connect_notify (&new_tc0->connection, 0))
+         if (session_stream_connect_notify (&new_tc0->connection,
+                                            SESSION_E_NONE))
            {
              tcp_send_reset_w_pkt (new_tc0, b0, my_thread_index, is_ip4);
              tcp_connection_cleanup (new_tc0);
@@ -2006,7 +2007,8 @@ tcp46_syn_sent_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
          new_tc0->state = TCP_STATE_SYN_RCVD;
 
          /* Notify app that we have connection */
-         if (session_stream_connect_notify (&new_tc0->connection, 0))
+         if (session_stream_connect_notify (&new_tc0->connection,
+                                            SESSION_E_NONE))
            {
              tcp_connection_cleanup (new_tc0);
              tcp_send_reset_w_pkt (tc0, b0, my_thread_index, is_ip4);
@@ -2834,11 +2836,9 @@ tcp46_input_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
   tcp_main_t *tm = vnet_get_tcp_main ();
   vlib_buffer_t *bufs[VLIB_FRAME_SIZE], **b;
   u16 nexts[VLIB_FRAME_SIZE], *next;
-  vlib_node_runtime_t *error_node;
 
   tcp_set_time_now (tcp_get_worker (thread_index));
 
-  error_node = vlib_node_get_runtime (vm, tcp_node_index (input, is_ip4));
   from = vlib_frame_vector_args (frame);
   n_left_from = frame->n_vectors;
   vlib_get_buffers (vm, from, bufs, n_left_from);
@@ -2874,8 +2874,8 @@ tcp46_input_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
          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], error_node);
-         tcp_input_dispatch_buffer (tm, tc1, b[1], &next[1], error_node);
+         tcp_input_dispatch_buffer (tm, tc0, b[0], &next[0], node);
+         tcp_input_dispatch_buffer (tm, tc1, b[1], &next[1], node);
        }
       else
        {
@@ -2883,24 +2883,24 @@ tcp46_input_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
            {
              ASSERT (tcp_lookup_is_valid (tc0, b[0], 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], error_node);
+             tcp_input_dispatch_buffer (tm, tc0, b[0], &next[0], node);
            }
          else
            {
              tcp_input_set_error_next (tm, &next[0], &error0, is_ip4);
-             b[0]->error = error_node->errors[error0];
+             b[0]->error = node->errors[error0];
            }
 
          if (PREDICT_TRUE (tc1 != 0))
            {
              ASSERT (tcp_lookup_is_valid (tc1, b[1], tcp_buffer_hdr (b[1])));
              vnet_buffer (b[1])->tcp.connection_index = tc1->c_c_index;
-             tcp_input_dispatch_buffer (tm, tc1, b[1], &next[1], error_node);
+             tcp_input_dispatch_buffer (tm, tc1, b[1], &next[1], node);
            }
          else
            {
              tcp_input_set_error_next (tm, &next[1], &error1, is_ip4);
-             b[1]->error = error_node->errors[error1];
+             b[1]->error = node->errors[error1];
            }
        }
 
@@ -2926,12 +2926,12 @@ tcp46_input_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
        {
          ASSERT (tcp_lookup_is_valid (tc0, b[0], 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], error_node);
+         tcp_input_dispatch_buffer (tm, tc0, b[0], &next[0], node);
        }
       else
        {
          tcp_input_set_error_next (tm, &next[0], &error0, is_ip4);
-         b[0]->error = error_node->errors[error0];
+         b[0]->error = node->errors[error0];
        }
 
       b += 1;