summaryrefslogtreecommitdiffstats
path: root/src/vnet/tcp/tcp_inlines.h
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2020-07-31 12:32:40 -0700
committerFlorin Coras <florin.coras@gmail.com>2020-08-03 15:36:32 +0000
commiteedc74b804a955de39e013f14c97f2abb4770157 (patch)
tree6c9e640858a6f4b548c67ae8d2f97e9d69fdab47 /src/vnet/tcp/tcp_inlines.h
parentf3ae9e32664ccc3ce0980fcafee9453a3c0cef9b (diff)
tcp: improve timestamp rtt accuracy
- switch to using vlib_time as reference for timestamps - use us precision ticks for tcp but keep using ms precision for timestamps. As a result, srtt, rttvar and rto are now measured in us instead of ms. MRTT samples from timestamps are converted from ms to us (not accurate under ms) while high precision samples are used with us precision, i.e., they're no longer converted to ms precision samples. Type: improvement Change-Id: Ibda559575d9b4fdc85b0985264f7c865ff367e34 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/tcp/tcp_inlines.h')
-rw-r--r--src/vnet/tcp/tcp_inlines.h4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/vnet/tcp/tcp_inlines.h b/src/vnet/tcp/tcp_inlines.h
index c4b155aa499..cb00ca4a97b 100644
--- a/src/vnet/tcp/tcp_inlines.h
+++ b/src/vnet/tcp/tcp_inlines.h
@@ -218,9 +218,7 @@ tcp_time_now_us (u32 thread_index)
always_inline u32
tcp_set_time_now (tcp_worker_ctx_t * wrk)
{
- tcp_main_t *tm = &tcp_main;
- wrk->time_now = (u64) (clib_cpu_time_now () * tm->tstamp_ticks_per_clock);
- return wrk->time_now;
+ return wrk->time_now = (u64) (vlib_time_now (wrk->vm) * TCP_TSTP_HZ);
}
always_inline tcp_connection_t *