aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/session/session_node.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/session/session_node.c')
-rw-r--r--src/vnet/session/session_node.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/vnet/session/session_node.c b/src/vnet/session/session_node.c
index e1114b794e6..a072bfa0f77 100644
--- a/src/vnet/session/session_node.c
+++ b/src/vnet/session/session_node.c
@@ -873,16 +873,29 @@ session_tx_fifo_read_and_snd_i (session_worker_t * wrk,
return SESSION_TX_NO_DATA;
}
- ctx->snd_space = transport_connection_snd_space (ctx->tc, ctx->snd_mss);
+ ctx->snd_space = transport_connection_snd_space (ctx->tc);
/* This flow queue is "empty" so it should be re-evaluated before
* the ones that have data to send. */
- if (ctx->snd_space == 0)
+ if (!ctx->snd_space)
{
session_evt_add_head_old (wrk, elt);
return SESSION_TX_NO_DATA;
}
+ if (transport_connection_is_tx_paced (ctx->tc))
+ {
+ u32 snd_space = transport_connection_tx_pacer_burst (ctx->tc);
+ if (snd_space < TRANSPORT_PACER_MIN_BURST)
+ {
+ session_evt_add_head_old (wrk, elt);
+ return SESSION_TX_NO_DATA;
+ }
+ snd_space = clib_min (ctx->snd_space, snd_space);
+ ctx->snd_space = snd_space >= ctx->snd_mss ?
+ snd_space - snd_space % ctx->snd_mss : snd_space;
+ }
+
/* Allow enqueuing of a new event */
svm_fifo_unset_event (ctx->s->tx_fifo);
@@ -891,7 +904,7 @@ session_tx_fifo_read_and_snd_i (session_worker_t * wrk,
if (PREDICT_FALSE (!ctx->max_len_to_snd))
{
- transport_connection_tx_pacer_reset_bucket (ctx->tc);
+ transport_connection_tx_pacer_reset_bucket (ctx->tc, 0);
return SESSION_TX_NO_DATA;
}