summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/plugins/hs_apps/echo_client.c51
-rw-r--r--src/plugins/hs_apps/echo_client.h2
2 files changed, 34 insertions, 19 deletions
diff --git a/src/plugins/hs_apps/echo_client.c b/src/plugins/hs_apps/echo_client.c
index 39cf98d2a1b..03297510d3e 100644
--- a/src/plugins/hs_apps/echo_client.c
+++ b/src/plugins/hs_apps/echo_client.c
@@ -821,7 +821,8 @@ echo_clients_connect (vlib_main_t *vm)
{
echo_client_main_t *ecm = &echo_client_main;
vnet_connect_args_t _a = {}, *a = &_a;
- int i, rv, needs_crypto;
+ int ci = 0, rv, needs_crypto;
+ clib_error_t *error = 0;
u32 n_clients;
n_clients = ecm->n_clients;
@@ -829,9 +830,11 @@ echo_clients_connect (vlib_main_t *vm)
clib_memcpy (&a->sep_ext, &ecm->connect_sep, sizeof (ecm->connect_sep));
a->app_index = ecm->app_index;
- for (i = 0; i < n_clients; i++)
+ vlib_worker_thread_barrier_sync (vm);
+
+ while (ci < n_clients)
{
- a->api_context = i;
+ a->api_context = ci;
if (needs_crypto)
{
session_endpoint_alloc_ext_cfg (&a->sep_ext,
@@ -839,8 +842,6 @@ echo_clients_connect (vlib_main_t *vm)
a->sep_ext.ext_cfg->crypto.ckpair_index = ecm->ckpair_index;
}
- vlib_worker_thread_barrier_sync (vm);
-
rv = vnet_connect (a);
if (needs_crypto)
@@ -848,20 +849,35 @@ echo_clients_connect (vlib_main_t *vm)
if (rv)
{
- vlib_worker_thread_barrier_release (vm);
- return clib_error_return (0, "connect returned: %d", rv);
+ error = clib_error_return (0, "connect returned: %d", rv);
+ break;
}
- vlib_worker_thread_barrier_release (vm);
+ ci += 1;
/* Crude pacing for call setups */
- if ((i % 16) == 0)
- vlib_process_suspend (vm, 100e-6);
- ASSERT (i + 1 >= ecm->ready_connections);
- while (i + 1 - ecm->ready_connections > 128)
- vlib_process_suspend (vm, 1e-3);
+ 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);
+ }
}
- return 0;
+
+ vlib_worker_thread_barrier_release (vm);
+
+ return error;
}
#define ec_cli(_fmt, _args...) \
@@ -873,14 +889,13 @@ echo_clients_command_fn (vlib_main_t *vm, unformat_input_t *input,
vlib_cli_command_t *cmd)
{
unformat_input_t _line_input, *line_input = &_line_input;
+ char *default_uri = "tcp://6.0.1.1/1234", *transfer_type;
echo_client_main_t *ecm = &echo_client_main;
- u64 tmp, total_bytes;
- f64 delta;
- char *default_uri = "tcp://6.0.1.1/1234";
uword *event_data = 0, event_type;
- char *transfer_type;
clib_error_t *error = 0;
int rv, had_config = 1;
+ u64 tmp, total_bytes;
+ f64 delta;
if (ecm->test_client_attached)
return clib_error_return (0, "failed: already running!");
diff --git a/src/plugins/hs_apps/echo_client.h b/src/plugins/hs_apps/echo_client.h
index ba467b1f537..9b8dbcb5419 100644
--- a/src/plugins/hs_apps/echo_client.h
+++ b/src/plugins/hs_apps/echo_client.h
@@ -85,7 +85,7 @@ typedef struct
u32 expected_connections; /**< Number of clients/connections */
u32 connections_per_batch; /**< Connections to rx/tx at once */
u32 private_segment_count; /**< Number of private fifo segs */
- u32 private_segment_size; /**< size of private fifo segs */
+ u64 private_segment_size; /**< size of private fifo segs */
u32 tls_engine; /**< TLS engine mbedtls/openssl */
u8 is_dgram;
u32 no_copy; /**< Don't memcpy data to tx fifo */