summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/plugins/hs_apps/echo_client.c61
-rw-r--r--src/plugins/hs_apps/echo_client.h6
2 files changed, 36 insertions, 31 deletions
diff --git a/src/plugins/hs_apps/echo_client.c b/src/plugins/hs_apps/echo_client.c
index 03297510d3e..d2ae252cd98 100644
--- a/src/plugins/hs_apps/echo_client.c
+++ b/src/plugins/hs_apps/echo_client.c
@@ -334,6 +334,7 @@ ec_reset_runtime_config (echo_client_main_t *ecm)
ecm->no_copy = 0;
ecm->run_test = ECHO_CLIENTS_STARTING;
ecm->ready_connections = 0;
+ ecm->connect_conn_index = 0;
ecm->rx_total = 0;
ecm->tx_total = 0;
ecm->barrier_acq_needed = 0;
@@ -816,24 +817,33 @@ ec_transport_needs_crypto (transport_proto_t proto)
proto == TRANSPORT_PROTO_QUIC;
}
-clib_error_t *
-echo_clients_connect (vlib_main_t *vm)
+int
+echo_clients_connect_rpc (void *args)
{
echo_client_main_t *ecm = &echo_client_main;
vnet_connect_args_t _a = {}, *a = &_a;
- int ci = 0, rv, needs_crypto;
- clib_error_t *error = 0;
- u32 n_clients;
+ vlib_main_t *vm = vlib_get_main ();
+ int rv, needs_crypto;
+ u32 n_clients, ci;
n_clients = ecm->n_clients;
needs_crypto = ec_transport_needs_crypto (ecm->transport_proto);
clib_memcpy (&a->sep_ext, &ecm->connect_sep, sizeof (ecm->connect_sep));
a->app_index = ecm->app_index;
+ ci = ecm->connect_conn_index;
+
vlib_worker_thread_barrier_sync (vm);
while (ci < n_clients)
{
+ /* Crude pacing for call setups */
+ if (ci - ecm->ready_connections > 128)
+ {
+ ecm->connect_conn_index = ci;
+ break;
+ }
+
a->api_context = ci;
if (needs_crypto)
{
@@ -849,35 +859,26 @@ echo_clients_connect (vlib_main_t *vm)
if (rv)
{
- error = clib_error_return (0, "connect returned: %d", rv);
+ clib_warning ("connect returned: %U", format_session_error, rv);
+ signal_evt_to_cli (2);
break;
}
ci += 1;
-
- /* Crude pacing for call setups */
- if ((ci % 16) == 0)
- {
- vlib_worker_thread_barrier_release (vm);
-
- ASSERT (ci >= ecm->ready_connections);
- if (ci - ecm->ready_connections > 128)
- {
- while (ci - ecm->ready_connections > 128)
- vlib_process_suspend (vm, 100e-6);
- }
- else
- {
- vlib_process_suspend (vm, 50e-6);
- }
-
- vlib_worker_thread_barrier_sync (vm);
- }
}
vlib_worker_thread_barrier_release (vm);
- return error;
+ if (ci < ecm->expected_connections)
+ echo_clients_program_connects ();
+
+ return 0;
+}
+
+void
+echo_clients_program_connects (void)
+{
+ session_send_rpc_evt_to_thread_force (0, echo_clients_connect_rpc, 0);
}
#define ec_cli(_fmt, _args...) \
@@ -1005,10 +1006,7 @@ parse_config:
*/
ecm->syn_start_time = vlib_time_now (vm);
- if ((error = echo_clients_connect (vm)))
- {
- goto cleanup;
- }
+ echo_clients_program_connects ();
/*
* Park until the sessions come up, or syn_timeout seconds pass
@@ -1032,6 +1030,9 @@ parse_config:
ecm->n_clients, delta, ((f64) ecm->n_clients) / delta);
break;
+ case 2:
+ error = clib_error_return (0, "failed: connect returned");
+ goto cleanup;
default:
ec_cli ("unexpected event(1): %d", event_type);
error = clib_error_return (0, "failed: unexpected event(1): %d",
diff --git a/src/plugins/hs_apps/echo_client.h b/src/plugins/hs_apps/echo_client.h
index 9b8dbcb5419..a0e844d7e6d 100644
--- a/src/plugins/hs_apps/echo_client.h
+++ b/src/plugins/hs_apps/echo_client.h
@@ -64,6 +64,8 @@ typedef struct
u32 prev_conns;
u32 repeats;
+ u32 connect_conn_index; /**< Conencts attempted progress */
+
/*
* Application setup parameters
*/
@@ -122,10 +124,12 @@ enum
ECHO_CLIENTS_RUNNING,
ECHO_CLIENTS_EXITING
} echo_clients_test_state_e;
-extern echo_client_main_t echo_client_main;
+extern echo_client_main_t echo_client_main;
vlib_node_registration_t echo_clients_node;
+void echo_clients_program_connects (void);
+
#endif /* __included_echo_client_h__ */
/*