aboutsummaryrefslogtreecommitdiffstats
path: root/src/vcl/vcl_test_client.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-08-28 11:32:04 -0700
committerDamjan Marion <dmarion@me.com>2018-08-30 21:01:45 +0000
commit134a996a0279577080b626d5172c1739efa00b92 (patch)
tree4e2bcc3c36ba5aa410622ac0de709f4ea8843e25 /src/vcl/vcl_test_client.c
parentac5554c960a8679f56b62effeec31671e04a13cb (diff)
vcl: add support for multi-worker apps
Add basic support for app registration of multiple workers. LDP does not work with multi-worker apps. Change-Id: I3fc421a2a591a077b275827463f874b261415a63 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.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/vcl/vcl_test_client.c b/src/vcl/vcl_test_client.c
index a34648bac42..af51b66610a 100644
--- a/src/vcl/vcl_test_client.c
+++ b/src/vcl/vcl_test_client.c
@@ -112,10 +112,8 @@ echo_test_client ()
sock_client_main_t *scm = &sock_client_main;
sock_test_socket_t *ctrl = &scm->ctrl_socket;
sock_test_socket_t *tsock;
- int rx_bytes, tx_bytes, nbytes;
- uint32_t i, n;
- int rv;
- int nfds = 0;
+ int rv, nfds = 0, rx_bytes, tx_bytes, nbytes;
+ uint32_t i, n, sidx;
fd_set wr_fdset, rd_fdset;
fd_set _wfdset, *wfdset = &_wfdset;
fd_set _rfdset, *rfdset = &_rfdset;
@@ -137,7 +135,9 @@ echo_test_client ()
FD_SET (tsock->fd, &wr_fdset);
FD_SET (tsock->fd, &rd_fdset);
- nfds = ((tsock->fd + 1) > nfds) ? (tsock->fd + 1) : nfds;
+ sidx = vppcom_session_index (tsock->fd);
+ nfds = sidx > nfds ? sidx : nfds;
+// nfds = ((tsock->fd + 1) > nfds) ? (tsock->fd + 1) : nfds;
}
nfds++;
@@ -166,7 +166,7 @@ echo_test_client ()
(tsock->stats.stop.tv_nsec == 0)))
continue;
- if (FD_ISSET (tsock->fd, wfdset)
+ if (FD_ISSET (vppcom_session_index (tsock->fd), wfdset)
&& (tsock->stats.tx_bytes < ctrl->cfg.total_bytes))
{
@@ -182,7 +182,7 @@ echo_test_client ()
}
- if ((FD_ISSET (tsock->fd, rfdset)) &&
+ if ((FD_ISSET (vppcom_session_index (tsock->fd), rfdset)) &&
(tsock->stats.rx_bytes < ctrl->cfg.total_bytes))
{
rx_bytes = vcl_test_read (tsock->fd, (uint8_t *) tsock->rxbuf,