diff options
author | Florin Coras <fcoras@cisco.com> | 2024-07-02 04:34:54 -0700 |
---|---|---|
committer | Dave Barach <vpp@barachs.net> | 2024-07-08 16:27:06 +0000 |
commit | 75e8e1e948da182dbf4f6b3394f1b7fc44c1403a (patch) | |
tree | f35ad5134743fda3ac732bb5f7d3945e5005ac28 /src/vnet/tcp | |
parent | 6df9f442277603d3ebd3bcf950f7dd0d28fb42f5 (diff) |
session: improve enable and disable handling
Type: improvement
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I3c79d16f6a19767d990e8a4683c296219b559ccd
Diffstat (limited to 'src/vnet/tcp')
-rw-r--r-- | src/vnet/tcp/tcp.c | 4 | ||||
-rw-r--r-- | src/vnet/tcp/tcp_timer.c | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/vnet/tcp/tcp.c b/src/vnet/tcp/tcp.c index 28d7ed9fac1..1d164f236a1 100644 --- a/src/vnet/tcp/tcp.c +++ b/src/vnet/tcp/tcp.c @@ -1512,6 +1512,10 @@ tcp_main_enable (vlib_main_t * vm) clib_error_t *error = 0; int thread; + /* Already initialized */ + if (tm->wrk_ctx) + return 0; + if ((error = vlib_call_init_function (vm, ip_main_init))) return error; if ((error = vlib_call_init_function (vm, ip4_lookup_init))) diff --git a/src/vnet/tcp/tcp_timer.c b/src/vnet/tcp/tcp_timer.c index 8ae3f22eaa6..4d1c0624fee 100644 --- a/src/vnet/tcp/tcp_timer.c +++ b/src/vnet/tcp/tcp_timer.c @@ -20,8 +20,7 @@ void tcp_timer_initialize_wheel (tcp_timer_wheel_t * tw, void (*expired_timer_cb) (u32 *), f64 now) { - if (tw->timers) - return; + ASSERT (tw->timers == 0); tw_timer_wheel_init_tcp_twsl (tw, expired_timer_cb, TCP_TIMER_TICK, ~0); tw->last_run_time = now; } |