summaryrefslogtreecommitdiffstats
path: root/src/vnet/session-apps
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-10-15 21:35:42 -0700
committerMarco Varlese <marco.varlese@suse.de>2018-10-17 07:33:24 +0000
commit7d76878ab3eea9d233d569d9b714a40924fbaa8b (patch)
tree19a2a0a1d9bc7f64bc508b908b3e75098fa08b92 /src/vnet/session-apps
parent84112dd4f98e5a31a8c7340a741f89e77fd03363 (diff)
tls: fix multi threaded medium scale test (VPP-1457)
- ensure session enqueue epoch does not wrap between two enqueues - use 3 states for echo clients app, to distinguish between starting and closing phases - force tcp fin retransmit if out of buffers while sending a fin Change-Id: I6f2cab46affd1148aba2a33fb6d58bcc54f32805 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/session-apps')
-rw-r--r--src/vnet/session-apps/echo_client.c26
-rw-r--r--src/vnet/session-apps/echo_client.h6
2 files changed, 29 insertions, 3 deletions
diff --git a/src/vnet/session-apps/echo_client.c b/src/vnet/session-apps/echo_client.c
index b47dcf21a4b..0258c16520a 100644
--- a/src/vnet/session-apps/echo_client.c
+++ b/src/vnet/session-apps/echo_client.c
@@ -208,7 +208,7 @@ echo_client_node_fn (vlib_main_t * vm, vlib_node_runtime_t * node,
connections_this_batch =
ecm->connections_this_batch_by_thread[my_thread_index];
- if ((ecm->run_test == 0) ||
+ if ((ecm->run_test != ECHO_CLIENTS_RUNNING) ||
((vec_len (connection_indices) == 0)
&& vec_len (connections_this_batch) == 0))
return 0;
@@ -352,6 +352,16 @@ echo_clients_init (vlib_main_t * vm)
return 0;
}
+static void
+echo_clients_session_disconnect (stream_session_t * s)
+{
+ echo_client_main_t *ecm = &echo_client_main;
+ vnet_disconnect_args_t _a, *a = &_a;
+ a->handle = session_handle (s);
+ a->app_index = ecm->app_index;
+ vnet_disconnect_session (a);
+}
+
static int
echo_clients_session_connected_callback (u32 app_index, u32 api_context,
stream_session_t * s, u8 is_fail)
@@ -361,6 +371,9 @@ echo_clients_session_connected_callback (u32 app_index, u32 api_context,
u32 session_index;
u8 thread_index;
+ if (PREDICT_FALSE (ecm->run_test != ECHO_CLIENTS_STARTING))
+ return -1;
+
if (is_fail)
{
clib_warning ("connection %d failed!", api_context);
@@ -407,7 +420,7 @@ echo_clients_session_connected_callback (u32 app_index, u32 api_context,
__sync_fetch_and_add (&ecm->ready_connections, 1);
if (ecm->ready_connections == ecm->expected_connections)
{
- ecm->run_test = 1;
+ ecm->run_test = ECHO_CLIENTS_RUNNING;
/* Signal the CLI process that the action is starting... */
signal_evt_to_cli (1);
}
@@ -447,6 +460,12 @@ echo_clients_rx_callback (stream_session_t * s)
echo_client_main_t *ecm = &echo_client_main;
eclient_session_t *sp;
+ if (PREDICT_FALSE (ecm->run_test != ECHO_CLIENTS_RUNNING))
+ {
+ echo_clients_session_disconnect (s);
+ return -1;
+ }
+
sp = pool_elt_at_index (ecm->sessions,
s->server_rx_fifo->client_session_index);
receive_data_chunk (ecm, sp);
@@ -624,6 +643,7 @@ echo_clients_command_fn (vlib_main_t * vm,
ecm->vlib_main = vm;
ecm->tls_engine = TLS_ENGINE_OPENSSL;
ecm->no_copy = 0;
+ ecm->run_test = ECHO_CLIENTS_STARTING;
if (thread_main->n_vlib_mains > 1)
clib_spinlock_init (&ecm->sessions_lock);
@@ -825,7 +845,7 @@ echo_clients_command_fn (vlib_main_t * vm,
error = clib_error_return (0, "failed: test bytes");
cleanup:
- ecm->run_test = 0;
+ ecm->run_test = ECHO_CLIENTS_EXITING;
vlib_process_wait_for_event_or_clock (vm, 10e-3);
for (i = 0; i < vec_len (ecm->connection_index_by_thread); i++)
{
diff --git a/src/vnet/session-apps/echo_client.h b/src/vnet/session-apps/echo_client.h
index db5ba163628..2270720dcda 100644
--- a/src/vnet/session-apps/echo_client.h
+++ b/src/vnet/session-apps/echo_client.h
@@ -105,6 +105,12 @@ typedef struct
vlib_main_t *vlib_main;
} echo_client_main_t;
+enum
+{
+ ECHO_CLIENTS_STARTING,
+ ECHO_CLIENTS_RUNNING,
+ ECHO_CLIENTS_EXITING
+} echo_clients_test_state_e;
extern echo_client_main_t echo_client_main;
vlib_node_registration_t echo_clients_node;