udp: store mss and sw_if_index to udp_connection_t
[vpp.git] / src / vnet / udp / udp_input.c
index d14bdb8..c11c0d5 100644 (file)
@@ -251,15 +251,11 @@ udp46_input_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
          goto done;
        }
 
-      /*
-       * If session exists pool peeker lock is taken at this point unless
-       * the session is already on the right thread or is a listener
-       */
-
       if (s0->session_state == SESSION_STATE_OPENED)
        {
          u8 queue_event = 1;
          uc0 = udp_connection_from_transport (session_get_transport (s0));
+         uc0->sw_if_index = vnet_buffer (b[0])->sw_if_index[VLIB_RX];
          if (uc0->flags & UDP_CONN_F_CONNECTED)
            {
              if (s0->thread_index != thread_index)
@@ -273,10 +269,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;
@@ -286,7 +280,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)
        {
@@ -306,6 +299,7 @@ udp46_input_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
                  goto done;
                }
              s0 = session_get (uc0->c_s_index, uc0->c_thread_index);
+             uc0->sw_if_index = vnet_buffer (b[0])->sw_if_index[VLIB_RX];
              error0 = UDP_ERROR_ACCEPT;
            }
          udp_connection_enqueue (uc0, s0, &hdr0, thread_index, b[0], 1,
@@ -314,7 +308,6 @@ 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: