summaryrefslogtreecommitdiffstats
path: root/src/vnet/session/transport.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2019-10-06 14:06:14 -0700
committerFlorin Coras <florin.coras@gmail.com>2019-10-10 21:23:14 +0000
commitc31dc31f84961033ecb6354811e0c360b6cf5f79 (patch)
tree46224d5f2b9d126cb6bd5fa289a18186cb172aa5 /src/vnet/session/transport.c
parent71a5da0c8dfa12ff012c8c101cf4d2b29fa0b6e3 (diff)
tcp: improve pacing after idle send periods
Rest pacer on ack reception if we haven't recently sent anything. Type: feature Change-Id: I820bacd81b65130052dfafbfcbe6ca4553069fbc Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/session/transport.c')
-rw-r--r--src/vnet/session/transport.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/vnet/session/transport.c b/src/vnet/session/transport.c
index 49a4af71111..8f7e30c8602 100644
--- a/src/vnet/session/transport.c
+++ b/src/vnet/session/transport.c
@@ -47,10 +47,6 @@ static clib_spinlock_t local_endpoints_lock;
*/
static double transport_pacer_period;
-#define TRANSPORT_PACER_MIN_MSS 1460
-#define TRANSPORT_PACER_MIN_BURST TRANSPORT_PACER_MIN_MSS
-#define TRANSPORT_PACER_MAX_BURST (43 * TRANSPORT_PACER_MIN_MSS)
-
u8 *
format_transport_proto (u8 * s, va_list * args)
{
@@ -583,6 +579,13 @@ spacer_max_burst (spacer_t * pacer, u64 norm_time_now)
u64 n_periods = norm_time_now - pacer->last_update;
u64 inc;
+ if (PREDICT_FALSE (n_periods > 5e5))
+ {
+ pacer->last_update = norm_time_now;
+ pacer->bucket = TRANSPORT_PACER_MIN_BURST;
+ return TRANSPORT_PACER_MIN_BURST;
+ }
+
if (n_periods > 0
&& (inc = (f32) n_periods * pacer->tokens_per_period) > 10)
{
@@ -674,7 +677,7 @@ transport_connection_snd_space (transport_connection_t * tc, u64 time_now,
u32 snd_space, max_paced_burst;
snd_space = tp_vfts[tc->proto].send_space (tc);
- if (transport_connection_is_tx_paced (tc))
+ if (snd_space && transport_connection_is_tx_paced (tc))
{
time_now >>= SPACER_CPU_TICKS_PER_PERIOD_SHIFT;
max_paced_burst = spacer_max_burst (&tc->pacer, time_now);