aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/session
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2019-09-27 08:16:40 -0700
committerDave Barach <openvpp@barachs.net>2019-10-10 20:32:43 +0000
commitbe237bf02382854118986e8ea84c7544e42023f2 (patch)
tree85ef98b86f1a8949a54602c15b5510c7cccfda20 /src/vnet/session
parent5b1379be3e25df096d97dcd217965169fc6bb1b2 (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>
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 f1360226152..2cde1f99bb6 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 c5c2e915af5..9e53718b8dd 100644
--- a/src/vnet/session/session_node.c
+++ b/src/vnet/session/session_node.c
@@ -1421,6 +1421,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;
@@ -1470,8 +1472,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
@@ -1479,18 +1480,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;
}