summaryrefslogtreecommitdiffstats
path: root/src/vnet/tcp/tcp.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-06-19 09:58:04 -0700
committerDave Barach <openvpp@barachs.net>2018-06-20 16:18:44 +0000
commit2c4144367cb4fd9f44853e2bb974e78eccff3cc7 (patch)
tree37ab492b8894e65f0622e4b9d28439ee64e36043 /src/vnet/tcp/tcp.c
parentee52d877d41a6349c1090f62fb2948f90e6301ce (diff)
tcp: add per worker ctx structure
Change-Id: I28d3c31bdc4255a4ca223d80bcf44709fb39f4ed Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/tcp/tcp.c')
-rw-r--r--src/vnet/tcp/tcp.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/src/vnet/tcp/tcp.c b/src/vnet/tcp/tcp.c
index 854577b5575..30173619e0e 100644
--- a/src/vnet/tcp/tcp.c
+++ b/src/vnet/tcp/tcp.c
@@ -1063,7 +1063,8 @@ void
tcp_update_time (f64 now, u8 thread_index)
{
tcp_set_time_now (thread_index);
- tw_timer_expire_timers_16t_2w_512sl (&tcp_main.timer_wheels[thread_index],
+ tw_timer_expire_timers_16t_2w_512sl (&tcp_main.
+ wrk_ctx[thread_index].timer_wheel,
now);
tcp_flush_frames_to_output (thread_index);
}
@@ -1203,7 +1204,7 @@ tcp_initialize_timer_wheels (tcp_main_t * tm)
tw_timer_wheel_16t_2w_512sl_t *tw;
/* *INDENT-OFF* */
foreach_vlib_main (({
- tw = &tm->timer_wheels[ii];
+ tw = &tm->wrk_ctx[ii].timer_wheel;
tw_timer_wheel_init_16t_2w_512sl (tw, tcp_expired_timers_dispatch,
100e-3 /* timer period 100ms */ , ~0);
tw->last_run_time = vlib_time_now (this_vlib_main);
@@ -1272,13 +1273,6 @@ tcp_main_enable (vlib_main_t * vm)
pool_init_fixed (tm->half_open_connections,
tm->preallocated_half_open_connections);
- /* Initialize per worker thread tx buffers (used for control messages) */
- vec_validate (tm->tx_buffers, num_threads - 1);
-
- /* Initialize timer wheels */
- vec_validate (tm->timer_wheels, num_threads - 1);
- tcp_initialize_timer_wheels (tm);
-
/* Initialize clocks per tick for TCP timestamp. Used to compute
* monotonically increasing timestamps. */
tm->tstamp_ticks_per_clock = vm->clib_time.seconds_per_clock
@@ -1289,15 +1283,12 @@ tcp_main_enable (vlib_main_t * vm)
clib_spinlock_init (&tm->half_open_lock);
}
- vec_validate (tm->tx_frames[0], num_threads - 1);
- vec_validate (tm->tx_frames[1], num_threads - 1);
- vec_validate (tm->ip_lookup_tx_frames[0], num_threads - 1);
- vec_validate (tm->ip_lookup_tx_frames[1], num_threads - 1);
+ vec_validate (tm->wrk_ctx, num_threads - 1);
+ tcp_initialize_timer_wheels (tm);
tm->bytes_per_buffer = vlib_buffer_free_list_buffer_size
(vm, VLIB_BUFFER_DEFAULT_FREE_LIST_INDEX);
- vec_validate (tm->time_now, num_threads - 1);
return error;
}