Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
session: lock app worker mq for io events
[vpp.git]
/
src
/
vcl
/
vcl_test_server.c
diff --git
a/src/vcl/vcl_test_server.c
b/src/vcl/vcl_test_server.c
index
2fdd7ec
..
5c8656c
100644
(file)
--- a/
src/vcl/vcl_test_server.c
+++ b/
src/vcl/vcl_test_server.c
@@
-497,6
+497,7
@@
vts_worker_init (vcl_test_server_worker_t * wrk)
if (rv < 0)
vtfail ("vppcom_epoll_ctl", rv);
if (rv < 0)
vtfail ("vppcom_epoll_ctl", rv);
+ ssm->active_workers += 1;
vtinf ("Waiting for a client to connect on port %d ...", ssm->cfg.port);
}
vtinf ("Waiting for a client to connect on port %d ...", ssm->cfg.port);
}
@@
-532,6
+533,12
@@
vts_worker_loop (void *arg)
if (wrk->wait_events[i].events & (EPOLLHUP | EPOLLRDHUP))
{
vppcom_session_close (conn->fd);
if (wrk->wait_events[i].events & (EPOLLHUP | EPOLLRDHUP))
{
vppcom_session_close (conn->fd);
+ wrk->nfds -= 1;
+ if (!wrk->nfds)
+ {
+ vtinf ("All client connections closed\n");
+ goto done;
+ }
continue;
}
if (wrk->wait_events[i].data.u32 == ~0)
continue;
}
if (wrk->wait_events[i].data.u32 == ~0)
@@
-542,6
+549,7
@@
vts_worker_loop (void *arg)
if (EPOLLIN & wrk->wait_events[i].events)
{
if (EPOLLIN & wrk->wait_events[i].events)
{
+ read_again:
rx_bytes = vcl_test_read (conn->fd, conn->buf,
conn->buf_size, &conn->stats);
rx_bytes = vcl_test_read (conn->fd, conn->buf,
conn->buf_size, &conn->stats);
@@
-563,7
+571,6
@@
vts_worker_loop (void *arg)
if (!wrk->nfds)
{
vtinf ("All client connections closed\n");
if (!wrk->nfds)
{
vtinf ("All client connections closed\n");
- vtinf ("May the force be with you!\n");
goto done;
}
continue;
goto done;
}
continue;
@@
-572,6
+579,9
@@
vts_worker_loop (void *arg)
|| (conn->cfg.test == SOCK_TEST_TYPE_BI))
{
vts_server_rx (conn, rx_bytes);
|| (conn->cfg.test == SOCK_TEST_TYPE_BI))
{
vts_server_rx (conn, rx_bytes);
+ if (vppcom_session_attr (conn->fd, VPPCOM_ATTR_GET_NREAD, 0,
+ 0) > 0)
+ goto read_again;
continue;
}
else if (isascii (conn->buf[0]))
continue;
}
else if (isascii (conn->buf[0]))