summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2020-10-22 11:22:22 -0700
committerDave Barach <openvpp@barachs.net>2020-10-23 19:24:30 +0000
commiteaec00cf87d155511b90df4fb83d7e99cb3f185f (patch)
treed3211aa7df45122d9bfcf0aab68ef58f214e8d51 /src
parente7653c3e35dfbe1090304af89f9713d917fbb84b (diff)
tcp: remove force retransmit timer update
Also simplify condition for detecting unintended timer pops. Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I8b120dfc2d16e40ee865240dbc9667708cd1c808
Diffstat (limited to 'src')
-rw-r--r--src/vnet/tcp/tcp_output.c17
-rw-r--r--src/vnet/tcp/tcp_timer.h8
2 files changed, 8 insertions, 17 deletions
diff --git a/src/vnet/tcp/tcp_output.c b/src/vnet/tcp/tcp_output.c
index 294b18c0294..5d8bd80af23 100644
--- a/src/vnet/tcp/tcp_output.c
+++ b/src/vnet/tcp/tcp_output.c
@@ -839,7 +839,8 @@ tcp_send_synack (tcp_connection_t * tc)
vlib_buffer_t *b;
u32 bi;
- tcp_retransmit_timer_force_update (&wrk->timer_wheel, tc);
+ ASSERT (tc->snd_una != tc->snd_nxt);
+ tcp_retransmit_timer_update (&wrk->timer_wheel, tc);
if (PREDICT_FALSE (!vlib_buffer_alloc (vm, &bi, 1)))
{
@@ -889,7 +890,6 @@ tcp_send_fin (tcp_connection_t * tc)
if ((tc->flags & TCP_CONN_SNDACK) && !tc->pending_dupacks)
tc->flags &= ~TCP_CONN_SNDACK;
- tcp_retransmit_timer_force_update (&wrk->timer_wheel, tc);
b = vlib_get_buffer (vm, bi);
tcp_init_buffer (vm, b);
tcp_make_fin (tc, b);
@@ -897,6 +897,7 @@ tcp_send_fin (tcp_connection_t * tc)
TCP_EVT (TCP_EVT_FIN_SENT, tc);
/* Account for the FIN */
tc->snd_nxt += 1;
+ tcp_retransmit_timer_update (&wrk->timer_wheel, tc);
if (!fin_snt)
{
tc->flags |= TCP_CONN_FINSNT;
@@ -1325,11 +1326,8 @@ tcp_timer_retransmit_handler (tcp_connection_t * tc)
return;
}
- /* Shouldn't be here. This condition is tricky because it has to take
- * into account boff > 0 due to persist timeout. */
- if ((tc->rto_boff == 0 && tc->snd_una == tc->snd_nxt)
- || (tc->rto_boff > 0 && seq_geq (tc->snd_una, tc->snd_congestion)
- && !tcp_flight_size (tc)))
+ /* Shouldn't be here */
+ if (tc->snd_una == tc->snd_nxt)
{
ASSERT (!tcp_in_recovery (tc));
tc->rto_boff = 0;
@@ -1379,7 +1377,7 @@ tcp_timer_retransmit_handler (tcp_connection_t * tc)
tcp_enqueue_to_output (wrk, b, bi, tc->c_is_ip4);
tc->rto = clib_min (tc->rto << 1, TCP_RTO_MAX);
- tcp_retransmit_timer_force_update (&wrk->timer_wheel, tc);
+ tcp_retransmit_timer_update (&wrk->timer_wheel, tc);
tc->rto_boff += 1;
if (tc->rto_boff == 1)
@@ -1422,7 +1420,8 @@ tcp_timer_retransmit_handler (tcp_connection_t * tc)
if (tc->rto_boff > TCP_RTO_SYN_RETRIES)
tc->rto = clib_min (tc->rto << 1, TCP_RTO_MAX);
- tcp_retransmit_timer_force_update (&wrk->timer_wheel, tc);
+ ASSERT (tc->snd_una != tc->snd_nxt);
+ tcp_retransmit_timer_update (&wrk->timer_wheel, tc);
b = vlib_get_buffer (vm, bi);
tcp_init_buffer (vm, b);
diff --git a/src/vnet/tcp/tcp_timer.h b/src/vnet/tcp/tcp_timer.h
index 06322a27d7e..45cf38263be 100644
--- a/src/vnet/tcp/tcp_timer.h
+++ b/src/vnet/tcp/tcp_timer.h
@@ -66,14 +66,6 @@ tcp_retransmit_timer_reset (tcp_timer_wheel_t * tw, tcp_connection_t * tc)
}
always_inline void
-tcp_retransmit_timer_force_update (tcp_timer_wheel_t * tw,
- tcp_connection_t * tc)
-{
- tcp_timer_update (tw, tc, TCP_TIMER_RETRANSMIT,
- clib_max (tc->rto * TCP_TO_TIMER_TICK, 1));
-}
-
-always_inline void
tcp_persist_timer_set (tcp_timer_wheel_t * tw, tcp_connection_t * tc)
{
/* Reuse RTO. It's backed off in handler */