aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/session/session_node.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2019-11-13 19:09:47 -0800
committerDave Barach <openvpp@barachs.net>2019-11-20 18:34:07 +0000
commit11e9e351046d8f4ab61b8aaf975046215fba7c5d (patch)
tree950838b8740b5b7e56a5157df8ac748b3868c920 /src/vnet/session/session_node.c
parentd28437cdf2133533c9092b881ce0e4c243d6c1f6 (diff)
session tcp: support pacer idle timeouts
Type: feature To avoid excessive bursts, pacer must be provided with an estimated rtt for the connection. That's used to compute an idle timeout, i.e., time after which the bucket is reset to 1 mtu due to inactivity. For now, idle timeout is computed as 5% of the rtt. Change-Id: Ia0b752fe7b4ad0ce97b477fb886b0133a2321541 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/session/session_node.c')
-rw-r--r--src/vnet/session/session_node.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/vnet/session/session_node.c b/src/vnet/session/session_node.c
index e1114b794e6..a072bfa0f77 100644
--- a/src/vnet/session/session_node.c
+++ b/src/vnet/session/session_node.c
@@ -873,16 +873,29 @@ session_tx_fifo_read_and_snd_i (session_worker_t * wrk,
return SESSION_TX_NO_DATA;
}
- ctx->snd_space = transport_connection_snd_space (ctx->tc, ctx->snd_mss);
+ ctx->snd_space = transport_connection_snd_space (ctx->tc);
/* This flow queue is "empty" so it should be re-evaluated before
* the ones that have data to send. */
- if (ctx->snd_space == 0)
+ if (!ctx->snd_space)
{
session_evt_add_head_old (wrk, elt);
return SESSION_TX_NO_DATA;
}
+ if (transport_connection_is_tx_paced (ctx->tc))
+ {
+ u32 snd_space = transport_connection_tx_pacer_burst (ctx->tc);
+ if (snd_space < TRANSPORT_PACER_MIN_BURST)
+ {
+ session_evt_add_head_old (wrk, elt);
+ return SESSION_TX_NO_DATA;
+ }
+ snd_space = clib_min (ctx->snd_space, snd_space);
+ ctx->snd_space = snd_space >= ctx->snd_mss ?
+ snd_space - snd_space % ctx->snd_mss : snd_space;
+ }
+
/* Allow enqueuing of a new event */
svm_fifo_unset_event (ctx->s->tx_fifo);
@@ -891,7 +904,7 @@ session_tx_fifo_read_and_snd_i (session_worker_t * wrk,
if (PREDICT_FALSE (!ctx->max_len_to_snd))
{
- transport_connection_tx_pacer_reset_bucket (ctx->tc);
+ transport_connection_tx_pacer_reset_bucket (ctx->tc, 0);
return SESSION_TX_NO_DATA;
}