From a8e71c8981f039588a7ca94e6ab66b4ebac784a5 Mon Sep 17 00:00:00 2001 From: Florin Coras Date: Tue, 22 Oct 2019 19:01:39 -0700 Subject: session tcp: refactor pacer time Type: refactor Change-Id: Ic1c3e1f7987702cd88972acc34849dc1f585d5fe Signed-off-by: Florin Coras --- src/vnet/tcp/tcp.c | 6 ++---- src/vnet/tcp/tcp_input.c | 4 +--- src/vnet/tcp/tcp_output.c | 14 +++----------- 3 files changed, 6 insertions(+), 18 deletions(-) (limited to 'src/vnet/tcp') diff --git a/src/vnet/tcp/tcp.c b/src/vnet/tcp/tcp.c index 1d030c9ce71..d8ba65871d9 100644 --- a/src/vnet/tcp/tcp.c +++ b/src/vnet/tcp/tcp.c @@ -1399,11 +1399,9 @@ 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); f64 srtt = clib_min ((f64) tc->srtt * TCP_TICK, tc->mrtt_us); - u64 last_time = wrk->vm->clib_time.last_cpu_time; - transport_connection_tx_pacer_reset (&tc->connection, window / srtt, - start_bucket, last_time); + u64 rate = (u64) window / srtt; + transport_connection_tx_pacer_reset (&tc->connection, rate, start_bucket); } static void diff --git a/src/vnet/tcp/tcp_input.c b/src/vnet/tcp/tcp_input.c index b2dc2f7b1a8..69db57ced95 100755 --- a/src/vnet/tcp/tcp_input.c +++ b/src/vnet/tcp/tcp_input.c @@ -629,9 +629,7 @@ tcp_handle_postponed_dequeues (tcp_worker_ctx_t * wrk) * we're in recovery and snd space constrained */ if (tc->data_segs_out == tc->prev_dsegs_out || tcp_recovery_no_snd_space (tc)) - transport_connection_tx_pacer_reset_bucket (&tc->connection, - wrk->vm->clib_time. - last_cpu_time); + transport_connection_tx_pacer_reset_bucket (&tc->connection); tc->prev_dsegs_out = tc->data_segs_out; } _vec_len (wrk->pending_deq_acked) = 0; diff --git a/src/vnet/tcp/tcp_output.c b/src/vnet/tcp/tcp_output.c index 45282168bd7..71e9d7bbdb0 100644 --- a/src/vnet/tcp/tcp_output.c +++ b/src/vnet/tcp/tcp_output.c @@ -1876,13 +1876,10 @@ tcp_retransmit_sack (tcp_worker_ctx_t * wrk, tcp_connection_t * tc, vlib_buffer_t *b = 0; sack_scoreboard_t *sb; int snd_space; - u64 time_now; ASSERT (tcp_in_cong_recovery (tc)); - time_now = wrk->vm->clib_time.last_cpu_time; - burst_bytes = transport_connection_tx_pacer_burst (&tc->connection, - time_now); + burst_bytes = transport_connection_tx_pacer_burst (&tc->connection); burst_size = clib_min (burst_size, burst_bytes / tc->snd_mss); if (!burst_size) { @@ -2017,9 +2014,7 @@ done: if (reset_pacer) { - transport_connection_tx_pacer_reset_bucket (&tc->connection, - vm->clib_time. - last_cpu_time); + transport_connection_tx_pacer_reset_bucket (&tc->connection); } else { @@ -2044,14 +2039,11 @@ tcp_retransmit_no_sack (tcp_worker_ctx_t * wrk, tcp_connection_t * tc, int snd_space, n_segs = 0; u8 cc_limited = 0; vlib_buffer_t *b; - u64 time_now; ASSERT (tcp_in_fastrecovery (tc)); TCP_EVT (TCP_EVT_CC_EVT, tc, 0); - time_now = wrk->vm->clib_time.last_cpu_time; - burst_bytes = transport_connection_tx_pacer_burst (&tc->connection, - time_now); + burst_bytes = transport_connection_tx_pacer_burst (&tc->connection); burst_size = clib_min (burst_size, burst_bytes / tc->snd_mss); if (!burst_size) { -- cgit 1.2.3-korg