aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/tcp/tcp.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/tcp/tcp.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/tcp/tcp.c')
-rw-r--r--src/vnet/tcp/tcp.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/vnet/tcp/tcp.c b/src/vnet/tcp/tcp.c
index c0b50ce6962..86729011f8f 100644
--- a/src/vnet/tcp/tcp.c
+++ b/src/vnet/tcp/tcp.c
@@ -1396,8 +1396,11 @@ tcp_connection_tx_pacer_update (tcp_connection_t * tc)
if (!transport_connection_is_tx_paced (&tc->connection))
return;
+ f64 srtt = clib_min ((f64) tc->srtt * TCP_TICK, tc->mrtt_us);
+
transport_connection_tx_pacer_update (&tc->connection,
- tcp_cc_get_pacing_rate (tc));
+ tcp_cc_get_pacing_rate (tc),
+ srtt * CLIB_US_TIME_FREQ);
}
void
@@ -1406,7 +1409,8 @@ tcp_connection_tx_pacer_reset (tcp_connection_t * tc, u32 window,
{
f64 srtt = clib_min ((f64) tc->srtt * TCP_TICK, tc->mrtt_us);
u64 rate = (u64) window / srtt;
- transport_connection_tx_pacer_reset (&tc->connection, rate, start_bucket);
+ transport_connection_tx_pacer_reset (&tc->connection, rate, start_bucket,
+ srtt * CLIB_US_TIME_FREQ);
}
static void