From b092b77cf238baf1ebba32cb984e9318ff62ad4d Mon Sep 17 00:00:00 2001 From: Yu Ping Date: Fri, 27 Dec 2019 04:04:33 +0800 Subject: tcp: Enable TCP timewait port use Improve host stack CPS test, and it help improve 10x performance Type: feature Change-Id: I6af61e0bad7c16ee2d30a1422cc46bb89f1cedb4 Signed-off-by: Yu Ping Signed-off-by: Yuwei Zhang --- src/vnet/tcp/tcp.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/vnet/tcp/tcp.h') diff --git a/src/vnet/tcp/tcp.h b/src/vnet/tcp/tcp.h index 2de25277b60..52cc308871b 100644 --- a/src/vnet/tcp/tcp.h +++ b/src/vnet/tcp/tcp.h @@ -765,7 +765,10 @@ u8 *format_tcp_connection (u8 * s, va_list * args); always_inline tcp_connection_t * tcp_listener_get (u32 tli) { - return pool_elt_at_index (tcp_main.listener_pool, tli); + tcp_connection_t *tc = 0; + if (!pool_is_free_index (tcp_main.listener_pool, tli)) + tc = pool_elt_at_index (tcp_main.listener_pool, tli); + return tc; } always_inline tcp_connection_t * -- cgit 1.2.3-korg