diff options
author | Florin Coras <fcoras@cisco.com> | 2018-09-11 16:33:36 -0700 |
---|---|---|
committer | Marco Varlese <marco.varlese@suse.de> | 2018-09-12 09:13:16 +0000 |
commit | 2cba8533cc4444c4615903add9a8f20c7c87079c (patch) | |
tree | 3a35e400cd081c34ae5801d71f5fec51c02611df /src/vcl/vcl_test_client.c | |
parent | 41c9e04be0ca3a081926045e78dc969dab563532 (diff) |
vcl: add apis that expos fifo as buffer
Change-Id: I4bd9c9f73499711e04b38d53daa5c917a4285bf5
Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vcl/vcl_test_client.c')
-rw-r--r-- | src/vcl/vcl_test_client.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/vcl/vcl_test_client.c b/src/vcl/vcl_test_client.c index 899d729c47d..c92f0cb754d 100644 --- a/src/vcl/vcl_test_client.c +++ b/src/vcl/vcl_test_client.c @@ -314,6 +314,7 @@ vtc_worker_sessions_exit (vcl_test_client_worker_t * wrk) (void) vcl_test_write (tsock->fd, (uint8_t *) & tsock->cfg, sizeof (tsock->cfg), &tsock->stats, verbose); } + wrk->n_sessions = 0; } static void * @@ -322,10 +323,10 @@ vtc_worker_loop (void *arg) vcl_test_client_main_t *vcm = &vcl_client_main; sock_test_socket_t *ctrl = &vcm->ctrl_socket; vcl_test_client_worker_t *wrk = arg; + uint32_t n_active_sessions, n_bytes; fd_set _wfdset, *wfdset = &_wfdset; fd_set _rfdset, *rfdset = &_rfdset; sock_test_socket_t *tsock; - uint32_t n_active_sessions; int i, rv, check_rx = 0; rv = vtc_worker_init (wrk); @@ -374,8 +375,11 @@ vtc_worker_loop (void *arg) if (FD_ISSET (vppcom_session_index (tsock->fd), wfdset) && tsock->stats.tx_bytes < tsock->cfg.total_bytes) { + n_bytes = tsock->cfg.txbuf_size; + if (tsock->cfg.test == SOCK_TEST_TYPE_ECHO) + n_bytes = strlen (ctrl->txbuf) + 1; rv = vcl_test_write (tsock->fd, (uint8_t *) tsock->txbuf, - tsock->cfg.txbuf_size, &tsock->stats, + n_bytes, &tsock->stats, tsock->cfg.verbose); if (rv < 0) { @@ -396,7 +400,8 @@ vtc_worker_loop (void *arg) } exit: vtinf ("Worker %d done ...", wrk->wrk_index); - vtc_accumulate_stats (wrk, ctrl); + if (tsock->cfg.test != SOCK_TEST_TYPE_ECHO) + vtc_accumulate_stats (wrk, ctrl); sleep (1); vtc_worker_sessions_exit (wrk); if (wrk->wrk_index) @@ -462,9 +467,11 @@ vtc_echo_client (vcl_test_client_main_t * vcm) vtc_worker_loop (wrk); - clock_gettime (CLOCK_REALTIME, &ctrl->stats.stop); - vtc_accumulate_stats (wrk, ctrl); - vtc_print_stats (ctrl); + /* Not relevant for echo test + clock_gettime (CLOCK_REALTIME, &ctrl->stats.stop); + vtc_accumulate_stats (wrk, ctrl); + vtc_print_stats (ctrl); + */ } static void |