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>
diff --git a/src/vnet/tcp/tcp.h b/src/vnet/tcp/tcp.h
index 2de2527..52cc308 100644
--- a/src/vnet/tcp/tcp.h
+++ b/src/vnet/tcp/tcp.h
@@ -765,7 +765,10 @@
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 *