From f7f4e399e04774a6ca00b67006610f5b8f7a37c6 Mon Sep 17 00:00:00 2001 From: Yalei Wang Date: Thu, 9 Aug 2018 10:09:38 +0800 Subject: [PATCH] Fix the fifo-size limitation in tcp_echo Correct the size verification when send_test_chuck, tcp send process will not be broken when avalable fifo queue size less then the min_chuck. Change-Id: Ide13169283c0311cf2fb18d2606bc869065a2a1b Signed-off-by: Yalei Wang --- src/tests/vnet/session/tcp_echo.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/tests/vnet/session/tcp_echo.c b/src/tests/vnet/session/tcp_echo.c index 6a5d8c4b034..f37a7272b23 100644 --- a/src/tests/vnet/session/tcp_echo.c +++ b/src/tests/vnet/session/tcp_echo.c @@ -621,7 +621,7 @@ send_test_chunk (echo_main_t * em, session_t * s) u64 test_buf_len, bytes_this_chunk, test_buf_offset; svm_fifo_t *tx_fifo = s->server_tx_fifo; u8 *test_data = em->connect_test_data; - u32 enq_space, min_chunk = 16 << 10; + u32 enq_space = 16 << 10; int written; test_buf_len = vec_len (test_data); @@ -629,8 +629,6 @@ send_test_chunk (echo_main_t * em, session_t * s) bytes_this_chunk = clib_min (test_buf_len - test_buf_offset, s->bytes_to_send); enq_space = svm_fifo_max_enqueue (tx_fifo); - if (enq_space < clib_min (bytes_this_chunk, min_chunk)) - return; bytes_this_chunk = clib_min (bytes_this_chunk, enq_space); written = svm_fifo_enqueue_nowait (tx_fifo, bytes_this_chunk, -- 2.16.6