aboutsummaryrefslogtreecommitdiffstats
path: root/src/vcl/sock_test_server.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-09-17 22:09:02 -0700
committerDamjan Marion <dmarion@me.com>2018-09-20 10:05:48 +0000
commit0e88e851e058f4fb7cc690dbbdb19216ab360d1c (patch)
tree94b6117dfd76cc7a6da2ee344f676d7765d086e3 /src/vcl/sock_test_server.c
parent008dbe109ce2714be69ffb6549a0c0198a07f7d0 (diff)
session/svm: add want_tx_event flag to fifo
Have applications use explicit flag to request events from vpp when it transmits from a full fifo. Change-Id: I687c8f050a066bd5ce739d880eaec1f286038d95 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vcl/sock_test_server.c')
-rw-r--r--src/vcl/sock_test_server.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/vcl/sock_test_server.c b/src/vcl/sock_test_server.c
index 1280429f0f6..896aeb024d8 100644
--- a/src/vcl/sock_test_server.c
+++ b/src/vcl/sock_test_server.c
@@ -24,6 +24,7 @@
#include <vcl/sock_test.h>
#include <sys/stat.h>
#include <fcntl.h>
+#include <sys/ioctl.h>
#define SOCK_SERVER_USE_EPOLL 1
#define VPPCOM_SESSION_ATTR_UNIT_TEST 0
@@ -828,6 +829,7 @@ main (int argc, char **argv)
if (EPOLLIN & ssm->wait_events[i].events)
#endif
{
+ read_again:
rx_bytes = sock_test_read (client_fd, conn->buf,
conn->buf_size, &conn->stats);
if (rx_bytes > 0)
@@ -910,6 +912,8 @@ main (int argc, char **argv)
(conn->cfg.test == SOCK_TEST_TYPE_BI))
{
stream_test_server (conn, rx_bytes);
+ if (ioctl (conn->fd, FIONREAD))
+ goto read_again;
continue;
}