diff options
author | Florin Coras <fcoras@cisco.com> | 2019-09-10 23:26:27 -0700 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2019-09-18 14:40:43 +0000 |
commit | 7436b436733ea7217e745f3cc9971aaff1e3dfa4 (patch) | |
tree | 9a37720468bc5d0b4294de98c9bb781145550577 /src/vnet/tcp/tcp_bt.c | |
parent | 43765e2b4eaa8e1f2a5f1562414e04962c777ff3 (diff) |
tcp: compute snd time for rate sample
Type: feature
Change-Id: I6bd675dc28dbc34293e895911efe986844c0564f
Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/tcp/tcp_bt.c')
-rw-r--r-- | src/vnet/tcp/tcp_bt.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/vnet/tcp/tcp_bt.c b/src/vnet/tcp/tcp_bt.c index fe007543cd0..b550fdd65dd 100644 --- a/src/vnet/tcp/tcp_bt.c +++ b/src/vnet/tcp/tcp_bt.c @@ -241,8 +241,8 @@ tcp_bt_alloc_tx_sample (tcp_connection_t * tc, u32 min_seq) bts = bt_alloc_sample (tc->bt, min_seq); bts->delivered = tc->delivered; bts->delivered_time = tc->delivered_time; - bts->tx_rate = transport_connection_tx_pacer_rate (&tc->connection); bts->tx_time = tcp_time_now_us (tc->c_thread_index); + bts->first_tx_time = tc->first_tx_time; bts->flags |= tc->app_limited ? TCP_BTS_IS_APP_LIMITED : 0; return bts; } @@ -270,7 +270,10 @@ tcp_bt_track_tx (tcp_connection_t * tc) u32 bts_index; if (tc->snd_una == tc->snd_nxt) - tc->delivered_time = tcp_time_now_us (tc->c_thread_index); + { + tc->delivered_time = tcp_time_now_us (tc->c_thread_index); + tc->first_tx_time = tc->delivered_time; + } bts = tcp_bt_alloc_tx_sample (tc, tc->snd_nxt); bts_index = bt_sample_index (bt, bts); @@ -421,9 +424,10 @@ tcp_bt_sample_to_rate_sample (tcp_connection_t * tc, tcp_bt_sample_t * bts, rs->prior_delivered = bts->delivered; rs->prior_time = bts->delivered_time; + rs->interval_time = bts->tx_time - bts->first_tx_time; rs->rtt_time = bts->tx_time; - rs->tx_rate = bts->tx_rate; rs->flags = bts->flags; + tc->first_tx_time = bts->tx_time; } static void @@ -529,7 +533,8 @@ tcp_bt_sample_delivery_rate (tcp_connection_t * tc, tcp_rate_sample_t * rs) if (tc->sack_sb.last_sacked_bytes) tcp_bt_walk_samples_ooo (tc, rs); - rs->interval_time = tc->delivered_time - rs->prior_time; + rs->interval_time = clib_max (tc->delivered_time - rs->prior_time, + rs->interval_time); rs->delivered = tc->delivered - rs->prior_delivered; rs->rtt_time = tc->delivered_time - rs->rtt_time; rs->acked_and_sacked = delivered; |