aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/tcp/tcp_timer.h
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2020-10-08 09:28:32 -0700
committerDave Barach <openvpp@barachs.net>2020-10-08 22:13:20 +0000
commit49036a5e82f06781e74e106827fdbbfd349d1f6b (patch)
treefae89c7670ceb4534580a694611e22677c0220fd /src/vnet/tcp/tcp_timer.h
parent1046b1a631fd4153bca09b8924e34206ab3cf0ee (diff)
tcp: custom geometry for timer wheel
Type: refactor Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I04f992e5d91d21f1e5bbafef070478cfe268d94a
Diffstat (limited to 'src/vnet/tcp/tcp_timer.h')
-rw-r--r--src/vnet/tcp/tcp_timer.h21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/vnet/tcp/tcp_timer.h b/src/vnet/tcp/tcp_timer.h
index 914b5aaeeb7..f604152cdf9 100644
--- a/src/vnet/tcp/tcp_timer.h
+++ b/src/vnet/tcp/tcp_timer.h
@@ -23,8 +23,8 @@ tcp_timer_set (tcp_timer_wheel_t * tw, tcp_connection_t * tc, u8 timer_id,
{
ASSERT (tc->c_thread_index == vlib_get_thread_index ());
ASSERT (tc->timers[timer_id] == TCP_TIMER_HANDLE_INVALID);
- tc->timers[timer_id] = tw_timer_start_16t_2w_512sl (tw, tc->c_c_index,
- timer_id, interval);
+ tc->timers[timer_id] = tw_timer_start_tcp_twsl (tw, tc->c_c_index,
+ timer_id, interval);
}
always_inline void
@@ -35,7 +35,7 @@ tcp_timer_reset (tcp_timer_wheel_t * tw, tcp_connection_t * tc, u8 timer_id)
if (tc->timers[timer_id] == TCP_TIMER_HANDLE_INVALID)
return;
- tw_timer_stop_16t_2w_512sl (tw, tc->timers[timer_id]);
+ tw_timer_stop_tcp_twsl (tw, tc->timers[timer_id]);
tc->timers[timer_id] = TCP_TIMER_HANDLE_INVALID;
}
@@ -45,10 +45,10 @@ tcp_timer_update (tcp_timer_wheel_t * tw, tcp_connection_t * tc, u8 timer_id,
{
ASSERT (tc->c_thread_index == vlib_get_thread_index ());
if (tc->timers[timer_id] != TCP_TIMER_HANDLE_INVALID)
- tw_timer_update_16t_2w_512sl (tw, tc->timers[timer_id], interval);
+ tw_timer_update_tcp_twsl (tw, tc->timers[timer_id], interval);
else
- tc->timers[timer_id] = tw_timer_start_16t_2w_512sl (tw, tc->c_c_index,
- timer_id, interval);
+ tc->timers[timer_id] = tw_timer_start_tcp_twsl (tw, tc->c_c_index,
+ timer_id, interval);
}
always_inline void
@@ -120,6 +120,15 @@ tcp_timer_is_active (tcp_connection_t * tc, tcp_timers_e timer)
return tc->timers[timer] != TCP_TIMER_HANDLE_INVALID;
}
+always_inline void
+tcp_timer_expire_timers (tcp_timer_wheel_t * tw, f64 now)
+{
+ tw_timer_expire_timers_tcp_twsl (tw, now);
+}
+
+void tcp_timer_initialize_wheel (tcp_timer_wheel_t * tw,
+ void (*expired_timer_cb) (u32 *), f64 now);
+
#endif /* __included_tcp_timer_h__ */
/*