aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/tcp/tcp.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2020-07-16 10:05:02 -0700
committerDave Barach <openvpp@barachs.net>2020-07-23 16:39:48 +0000
commit1caf7f11c0197a912ccc28e67e4e9af75323af80 (patch)
tree2a243f6de4817ba23bdf58d29590d7fdc389e90c /src/vnet/tcp/tcp.c
parentbf9a0c8097d47f052efea13a09d3a6c6fc68fb35 (diff)
tcp: track pending timers
Also removes delack timer and reuses the u32 for the pending timers list. Type: fix Ticket: VPP-1923 Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I4edbb72d5b2aa5e14f87659f49e675af1e834aca
Diffstat (limited to 'src/vnet/tcp/tcp.c')
-rw-r--r--src/vnet/tcp/tcp.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/vnet/tcp/tcp.c b/src/vnet/tcp/tcp.c
index 3703a4aa358..c30a69304bc 100644
--- a/src/vnet/tcp/tcp.c
+++ b/src/vnet/tcp/tcp.c
@@ -1064,7 +1064,6 @@ tcp_timer_waitclose_handler (tcp_connection_t * tc)
static timer_expiration_handler *timer_expiration_handlers[TCP_N_TIMERS] =
{
tcp_timer_retransmit_handler,
- tcp_timer_delack_handler,
tcp_timer_persist_handler,
tcp_timer_waitclose_handler,
tcp_timer_retransmit_syn_handler,
@@ -1096,6 +1095,13 @@ tcp_dispatch_pending_timers (tcp_worker_ctx_t * wrk)
if (PREDICT_FALSE (!tc))
continue;
+ /* Skip if the timer is not pending. Probably it was reset while
+ * wating for dispatch */
+ if (PREDICT_FALSE (!(tc->pending_timers & (1 << timer_id))))
+ continue;
+
+ tc->pending_timers &= ~(1 << timer_id);
+
/* Skip timer if it was rearmed while pending dispatch */
if (PREDICT_FALSE (tc->timers[timer_id] != TCP_TIMER_HANDLE_INVALID))
continue;
@@ -1241,6 +1247,7 @@ tcp_expired_timers_dispatch (u32 * expired_timers)
TCP_EVT (TCP_EVT_TIMER_POP, connection_index, timer_id);
tc->timers[timer_id] = TCP_TIMER_HANDLE_INVALID;
+ tc->pending_timers |= (1 << timer_id);
}
clib_fifo_add (wrk->pending_timers, expired_timers, n_expired);