summaryrefslogtreecommitdiffstats
path: root/src/vnet/session
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/session')
-rw-r--r--src/vnet/session/session.h7
-rw-r--r--src/vnet/session/session_node.c3
-rw-r--r--src/vnet/session/transport.c11
3 files changed, 14 insertions, 7 deletions
diff --git a/src/vnet/session/session.h b/src/vnet/session/session.h
index 3bdf6c9d93e..35c8fb4069f 100644
--- a/src/vnet/session/session.h
+++ b/src/vnet/session/session.h
@@ -524,6 +524,13 @@ transport_tx_fifo_size (transport_connection_t * tc)
return s->server_tx_fifo->nitems;
}
+always_inline u8
+transport_rx_fifo_has_ooo_data (transport_connection_t * tc)
+{
+ stream_session_t *s = session_get (tc->c_index, tc->thread_index);
+ return svm_fifo_has_ooo_data (s->server_rx_fifo);
+}
+
always_inline f64
transport_dispatch_period (u32 thread_index)
{
diff --git a/src/vnet/session/session_node.c b/src/vnet/session/session_node.c
index edc518ee872..64c873cc758 100644
--- a/src/vnet/session/session_node.c
+++ b/src/vnet/session/session_node.c
@@ -751,10 +751,9 @@ static void
session_update_dispatch_period (session_manager_worker_t * wrk, f64 now,
u32 thread_index)
{
- if (wrk->last_tx_packets > 8)
+ if (wrk->last_tx_packets > 1)
{
f64 sample = now - wrk->last_vlib_time;
- sample = (sample * wrk->last_tx_packets) / VLIB_FRAME_SIZE;
wrk->dispatch_period = (wrk->dispatch_period + sample) * 0.5;
}
wrk->last_vlib_time = now;
diff --git a/src/vnet/session/transport.c b/src/vnet/session/transport.c
index 42149eb36a6..06c541a9e2b 100644
--- a/src/vnet/session/transport.c
+++ b/src/vnet/session/transport.c
@@ -47,7 +47,8 @@ static clib_spinlock_t local_endpoints_lock;
*/
static double transport_pacer_period;
-#define TRANSPORT_PACER_MIN_MSS 1460
+#define TRANSPORT_PACER_MIN_MSS 1460
+#define TRANSPORT_PACER_MIN_BURST TRANSPORT_PACER_MIN_MSS
u8 *
format_transport_proto (u8 * s, va_list * args)
@@ -518,7 +519,8 @@ 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_MSS);
+ pacer->max_burst_size = clib_max (max_burst_bytes,
+ TRANSPORT_PACER_MIN_BURST);
}
static inline void
@@ -561,9 +563,8 @@ void
transport_connection_tx_pacer_update (transport_connection_t * tc,
u64 bytes_per_sec)
{
- u32 burst_size;
-
- burst_size = bytes_per_sec * transport_dispatch_period (tc->thread_index);
+ 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);
}