diff options
author | Florin Coras <fcoras@cisco.com> | 2019-08-16 09:44:00 -0700 |
---|---|---|
committer | John Lo <loj@cisco.com> | 2019-09-20 21:36:07 +0000 |
commit | 7fe501a4b585f87bb095a2b023c381cd8baa2abe (patch) | |
tree | b79d1d0b39676b491360ef446a1b421293e97863 /src/vnet/tcp/tcp.c | |
parent | 82df1eb9002cf0d9e06474626e864ae2ce8a34b6 (diff) |
tcp: set cc_algo on connection alloc
Type: feature
Change-Id: Ie00329b11e26cab5db64b9c006171d283854c8ef
Signed-off-by: Florin Coras <fcoras@cisco.com>
(cherry picked from commit 12f6936cd8f69f17820ef749515fcf4d50001c60)
Diffstat (limited to 'src/vnet/tcp/tcp.c')
-rw-r--r-- | src/vnet/tcp/tcp.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/vnet/tcp/tcp.c b/src/vnet/tcp/tcp.c index 4628e4ba38d..44ee8c8bfcb 100644 --- a/src/vnet/tcp/tcp.c +++ b/src/vnet/tcp/tcp.c @@ -73,7 +73,6 @@ tcp_add_del_adjacency (tcp_connection_t * tc, u8 is_add) static void tcp_cc_init (tcp_connection_t * tc) { - tc->cc_algo = tcp_cc_algo_get (tcp_cfg.cc_algo); tc->cc_algo->init (tc); } @@ -136,6 +135,7 @@ tcp_connection_bind (u32 session_index, transport_endpoint_t * lcl) listener->c_s_index = session_index; listener->c_fib_index = lcl->fib_index; listener->state = TCP_STATE_LISTEN; + listener->cc_algo = tcp_cc_algo_get (tcp_cfg.cc_algo); tcp_connection_timers_init (listener); @@ -306,6 +306,19 @@ tcp_connection_alloc (u8 thread_index) return tc; } +tcp_connection_t * +tcp_connection_alloc_w_base (u8 thread_index, tcp_connection_t * base) +{ + tcp_main_t *tm = vnet_get_tcp_main (); + tcp_connection_t *tc; + + pool_get (tm->connections[thread_index], tc); + clib_memcpy_fast (tc, base, sizeof (*tc)); + tc->c_c_index = tc - tm->connections[thread_index]; + tc->c_thread_index = thread_index; + return tc; +} + void tcp_connection_free (tcp_connection_t * tc) { @@ -738,6 +751,7 @@ tcp_session_open (transport_endpoint_cfg_t * rmt) tc->c_is_ip4 = rmt->is_ip4; tc->c_proto = TRANSPORT_PROTO_TCP; tc->c_fib_index = rmt->fib_index; + tc->cc_algo = tcp_cc_algo_get (tcp_cfg.cc_algo); /* The other connection vars will be initialized after SYN ACK */ tcp_connection_timers_init (tc); |