summaryrefslogtreecommitdiffstats
path: root/src/vnet/tcp/tcp.h
diff options
context:
space:
mode:
authorYu Ping <ping.yu@intel.com>2019-12-27 04:04:33 +0800
committerFlorin Coras <florin.coras@gmail.com>2019-12-27 17:17:51 +0000
commitb092b77cf238baf1ebba32cb984e9318ff62ad4d (patch)
treeb71be2242b95c79f977eb237fbf68ad2e550a33c /src/vnet/tcp/tcp.h
parenta42c6ee973bf8e51a5a41aede803a1984b0aa80b (diff)
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 <ping.yu@intel.com> Signed-off-by: Yuwei Zhang <yuwei1.zhang@intel.com>
Diffstat (limited to 'src/vnet/tcp/tcp.h')
-rw-r--r--src/vnet/tcp/tcp.h5
1 files changed, 4 insertions, 1 deletions
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 *