summaryrefslogtreecommitdiffstats
path: root/src/vnet/tcp/tcp.c
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2020-04-28 18:00:21 -0400
committerFlorin Coras <florin.coras@gmail.com>2020-04-28 23:04:23 +0000
commit77d98382824ca211fb55fcf842931930ccfb3baa (patch)
treec0ec1d4b678577849194676bb53409f6d49e696a /src/vnet/tcp/tcp.c
parent635f5068f0802ec1fe34c998b72fb2f626259050 (diff)
vlib: add ASSERT to vlib_time_now(...)
Calling vlib_time_now (&vlib_global_main) from a worker thread is a bad mistake. ASSERT (vm->thread_index == __os_thread_index) will catch it. Type: improvement Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I55af6de84e06143f8f43adc62103b77267a7a441
Diffstat (limited to 'src/vnet/tcp/tcp.c')
-rw-r--r--src/vnet/tcp/tcp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/vnet/tcp/tcp.c b/src/vnet/tcp/tcp.c
index df3d61db48d..3703a4aa358 100644
--- a/src/vnet/tcp/tcp.c
+++ b/src/vnet/tcp/tcp.c
@@ -1258,13 +1258,14 @@ tcp_expired_timers_dispatch (u32 * expired_timers)
static void
tcp_initialize_timer_wheels (tcp_main_t * tm)
{
+ vlib_main_t *vm = vlib_get_main ();
tw_timer_wheel_16t_2w_512sl_t *tw;
/* *INDENT-OFF* */
foreach_vlib_main (({
tw = &tm->wrk_ctx[ii].timer_wheel;
tw_timer_wheel_init_16t_2w_512sl (tw, tcp_expired_timers_dispatch,
TCP_TIMER_TICK, ~0);
- tw->last_run_time = vlib_time_now (this_vlib_main);
+ tw->last_run_time = vlib_time_now (vm);
}));
/* *INDENT-ON* */
}