summaryrefslogtreecommitdiffstats
path: root/src/vnet/tcp/tcp.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-11-01 16:30:54 -0700
committerMarco Varlese <marco.varlese@suse.de>2018-11-02 08:06:46 +0000
commitc44a558164a466a74a4c10d4e7d7dd1b9a4b01dd (patch)
tree3f71b876678de40d0bd6f0a15f463dbe51d61719 /src/vnet/tcp/tcp.c
parentbe72ae6149a432899698a887b1820cf5c9d9456f (diff)
session: measure dispatch period only if under load
Also reset pacer on tcp retransmit timeout Change-Id: I5a9edee4c00d1d169248d79587a9b10437c2bd87 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/tcp/tcp.c')
-rw-r--r--src/vnet/tcp/tcp.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/vnet/tcp/tcp.c b/src/vnet/tcp/tcp.c
index 1726355f0e3..ba427b76b1a 100644
--- a/src/vnet/tcp/tcp.c
+++ b/src/vnet/tcp/tcp.c
@@ -1153,7 +1153,7 @@ const static transport_proto_vft_t tcp_proto = {
/* *INDENT-ON* */
void
-tcp_update_pacer (tcp_connection_t * tc)
+tcp_connection_tx_pacer_update (tcp_connection_t * tc)
{
f64 srtt;
@@ -1165,6 +1165,17 @@ tcp_update_pacer (tcp_connection_t * tc)
((f64) tc->cwnd) / srtt);
}
+void
+tcp_connection_tx_pacer_reset (tcp_connection_t * tc, u32 window,
+ u32 start_bucket)
+{
+ tcp_worker_ctx_t *wrk = tcp_get_worker (tc->c_thread_index);
+ u32 byte_rate = window / ((f64) TCP_TICK * tc->srtt);
+ u64 last_time = wrk->vm->clib_time.last_cpu_time;
+ transport_connection_tx_pacer_reset (&tc->connection, byte_rate,
+ start_bucket, last_time);
+}
+
static void
tcp_timer_keep_handler (u32 conn_index)
{