aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/session/transport.c
diff options
context:
space:
mode:
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);