session: free session after transport and app confirm
[vpp.git] / src / plugins / unittest / tcp_test.c
index 3bde805..66260df 100644 (file)
@@ -1646,9 +1646,9 @@ tcp_test_lookup (vlib_main_t * vm, unformat_input_t * input)
   /*
    * Allocate fake session and connection 1
    */
-  pool_get (smm->sessions[0], s);
+  pool_get (smm->wrk[0].sessions, s);
   clib_memset (s, 0, sizeof (*s));
-  s->session_index = sidx = s - smm->sessions[0];
+  s->session_index = sidx = s - smm->wrk[0].sessions;
 
   pool_get (tm->connections[0], tc);
   clib_memset (tc, 0, sizeof (*tc));
@@ -1662,14 +1662,14 @@ tcp_test_lookup (vlib_main_t * vm, unformat_input_t * input)
   tc->connection.rmt_port = 53764;
   tc->connection.proto = TRANSPORT_PROTO_TCP;
   tc->connection.is_ip4 = 1;
-  clib_memcpy (tc1, &tc->connection, sizeof (*tc1));
+  clib_memcpy_fast (tc1, &tc->connection, sizeof (*tc1));
 
   /*
    * Allocate fake session and connection 2
    */
-  pool_get (session_manager_main.sessions[0], s);
+  pool_get (smm->wrk[0].sessions, s);
   clib_memset (s, 0, sizeof (*s));
-  s->session_index = s - smm->sessions[0];
+  s->session_index = s - smm->wrk[0].sessions;
 
   pool_get (tm->connections[0], tc);
   clib_memset (tc, 0, sizeof (*tc));
@@ -1683,13 +1683,13 @@ tcp_test_lookup (vlib_main_t * vm, unformat_input_t * input)
   tc->connection.rmt_port = 53764;
   tc->connection.proto = TRANSPORT_PROTO_TCP;
   tc->connection.is_ip4 = 1;
-  clib_memcpy (tc2, &tc->connection, sizeof (*tc2));
+  clib_memcpy_fast (tc2, &tc->connection, sizeof (*tc2));
 
   /*
    * Confirm that connection lookup works
    */
 
-  s1 = pool_elt_at_index (smm->sessions[0], sidx);
+  s1 = pool_elt_at_index (smm->wrk[0].sessions, sidx);
   session_lookup_add_connection (tc1, session_handle (s1));
   tconn = session_lookup_connection_wt4 (0, &tc1->lcl_ip.ip4,
                                         &tc1->rmt_ip.ip4,
@@ -1795,7 +1795,7 @@ tcp_test_session (vlib_main_t * vm, unformat_input_t * input)
     {
       tc0 = tcp_connection_get (0 /* connection index */ , 0 /* thread */ );
       tc0->state = TCP_STATE_CLOSED;
-      stream_session_disconnect_notify (&tc0->connection);
+      session_transport_closing_notify (&tc0->connection);
     }
 
   return rv;