diff options
author | Florin Coras <fcoras@cisco.com> | 2020-07-31 12:32:40 -0700 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2020-08-03 15:36:32 +0000 |
commit | eedc74b804a955de39e013f14c97f2abb4770157 (patch) | |
tree | 6c9e640858a6f4b548c67ae8d2f97e9d69fdab47 /src/vnet/tcp/tcp.c | |
parent | f3ae9e32664ccc3ce0980fcafee9453a3c0cef9b (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.c')
-rw-r--r-- | src/vnet/tcp/tcp.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/vnet/tcp/tcp.c b/src/vnet/tcp/tcp.c index c30a69304bc..938a863238f 100644 --- a/src/vnet/tcp/tcp.c +++ b/src/vnet/tcp/tcp.c @@ -681,7 +681,7 @@ tcp_init_snd_vars (tcp_connection_t * tc) tc->snd_una = tc->iss; tc->snd_nxt = tc->iss + 1; tc->snd_una_max = tc->snd_nxt; - tc->srtt = 100; /* 100 ms */ + tc->srtt = 0.1 * THZ; /* 100 ms */ if (!tcp_cfg.csum_offload) tc->cfg_flags |= TCP_CFG_F_NO_CSUM_OFFLOAD; @@ -1361,11 +1361,6 @@ tcp_main_enable (vlib_main_t * vm) pool_init_fixed (tm->half_open_connections, tcp_cfg.preallocated_half_open_connections); - /* Initialize clocks per tick for TCP timestamp. Used to compute - * monotonically increasing timestamps. */ - tm->tstamp_ticks_per_clock = vm->clib_time.seconds_per_clock - / TCP_TSTAMP_RESOLUTION; - if (num_threads > 1) { clib_spinlock_init (&tm->half_open_lock); |