summaryrefslogtreecommitdiffstats
path: root/src/vnet/session
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2019-09-27 08:16:40 -0700
committerAndrew Yourtchenko <ayourtch@gmail.com>2019-10-27 10:02:16 +0000
commit7b135c639e7d8144859258700700112d0c61f8c1 (patch)
treee1043d3c21e560c0d0cf9b9b321278e22b7dc959 /src/vnet/session
parent31c31c25e92435b24b321615266b8ad9d5d2d1aa (diff)
tcp: retry lost retransmits
Add heuristic that detects lost retransmitted segments and retries sending them. Type: feature Change-Id: I34d1bb16799e1993779222eb2bfad4b40704159e Signed-off-by: Florin Coras <fcoras@cisco.com> (cherry picked from commit be237bf02382854118986e8ea84c7544e42023f2)
Diffstat (limited to 'src/vnet/session')
-rw-r--r--src/vnet/session/session.c2
-rw-r--r--src/vnet/session/session_node.c22
-rw-r--r--src/vnet/session/transport.c9
3 files changed, 26 insertions, 7 deletions
diff --git a/src/vnet/session/session.c b/src/vnet/session/session.c
index be62d929363..32d7914a607 100644
--- a/src/vnet/session/session.c
+++ b/src/vnet/session/session.c
@@ -125,7 +125,7 @@ session_add_self_custom_tx_evt (transport_connection_t * tc, u8 has_prio)
s = session_get (tc->s_index, tc->thread_index);
ASSERT (s->thread_index == vlib_get_thread_index ());
- ASSERT (s->session_state < SESSION_STATE_TRANSPORT_DELETED);
+ ASSERT (s->session_state != SESSION_STATE_TRANSPORT_DELETED);
if (!(s->flags & SESSION_F_CUSTOM_TX))
{
s->flags |= SESSION_F_CUSTOM_TX;
diff --git a/src/vnet/session/session_node.c b/src/vnet/session/session_node.c
index e2e98eba19f..99fa4bdac91 100644
--- a/src/vnet/session/session_node.c
+++ b/src/vnet/session/session_node.c
@@ -1418,6 +1418,8 @@ session_node_cmp_event (session_event_t * e, svm_fifo_t * f)
case SESSION_IO_EVT_RX:
case SESSION_IO_EVT_TX:
case SESSION_IO_EVT_BUILTIN_RX:
+ case SESSION_IO_EVT_BUILTIN_TX:
+ case SESSION_IO_EVT_TX_FLUSH:
if (e->session_index == f->master_session_index)
return 1;
break;
@@ -1467,8 +1469,7 @@ session_node_lookup_fifo_event (svm_fifo_t * f, session_event_t * e)
found = session_node_cmp_event (e, f);
if (found)
return 1;
- if (++index == mq->q->maxsize)
- index = 0;
+ index = (index + 1) % mq->q->maxsize;
}
/*
* Search pending events vector
@@ -1476,18 +1477,31 @@ session_node_lookup_fifo_event (svm_fifo_t * f, session_event_t * e)
/* *INDENT-OFF* */
clib_llist_foreach (wrk->event_elts, evt_list,
- pool_elt_at_index (wrk->event_elts, wrk->old_head),
+ pool_elt_at_index (wrk->event_elts, wrk->new_head),
elt, ({
found = session_node_cmp_event (&elt->evt, f);
if (found)
{
clib_memcpy_fast (e, &elt->evt, sizeof (*e));
- break;
+ goto done;
}
+ }));
+ /* *INDENT-ON* */
+ /* *INDENT-OFF* */
+ clib_llist_foreach (wrk->event_elts, evt_list,
+ pool_elt_at_index (wrk->event_elts, wrk->old_head),
+ elt, ({
+ found = session_node_cmp_event (&elt->evt, f);
+ if (found)
+ {
+ clib_memcpy_fast (e, &elt->evt, sizeof (*e));
+ goto done;
+ }
}));
/* *INDENT-ON* */
+done:
return found;
}
diff --git a/src/vnet/session/transport.c b/src/vnet/session/transport.c
index 3e723994752..49a4af71111 100644
--- a/src/vnet/session/transport.c
+++ b/src/vnet/session/transport.c
@@ -566,9 +566,14 @@ u8 *
format_transport_pacer (u8 * s, va_list * args)
{
spacer_t *pacer = va_arg (*args, spacer_t *);
+ vlib_main_t *vm = vlib_get_main ();
+ u64 now, diff;
- s = format (s, "bucket %u tokens/period %.3f last_update %x",
- pacer->bucket, pacer->tokens_per_period, pacer->last_update);
+ now = vm->clib_time.last_cpu_time;
+ diff = now - (pacer->last_update << SPACER_CPU_TICKS_PER_PERIOD_SHIFT);
+ s = format (s, "rate %u bucket %u t/p %.3f last_update %.3f",
+ pacer->bytes_per_sec, pacer->bucket, pacer->tokens_per_period,
+ diff * vm->clib_time.seconds_per_clock);
return s;
}