X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Ftcp%2Ftcp.c;h=ba427b76b1a871b89323fcad31e5baaa5e9f1f9b;hb=c44a558164a466a74a4c10d4e7d7dd1b9a4b01dd;hp=1726355f0e3e0ee22536ec9ea1c58ad09a06e8f8;hpb=be72ae6149a432899698a887b1820cf5c9d9456f;p=vpp.git 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) {