Do burst of connects with barrier held.
Type: improvement
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I7e6dcf097022b56d6880de0cba7b8492a938077b
{
echo_client_main_t *ecm = &echo_client_main;
vnet_connect_args_t _a = {}, *a = &_a;
{
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;
u32 n_clients;
n_clients = ecm->n_clients;
clib_memcpy (&a->sep_ext, &ecm->connect_sep, sizeof (ecm->connect_sep));
a->app_index = ecm->app_index;
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)
if (needs_crypto)
{
session_endpoint_alloc_ext_cfg (&a->sep_ext,
if (needs_crypto)
{
session_endpoint_alloc_ext_cfg (&a->sep_ext,
a->sep_ext.ext_cfg->crypto.ckpair_index = ecm->ckpair_index;
}
a->sep_ext.ext_cfg->crypto.ckpair_index = ecm->ckpair_index;
}
- vlib_worker_thread_barrier_sync (vm);
-
rv = vnet_connect (a);
if (needs_crypto)
rv = vnet_connect (a);
if (needs_crypto)
- 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);
/* Crude pacing for call setups */
/* 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);
+ }
+
+ vlib_worker_thread_barrier_release (vm);
+
+ return error;
}
#define ec_cli(_fmt, _args...) \
}
#define ec_cli(_fmt, _args...) \
vlib_cli_command_t *cmd)
{
unformat_input_t _line_input, *line_input = &_line_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;
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;
uword *event_data = 0, event_type;
clib_error_t *error = 0;
int rv, had_config = 1;
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!");
if (ecm->test_client_attached)
return clib_error_return (0, "failed: already running!");
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 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 */
u32 tls_engine; /**< TLS engine mbedtls/openssl */
u8 is_dgram;
u32 no_copy; /**< Don't memcpy data to tx fifo */