summaryrefslogtreecommitdiffstats
path: root/src/vnet/tcp/tcp_output.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2019-11-22 17:38:25 -0800
committerDave Barach <openvpp@barachs.net>2019-11-25 20:00:55 +0000
commitb72a0ff73514ec7ea79ed3fad49b77d56b248642 (patch)
tree232b9ed952b09aa86f8305a1fa01729067cb75c3 /src/vnet/tcp/tcp_output.c
parent3afac8f81833b3cd78efd5f02f2bfbca4c1dc20f (diff)
tcp: invalidate expired timer handles before dispatching
Type: fix Change-Id: Icc8cd05cb9c1844a9f8b0399797ad554f4ccf1a1 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/tcp/tcp_output.c')
-rw-r--r--src/vnet/tcp/tcp_output.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/src/vnet/tcp/tcp_output.c b/src/vnet/tcp/tcp_output.c
index d6e1adc9600..f63ffa64022 100644
--- a/src/vnet/tcp/tcp_output.c
+++ b/src/vnet/tcp/tcp_output.c
@@ -1210,13 +1210,11 @@ tcp_program_retransmit (tcp_connection_t * tc)
* Sends delayed ACK when timer expires
*/
void
-tcp_timer_delack_handler (u32 index)
+tcp_timer_delack_handler (u32 index, u32 thread_index)
{
- u32 thread_index = vlib_get_thread_index ();
tcp_connection_t *tc;
tc = tcp_connection_get (index, thread_index);
- tc->timers[TCP_TIMER_DELACK] = TCP_TIMER_HANDLE_INVALID;
tcp_send_ack (tc);
}
@@ -1446,9 +1444,8 @@ tcp_cc_init_rxt_timeout (tcp_connection_t * tc)
}
void
-tcp_timer_retransmit_handler (u32 tc_index)
+tcp_timer_retransmit_handler (u32 tc_index, u32 thread_index)
{
- u32 thread_index = vlib_get_thread_index ();
tcp_worker_ctx_t *wrk = tcp_get_worker (thread_index);
vlib_main_t *vm = wrk->vm;
tcp_connection_t *tc;
@@ -1461,8 +1458,6 @@ tcp_timer_retransmit_handler (u32 tc_index)
if (PREDICT_FALSE (tc == 0 || tc->state == TCP_STATE_SYN_SENT))
return;
- tc->timers[TCP_TIMER_RETRANSMIT] = TCP_TIMER_HANDLE_INVALID;
-
/* Wait-close and retransmit could pop at the same time */
if (tc->state == TCP_STATE_CLOSED)
return;
@@ -1595,9 +1590,8 @@ tcp_timer_retransmit_handler (u32 tc_index)
* SYN retransmit timer handler. Active open only.
*/
void
-tcp_timer_retransmit_syn_handler (u32 tc_index)
+tcp_timer_retransmit_syn_handler (u32 tc_index, u32 thread_index)
{
- u32 thread_index = vlib_get_thread_index ();
tcp_worker_ctx_t *wrk = tcp_get_worker (thread_index);
vlib_main_t *vm = wrk->vm;
tcp_connection_t *tc;
@@ -1610,8 +1604,6 @@ tcp_timer_retransmit_syn_handler (u32 tc_index)
if (PREDICT_FALSE (tc == 0 || tc->state != TCP_STATE_SYN_SENT))
return;
- tc->timers[TCP_TIMER_RETRANSMIT_SYN] = TCP_TIMER_HANDLE_INVALID;
-
/* Half-open connection actually moved to established but we were
* waiting for syn retransmit to pop to call cleanup from the right
* thread. */
@@ -1664,9 +1656,8 @@ tcp_timer_retransmit_syn_handler (u32 tc_index)
*
*/
void
-tcp_timer_persist_handler (u32 index)
+tcp_timer_persist_handler (u32 index, u32 thread_index)
{
- u32 thread_index = vlib_get_thread_index ();
tcp_worker_ctx_t *wrk = tcp_get_worker (thread_index);
u32 bi, max_snd_bytes, available_bytes, offset;
tcp_main_t *tm = vnet_get_tcp_main ();
@@ -1680,9 +1671,6 @@ tcp_timer_persist_handler (u32 index)
if (!tc)
return;
- /* Make sure timer handle is set to invalid */
- tc->timers[TCP_TIMER_PERSIST] = TCP_TIMER_HANDLE_INVALID;
-
/* Problem already solved or worse */
if (tc->state == TCP_STATE_CLOSED || tc->snd_wnd > tc->snd_mss
|| (tc->flags & TCP_CONN_FINSNT))