2 * echo_client.c - vpp built-in echo client code
4 * Copyright (c) 2017 by Cisco and/or its affiliates.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at:
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
18 #include <vnet/vnet.h>
19 #include <vlibapi/api.h>
20 #include <vlibmemory/api.h>
21 #include <vnet/session-apps/echo_client.h>
23 echo_client_main_t echo_client_main;
25 #define ECHO_CLIENT_DBG (0)
28 signal_evt_to_cli_i (int *code)
30 echo_client_main_t *ecm = &echo_client_main;
31 ASSERT (vlib_get_thread_index () == 0);
32 vlib_process_signal_event (ecm->vlib_main, ecm->cli_node_index, *code, 0);
36 signal_evt_to_cli (int code)
38 if (vlib_get_thread_index () != 0)
39 vl_api_rpc_call_main_thread (signal_evt_to_cli_i, (u8 *) & code,
42 signal_evt_to_cli_i (&code);
46 send_data_chunk (echo_client_main_t * ecm, eclient_session_t * s)
48 u8 *test_data = ecm->connect_test_data;
49 int test_buf_len, test_buf_offset, rv;
52 test_buf_len = vec_len (test_data);
53 ASSERT (test_buf_len > 0);
54 test_buf_offset = s->bytes_sent % test_buf_len;
55 bytes_this_chunk = clib_min (test_buf_len - test_buf_offset,
62 svm_fifo_t *f = s->data.tx_fifo;
63 rv = clib_min (svm_fifo_max_enqueue (f), bytes_this_chunk);
64 svm_fifo_enqueue_nocopy (f, rv);
65 session_send_io_evt_to_thread_custom (f, s->thread_index,
69 rv = app_send_stream (&s->data, test_data + test_buf_offset,
76 session_dgram_hdr_t hdr;
77 svm_fifo_t *f = s->data.tx_fifo;
78 app_session_transport_t *at = &s->data.transport;
79 u32 max_enqueue = svm_fifo_max_enqueue (f);
81 if (max_enqueue <= sizeof (session_dgram_hdr_t))
84 max_enqueue -= sizeof (session_dgram_hdr_t);
85 rv = clib_min (max_enqueue, bytes_this_chunk);
89 clib_memcpy (&hdr.rmt_ip, &at->rmt_ip, sizeof (ip46_address_t));
90 hdr.is_ip4 = at->is_ip4;
91 hdr.rmt_port = at->rmt_port;
92 clib_memcpy (&hdr.lcl_ip, &at->lcl_ip, sizeof (ip46_address_t));
93 hdr.lcl_port = at->lcl_port;
94 svm_fifo_enqueue_nowait (f, sizeof (hdr), (u8 *) & hdr);
95 svm_fifo_enqueue_nocopy (f, rv);
96 session_send_io_evt_to_thread_custom (f, s->thread_index,
100 rv = app_send_dgram (&s->data, test_data + test_buf_offset,
101 bytes_this_chunk, 0);
104 /* If we managed to enqueue data... */
107 /* Account for it... */
108 s->bytes_to_send -= rv;
114 ELOG_TYPE_DECLARE (e) =
116 .format = "tx-enq: xfer %d bytes, sent %u remain %u",
117 .format_args = "i4i4i4",
124 ed = ELOG_DATA (&vlib_global_main.elog_main, e);
126 ed->data[1] = s->bytes_sent;
127 ed->data[2] = s->bytes_to_send;
133 receive_data_chunk (echo_client_main_t * ecm, eclient_session_t * s)
135 svm_fifo_t *rx_fifo = s->data.rx_fifo;
136 u32 thread_index = vlib_get_thread_index ();
142 n_read = app_recv_stream (&s->data, ecm->rx_buf[thread_index],
143 vec_len (ecm->rx_buf[thread_index]));
145 n_read = app_recv_dgram (&s->data, ecm->rx_buf[thread_index],
146 vec_len (ecm->rx_buf[thread_index]));
150 n_read = svm_fifo_max_dequeue (rx_fifo);
151 svm_fifo_dequeue_drop (rx_fifo, n_read);
159 ELOG_TYPE_DECLARE (e) =
161 .format = "rx-deq: %d bytes",
169 ed = ELOG_DATA (&vlib_global_main.elog_main, e);
170 ed->data[0] = n_read;
175 for (i = 0; i < n_read; i++)
177 if (ecm->rx_buf[thread_index][i]
178 != ((s->bytes_received + i) & 0xff))
180 clib_warning ("read %d error at byte %lld, 0x%x not 0x%x",
181 n_read, s->bytes_received + i,
182 ecm->rx_buf[thread_index][i],
183 ((s->bytes_received + i) & 0xff));
184 ecm->test_failed = 1;
188 ASSERT (n_read <= s->bytes_to_receive);
189 s->bytes_to_receive -= n_read;
190 s->bytes_received += n_read;
195 echo_client_node_fn (vlib_main_t * vm, vlib_node_runtime_t * node,
196 vlib_frame_t * frame)
198 echo_client_main_t *ecm = &echo_client_main;
199 int my_thread_index = vlib_get_thread_index ();
200 eclient_session_t *sp;
203 u32 *connection_indices;
204 u32 *connections_this_batch;
205 u32 nconnections_this_batch;
207 connection_indices = ecm->connection_index_by_thread[my_thread_index];
208 connections_this_batch =
209 ecm->connections_this_batch_by_thread[my_thread_index];
211 if ((ecm->run_test == 0) ||
212 ((vec_len (connection_indices) == 0)
213 && vec_len (connections_this_batch) == 0))
216 /* Grab another pile of connections */
217 if (PREDICT_FALSE (vec_len (connections_this_batch) == 0))
219 nconnections_this_batch =
220 clib_min (ecm->connections_per_batch, vec_len (connection_indices));
222 ASSERT (nconnections_this_batch > 0);
223 vec_validate (connections_this_batch, nconnections_this_batch - 1);
224 clib_memcpy (connections_this_batch,
225 connection_indices + vec_len (connection_indices)
226 - nconnections_this_batch,
227 nconnections_this_batch * sizeof (u32));
228 _vec_len (connection_indices) -= nconnections_this_batch;
231 if (PREDICT_FALSE (ecm->prev_conns != ecm->connections_per_batch
232 && ecm->prev_conns == vec_len (connections_this_batch)))
235 ecm->prev_conns = vec_len (connections_this_batch);
236 if (ecm->repeats == 500000)
238 clib_warning ("stuck clients");
243 ecm->prev_conns = vec_len (connections_this_batch);
247 for (i = 0; i < vec_len (connections_this_batch); i++)
251 sp = pool_elt_at_index (ecm->sessions, connections_this_batch[i]);
253 if (sp->bytes_to_send > 0)
255 send_data_chunk (ecm, sp);
258 if (sp->bytes_to_receive > 0)
262 if (PREDICT_FALSE (delete_session == 1))
266 __sync_fetch_and_add (&ecm->tx_total, sp->bytes_sent);
267 __sync_fetch_and_add (&ecm->rx_total, sp->bytes_received);
268 s = session_get_from_handle_if_valid (sp->vpp_session_handle);
272 vnet_disconnect_args_t _a, *a = &_a;
273 a->handle = session_handle (s);
274 a->app_index = ecm->app_index;
275 vnet_disconnect_session (a);
277 vec_delete (connections_this_batch, 1, i);
279 __sync_fetch_and_add (&ecm->ready_connections, -1);
283 clib_warning ("session AWOL?");
284 vec_delete (connections_this_batch, 1, i);
287 /* Kick the debug CLI process */
288 if (ecm->ready_connections == 0)
290 signal_evt_to_cli (2);
295 ecm->connection_index_by_thread[my_thread_index] = connection_indices;
296 ecm->connections_this_batch_by_thread[my_thread_index] =
297 connections_this_batch;
302 VLIB_REGISTER_NODE (echo_clients_node) =
304 .function = echo_client_node_fn,
305 .name = "echo-clients",
306 .type = VLIB_NODE_TYPE_INPUT,
307 .state = VLIB_NODE_STATE_DISABLED,
312 create_api_loopback (echo_client_main_t * ecm)
314 api_main_t *am = &api_main;
315 vl_shmem_hdr_t *shmem_hdr;
317 shmem_hdr = am->shmem_hdr;
318 ecm->vl_input_queue = shmem_hdr->vl_input_queue;
319 ecm->my_client_index = vl_api_memclnt_create_internal ("echo_client",
320 ecm->vl_input_queue);
325 echo_clients_init (vlib_main_t * vm)
327 echo_client_main_t *ecm = &echo_client_main;
328 vlib_thread_main_t *vtm = vlib_get_thread_main ();
332 if (create_api_loopback (ecm))
335 num_threads = 1 /* main thread */ + vtm->n_threads;
337 /* Init test data. Big buffer */
338 vec_validate (ecm->connect_test_data, 4 * 1024 * 1024 - 1);
339 for (i = 0; i < vec_len (ecm->connect_test_data); i++)
340 ecm->connect_test_data[i] = i & 0xff;
342 vec_validate (ecm->rx_buf, num_threads - 1);
343 for (i = 0; i < num_threads; i++)
344 vec_validate (ecm->rx_buf[i], vec_len (ecm->connect_test_data) - 1);
348 vec_validate (ecm->connection_index_by_thread, vtm->n_vlib_mains);
349 vec_validate (ecm->connections_this_batch_by_thread, vtm->n_vlib_mains);
350 vec_validate (ecm->vpp_event_queue, vtm->n_vlib_mains);
356 echo_clients_session_connected_callback (u32 app_index, u32 api_context,
357 stream_session_t * s, u8 is_fail)
359 echo_client_main_t *ecm = &echo_client_main;
360 eclient_session_t *session;
366 clib_warning ("connection %d failed!", api_context);
367 signal_evt_to_cli (-1);
371 thread_index = s->thread_index;
372 ASSERT (thread_index == vlib_get_thread_index ()
373 || session_transport_service_type (s) == TRANSPORT_SERVICE_CL);
375 if (!ecm->vpp_event_queue[thread_index])
376 ecm->vpp_event_queue[thread_index] =
377 session_manager_get_vpp_event_queue (thread_index);
382 clib_spinlock_lock_if_init (&ecm->sessions_lock);
383 pool_get (ecm->sessions, session);
384 clib_spinlock_unlock_if_init (&ecm->sessions_lock);
386 memset (session, 0, sizeof (*session));
387 session_index = session - ecm->sessions;
388 session->bytes_to_send = ecm->bytes_to_send;
389 session->bytes_to_receive = ecm->no_return ? 0ULL : ecm->bytes_to_send;
390 session->data.rx_fifo = s->server_rx_fifo;
391 session->data.rx_fifo->client_session_index = session_index;
392 session->data.tx_fifo = s->server_tx_fifo;
393 session->data.tx_fifo->client_session_index = session_index;
394 session->data.vpp_evt_q = ecm->vpp_event_queue[thread_index];
395 session->vpp_session_handle = session_handle (s);
399 transport_connection_t *tc;
400 tc = session_get_transport (s);
401 clib_memcpy (&session->data.transport, tc,
402 sizeof (session->data.transport));
403 session->data.is_dgram = 1;
406 vec_add1 (ecm->connection_index_by_thread[thread_index], session_index);
407 __sync_fetch_and_add (&ecm->ready_connections, 1);
408 if (ecm->ready_connections == ecm->expected_connections)
411 /* Signal the CLI process that the action is starting... */
412 signal_evt_to_cli (1);
419 echo_clients_session_reset_callback (stream_session_t * s)
421 if (s->session_state == SESSION_STATE_READY)
422 clib_warning ("Reset active connection %U", format_stream_session, s, 2);
423 stream_session_cleanup (s);
428 echo_clients_session_create_callback (stream_session_t * s)
434 echo_clients_session_disconnect_callback (stream_session_t * s)
436 echo_client_main_t *ecm = &echo_client_main;
437 vnet_disconnect_args_t _a, *a = &_a;
438 a->handle = session_handle (s);
439 a->app_index = ecm->app_index;
440 vnet_disconnect_session (a);
445 echo_clients_rx_callback (stream_session_t * s)
447 echo_client_main_t *ecm = &echo_client_main;
448 eclient_session_t *sp;
450 sp = pool_elt_at_index (ecm->sessions,
451 s->server_rx_fifo->client_session_index);
452 receive_data_chunk (ecm, sp);
454 if (svm_fifo_max_dequeue (s->server_rx_fifo))
456 if (svm_fifo_set_event (s->server_rx_fifo))
457 session_send_io_evt_to_thread (s->server_rx_fifo,
458 FIFO_EVENT_BUILTIN_RX);
464 echo_client_add_segment_callback (u32 client_index, const ssvm_private_t * sp)
466 /* New heaps may be added */
471 static session_cb_vft_t echo_clients = {
472 .session_reset_callback = echo_clients_session_reset_callback,
473 .session_connected_callback = echo_clients_session_connected_callback,
474 .session_accept_callback = echo_clients_session_create_callback,
475 .session_disconnect_callback = echo_clients_session_disconnect_callback,
476 .builtin_app_rx_callback = echo_clients_rx_callback,
477 .add_segment_callback = echo_client_add_segment_callback
481 static clib_error_t *
482 echo_clients_attach (u8 * appns_id, u64 appns_flags, u64 appns_secret)
484 u32 prealloc_fifos, segment_size = 256 << 20;
485 echo_client_main_t *ecm = &echo_client_main;
486 vnet_app_attach_args_t _a, *a = &_a;
488 clib_error_t *error = 0;
490 memset (a, 0, sizeof (*a));
491 memset (options, 0, sizeof (options));
493 a->api_client_index = ecm->my_client_index;
494 a->session_cb_vft = &echo_clients;
496 prealloc_fifos = ecm->prealloc_fifos ? ecm->expected_connections : 1;
498 if (ecm->private_segment_size)
499 segment_size = ecm->private_segment_size;
501 options[APP_OPTIONS_ACCEPT_COOKIE] = 0x12345678;
502 options[APP_OPTIONS_SEGMENT_SIZE] = segment_size;
503 options[APP_OPTIONS_ADD_SEGMENT_SIZE] = segment_size;
504 options[APP_OPTIONS_RX_FIFO_SIZE] = ecm->fifo_size;
505 options[APP_OPTIONS_TX_FIFO_SIZE] = ecm->fifo_size;
506 options[APP_OPTIONS_PRIVATE_SEGMENT_COUNT] = ecm->private_segment_count;
507 options[APP_OPTIONS_PREALLOC_FIFO_PAIRS] = prealloc_fifos;
508 options[APP_OPTIONS_FLAGS] = APP_OPTIONS_FLAGS_IS_BUILTIN;
509 options[APP_OPTIONS_TLS_ENGINE] = ecm->tls_engine;
512 options[APP_OPTIONS_FLAGS] |= appns_flags;
513 options[APP_OPTIONS_NAMESPACE_SECRET] = appns_secret;
515 a->options = options;
516 a->namespace_id = appns_id;
518 if ((error = vnet_application_attach (a)))
521 ecm->app_index = a->app_index;
526 echo_clients_detach ()
528 echo_client_main_t *ecm = &echo_client_main;
529 vnet_app_detach_args_t _da, *da = &_da;
532 da->app_index = ecm->app_index;
533 rv = vnet_application_detach (da);
534 ecm->test_client_attached = 0;
540 echo_client_thread_fn (void *arg)
545 /** Start a transmit thread */
547 echo_clients_start_tx_pthread (echo_client_main_t * ecm)
549 if (ecm->client_thread_handle == 0)
551 int rv = pthread_create (&ecm->client_thread_handle,
553 echo_client_thread_fn, 0);
556 ecm->client_thread_handle = 0;
564 echo_clients_connect (vlib_main_t * vm, u32 n_clients)
566 echo_client_main_t *ecm = &echo_client_main;
567 vnet_connect_args_t _a, *a = &_a;
568 clib_error_t *error = 0;
571 memset (a, 0, sizeof (*a));
572 for (i = 0; i < n_clients; i++)
574 a->uri = (char *) ecm->connect_uri;
576 a->app_index = ecm->app_index;
578 if ((error = vnet_connect_uri (a)))
581 /* Crude pacing for call setups */
583 vlib_process_suspend (vm, 10e-6);
584 ASSERT (i + 1 >= ecm->ready_connections);
585 while (i + 1 - ecm->ready_connections > 1000)
587 vlib_process_suspend (vm, 100e-6);
593 #define ec_cli_output(_fmt, _args...) \
594 if (!ecm->no_output) \
595 vlib_cli_output(vm, _fmt, ##_args)
597 static clib_error_t *
598 echo_clients_command_fn (vlib_main_t * vm,
599 unformat_input_t * input, vlib_cli_command_t * cmd)
601 echo_client_main_t *ecm = &echo_client_main;
602 vlib_thread_main_t *thread_main = vlib_get_thread_main ();
603 u64 tmp, total_bytes, appns_flags = 0, appns_secret = 0;
604 f64 test_timeout = 20.0, syn_timeout = 20.0, delta;
605 char *default_uri = "tcp://6.0.1.1/1234";
606 uword *event_data = 0, event_type;
607 f64 time_before_connects;
609 int preallocate_sessions = 0;
611 clib_error_t *error = 0;
615 ecm->bytes_to_send = 8192;
617 ecm->fifo_size = 64 << 10;
618 ecm->connections_per_batch = 1000;
619 ecm->private_segment_count = 0;
620 ecm->private_segment_size = 0;
623 ecm->test_failed = 0;
625 ecm->tls_engine = TLS_ENGINE_OPENSSL;
628 if (thread_main->n_vlib_mains > 1)
629 clib_spinlock_init (&ecm->sessions_lock);
630 vec_free (ecm->connect_uri);
632 while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
634 if (unformat (input, "uri %s", &ecm->connect_uri))
636 else if (unformat (input, "nclients %d", &n_clients))
638 else if (unformat (input, "mbytes %lld", &tmp))
639 ecm->bytes_to_send = tmp << 20;
640 else if (unformat (input, "gbytes %lld", &tmp))
641 ecm->bytes_to_send = tmp << 30;
642 else if (unformat (input, "bytes %lld", &ecm->bytes_to_send))
644 else if (unformat (input, "test-timeout %f", &test_timeout))
646 else if (unformat (input, "syn-timeout %f", &syn_timeout))
648 else if (unformat (input, "no-return"))
650 else if (unformat (input, "fifo-size %d", &ecm->fifo_size))
651 ecm->fifo_size <<= 10;
652 else if (unformat (input, "private-segment-count %d",
653 &ecm->private_segment_count))
655 else if (unformat (input, "private-segment-size %U",
656 unformat_memory_size, &tmp))
658 if (tmp >= 0x100000000ULL)
659 return clib_error_return
660 (0, "private segment size %lld (%llu) too large", tmp, tmp);
661 ecm->private_segment_size = tmp;
663 else if (unformat (input, "preallocate-fifos"))
664 ecm->prealloc_fifos = 1;
665 else if (unformat (input, "preallocate-sessions"))
666 preallocate_sessions = 1;
668 if (unformat (input, "client-batch %d", &ecm->connections_per_batch))
670 else if (unformat (input, "appns %_%v%_", &appns_id))
672 else if (unformat (input, "all-scope"))
673 appns_flags |= (APP_OPTIONS_FLAGS_USE_GLOBAL_SCOPE
674 | APP_OPTIONS_FLAGS_USE_LOCAL_SCOPE);
675 else if (unformat (input, "local-scope"))
676 appns_flags = APP_OPTIONS_FLAGS_USE_LOCAL_SCOPE;
677 else if (unformat (input, "global-scope"))
678 appns_flags = APP_OPTIONS_FLAGS_USE_GLOBAL_SCOPE;
679 else if (unformat (input, "secret %lu", &appns_secret))
681 else if (unformat (input, "no-output"))
683 else if (unformat (input, "test-bytes"))
685 else if (unformat (input, "tls-engine %d", &ecm->tls_engine))
688 return clib_error_return (0, "failed: unknown input `%U'",
689 format_unformat_error, input);
692 /* Store cli process node index for signalling */
693 ecm->cli_node_index =
694 vlib_get_current_process (vm)->node_runtime.node_index;
696 if (ecm->is_init == 0)
698 if (echo_clients_init (vm))
699 return clib_error_return (0, "failed init");
703 ecm->ready_connections = 0;
704 ecm->expected_connections = n_clients;
708 if (!ecm->connect_uri)
710 clib_warning ("No uri provided. Using default: %s", default_uri);
711 ecm->connect_uri = format (0, "%s%c", default_uri, 0);
714 if (ecm->connect_uri[0] == 'u' && ecm->connect_uri[3] != 'c')
717 #if ECHO_CLIENT_PTHREAD
718 echo_clients_start_tx_pthread ();
721 vlib_worker_thread_barrier_sync (vm);
722 vnet_session_enable_disable (vm, 1 /* turn on session and transports */ );
723 vlib_worker_thread_barrier_release (vm);
725 if (ecm->test_client_attached == 0)
727 if ((error = echo_clients_attach (appns_id, appns_flags, appns_secret)))
730 clib_error_report (error);
735 ecm->test_client_attached = 1;
737 /* Turn on the builtin client input nodes */
738 for (i = 0; i < thread_main->n_vlib_mains; i++)
739 vlib_node_set_state (vlib_mains[i], echo_clients_node.index,
740 VLIB_NODE_STATE_POLLING);
742 if (preallocate_sessions)
743 pool_init_fixed (ecm->sessions, 1.1 * n_clients);
745 /* Fire off connect requests */
746 time_before_connects = vlib_time_now (vm);
747 if ((error = echo_clients_connect (vm, n_clients)))
750 /* Park until the sessions come up, or ten seconds elapse... */
751 vlib_process_wait_for_event_or_clock (vm, syn_timeout);
752 event_type = vlib_process_get_events (vm, &event_data);
756 ec_cli_output ("Timeout with only %d sessions active...",
757 ecm->ready_connections);
758 error = clib_error_return (0, "failed: syn timeout with %d sessions",
759 ecm->ready_connections);
763 delta = vlib_time_now (vm) - time_before_connects;
765 ec_cli_output ("%d three-way handshakes in %.2f seconds %.2f/s",
766 n_clients, delta, ((f64) n_clients) / delta);
768 ecm->test_start_time = vlib_time_now (ecm->vlib_main);
769 ec_cli_output ("Test started at %.6f", ecm->test_start_time);
773 ec_cli_output ("unexpected event(1): %d", event_type);
774 error = clib_error_return (0, "failed: unexpected event(1): %d",
779 /* Now wait for the sessions to finish... */
780 vlib_process_wait_for_event_or_clock (vm, test_timeout);
781 event_type = vlib_process_get_events (vm, &event_data);
785 ec_cli_output ("Timeout with %d sessions still active...",
786 ecm->ready_connections);
787 error = clib_error_return (0, "failed: timeout with %d sessions",
788 ecm->ready_connections);
792 ecm->test_end_time = vlib_time_now (vm);
793 ec_cli_output ("Test finished at %.6f", ecm->test_end_time);
797 ec_cli_output ("unexpected event(2): %d", event_type);
798 error = clib_error_return (0, "failed: unexpected event(2): %d",
803 delta = ecm->test_end_time - ecm->test_start_time;
806 total_bytes = (ecm->no_return ? ecm->tx_total : ecm->rx_total);
807 transfer_type = ecm->no_return ? "half-duplex" : "full-duplex";
808 ec_cli_output ("%lld bytes (%lld mbytes, %lld gbytes) in %.2f seconds",
809 total_bytes, total_bytes / (1ULL << 20),
810 total_bytes / (1ULL << 30), delta);
811 ec_cli_output ("%.2f bytes/second %s", ((f64) total_bytes) / (delta),
813 ec_cli_output ("%.4f gbit/second %s",
814 (((f64) total_bytes * 8.0) / delta / 1e9),
819 ec_cli_output ("zero delta-t?");
820 error = clib_error_return (0, "failed: zero delta-t");
824 if (ecm->test_bytes && ecm->test_failed)
825 error = clib_error_return (0, "failed: test bytes");
829 for (i = 0; i < vec_len (ecm->connection_index_by_thread); i++)
831 vec_reset_length (ecm->connection_index_by_thread[i]);
832 vec_reset_length (ecm->connections_this_batch_by_thread[i]);
835 pool_free (ecm->sessions);
837 /* Detach the application, so we can use different fifo sizes next time */
838 if (ecm->test_client_attached)
840 if (echo_clients_detach ())
842 error = clib_error_return (0, "failed: app detach");
843 ec_cli_output ("WARNING: app detach failed...");
847 ec_cli_output ("test failed");
848 vec_free (ecm->connect_uri);
853 VLIB_CLI_COMMAND (echo_clients_command, static) =
855 .path = "test echo clients",
856 .short_help = "test echo clients [nclients %d][[m|g]bytes <bytes>]"
857 "[test-timeout <time>][syn-timeout <time>][no-return][fifo-size <size>]"
858 "[private-segment-count <count>][private-segment-size <bytes>[m|g]]"
859 "[preallocate-fifos][preallocate-sessions][client-batch <batch-size>]"
860 "[uri <tcp://ip/port>][test-bytes][no-output]",
861 .function = echo_clients_command_fn,
867 echo_clients_main_init (vlib_main_t * vm)
869 echo_client_main_t *ecm = &echo_client_main;
874 VLIB_INIT_FUNCTION (echo_clients_main_init);
877 * fd.io coding-style-patch-verification: ON
880 * eval: (c-set-style "gnu")