aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/hs_apps/echo_client.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2022-11-14 12:57:30 -0800
committerFlorin Coras <florin.coras@gmail.com>2022-11-30 17:48:42 +0000
commit4afdfb4a069558a65269f26061c02a5d24632f6a (patch)
tree63b47f295464c3c387ca6726fb26fa427359ed48 /src/plugins/hs_apps/echo_client.c
parent5010bbd3c44d9fb061818be7a291a474608f510a (diff)
hsa: session rpc for echo client cli notifications
Also, use connected udp for builtin echo apps Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ie24d7e97f4f27b67df9ceff3c268954485255c2d
Diffstat (limited to 'src/plugins/hs_apps/echo_client.c')
-rw-r--r--src/plugins/hs_apps/echo_client.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/plugins/hs_apps/echo_client.c b/src/plugins/hs_apps/echo_client.c
index 935e016e1f7..c6c7ede2f92 100644
--- a/src/plugins/hs_apps/echo_client.c
+++ b/src/plugins/hs_apps/echo_client.c
@@ -25,21 +25,24 @@ static ec_main_t ec_main;
clib_warning (_fmt, ##_args)
static void
-signal_evt_to_cli_i (int *code)
+signal_evt_to_cli_i (void *codep)
{
ec_main_t *ecm = &ec_main;
+ int code;
+
ASSERT (vlib_get_thread_index () == 0);
- vlib_process_signal_event (ecm->vlib_main, ecm->cli_node_index, *code, 0);
+ code = pointer_to_uword (codep);
+ vlib_process_signal_event (ecm->vlib_main, ecm->cli_node_index, code, 0);
}
static void
signal_evt_to_cli (int code)
{
if (vlib_get_thread_index () != 0)
- vl_api_rpc_call_main_thread (signal_evt_to_cli_i, (u8 *) & code,
- sizeof (code));
+ session_send_rpc_evt_to_thread_force (
+ 0, signal_evt_to_cli_i, uword_to_pointer ((uword) code, void *));
else
- signal_evt_to_cli_i (&code);
+ signal_evt_to_cli_i (uword_to_pointer ((uword) code, void *));
}
static inline ec_worker_t *
@@ -127,6 +130,7 @@ send_data_chunk (ec_main_t *ecm, ec_session_t *es)
else
{
bytes_this_chunk = clib_min (bytes_this_chunk, max_enqueue);
+ bytes_this_chunk = clib_min (bytes_this_chunk, 1460);
rv = app_send_dgram (&es->data, test_data + test_buf_offset,
bytes_this_chunk, 0);
}
@@ -829,6 +833,7 @@ ec_connect_rpc (void *args)
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->sep_ext.transport_flags |= TRANSPORT_CFG_F_CONNECTED;
a->app_index = ecm->app_index;
ci = ecm->connect_conn_index;
@@ -1052,8 +1057,8 @@ parse_config:
switch (event_type)
{
case ~0:
- ec_cli ("Timeout with %d sessions still active...",
- ecm->ready_connections);
+ ec_cli ("Timeout at %.6f with %d sessions still active...",
+ vlib_time_now (ecm->vlib_main), ecm->ready_connections);
error = clib_error_return (0, "failed: timeout with %d sessions",
ecm->ready_connections);
goto cleanup;