summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2019-03-27 18:55:11 -0700
committerDamjan Marion <dmarion@me.com>2019-03-28 17:01:33 +0000
commit6bc6fd0aebd7feb523604973bcf593bfe14bbd30 (patch)
treeb53858fce96a39bc032af871fd2995438551d350
parent4d3aa07ba34cc571c50046ad7e0575010590334f (diff)
session: cap max burst to a constant
Change-Id: I1919d3844936486f04f2bfde24dc7e0d9121927a Signed-off-by: Florin Coras <fcoras@cisco.com>
-rw-r--r--src/vnet/session/transport.c19
1 files changed, 2 insertions, 17 deletions
diff --git a/src/vnet/session/transport.c b/src/vnet/session/transport.c
index 3f8a4c3b11e..e453ee01879 100644
--- a/src/vnet/session/transport.c
+++ b/src/vnet/session/transport.c
@@ -49,6 +49,7 @@ 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 (48 * TRANSPORT_PACER_MIN_MSS)
u8 *
format_transport_proto (u8 * s, va_list * args)
@@ -540,7 +541,7 @@ spacer_max_burst (spacer_t * pacer, u64 norm_time_now)
pacer->bucket += inc;
}
- return clib_min (pacer->bucket, pacer->max_burst_size);
+ return clib_min (pacer->bucket, TRANSPORT_PACER_MAX_BURST);
}
static inline void
@@ -551,13 +552,6 @@ spacer_update_bucket (spacer_t * pacer, u32 bytes)
}
static inline void
-spacer_update_max_burst_size (spacer_t * pacer, u32 max_burst_bytes)
-{
- pacer->max_burst_size = clib_max (max_burst_bytes,
- TRANSPORT_PACER_MIN_BURST);
-}
-
-static inline void
spacer_set_pace_rate (spacer_t * pacer, u64 rate_bytes_per_sec)
{
ASSERT (rate_bytes_per_sec != 0);
@@ -570,12 +564,6 @@ transport_connection_tx_pacer_reset (transport_connection_t * tc,
u32 start_bucket, u64 time_now)
{
spacer_t *pacer = &tc->pacer;
- f64 dispatch_period;
- u32 burst_size;
-
- dispatch_period = transport_dispatch_period (tc->thread_index);
- burst_size = rate_bytes_per_sec * dispatch_period;
- spacer_update_max_burst_size (&tc->pacer, burst_size);
spacer_set_pace_rate (&tc->pacer, rate_bytes_per_sec);
pacer->last_update = time_now >> SPACER_CPU_TICKS_PER_PERIOD_SHIFT;
pacer->bucket = start_bucket;
@@ -597,10 +585,7 @@ void
transport_connection_tx_pacer_update (transport_connection_t * tc,
u64 bytes_per_sec)
{
- f64 dispatch_period = transport_dispatch_period (tc->thread_index);
- u32 burst_size = 1.1 * bytes_per_sec * dispatch_period;
spacer_set_pace_rate (&tc->pacer, bytes_per_sec);
- spacer_update_max_burst_size (&tc->pacer, burst_size);
}
u32