Make tcp active open data structures thread safe
[vpp.git] / src / vnet / udp / udp_input.c
index 4b22109..6ccb1e5 100644 (file)
@@ -70,7 +70,7 @@ udp4_uri_input_node_fn (vlib_main_t * vm,
   udp4_uri_input_next_t next_index;
   udp_uri_main_t *um = vnet_get_udp_main ();
   session_manager_main_t *smm = vnet_get_session_manager_main ();
-  u32 my_thread_index = vm->cpu_index;
+  u32 my_thread_index = vm->thread_index;
   u8 my_enqueue_epoch;
   u32 *session_indices_to_enqueue;
   static u32 serial_number;
@@ -123,7 +123,7 @@ udp4_uri_input_node_fn (vlib_main_t * vm,
          /* lookup session */
          s0 = stream_session_lookup4 (&ip0->dst_address, &ip0->src_address,
                                       udp0->dst_port, udp0->src_port,
-                                      SESSION_TYPE_IP4_UDP, my_thread_index);
+                                      SESSION_TYPE_IP4_UDP);
 
          /* no listener */
          if (PREDICT_FALSE (s0 == 0))
@@ -145,8 +145,7 @@ udp4_uri_input_node_fn (vlib_main_t * vm,
                  goto trace0;
                }
 
-             svm_fifo_enqueue_nowait (f0, 0 /* pid */ ,
-                                      udp_len0 - sizeof (*udp0),
+             svm_fifo_enqueue_nowait (f0, udp_len0 - sizeof (*udp0),
                                       (u8 *) (udp0 + 1));
 
              b0->error = node->errors[SESSION_ERROR_ENQUEUED];
@@ -180,7 +179,7 @@ udp4_uri_input_node_fn (vlib_main_t * vm,
              us->c_rmt_ip4.as_u32 = ip0->src_address.as_u32;
              us->c_lcl_port = udp0->dst_port;
              us->c_rmt_port = udp0->src_port;
-             us->c_proto = SESSION_TYPE_IP4_UDP;
+             us->c_transport_proto = TRANSPORT_PROTO_UDP;
              us->c_c_index = us - um->udp_sessions[my_thread_index];
 
              /*
@@ -255,7 +254,7 @@ udp4_uri_input_node_fn (vlib_main_t * vm,
        {
          /* Fabricate event */
          evt.fifo = s0->server_rx_fifo;
-         evt.event_type = FIFO_EVENT_SERVER_RX;
+         evt.event_type = FIFO_EVENT_APP_RX;
          evt.event_id = serial_number++;
 
          /* Add event to server's event queue */