summaryrefslogtreecommitdiffstats
path: root/src/vnet/session/session_node.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-11-01 16:30:54 -0700
committerMarco Varlese <marco.varlese@suse.de>2018-11-02 08:06:46 +0000
commitc44a558164a466a74a4c10d4e7d7dd1b9a4b01dd (patch)
tree3f71b876678de40d0bd6f0a15f463dbe51d61719 /src/vnet/session/session_node.c
parentbe72ae6149a432899698a887b1820cf5c9d9456f (diff)
session: measure dispatch period only if under load
Also reset pacer on tcp retransmit timeout Change-Id: I5a9edee4c00d1d169248d79587a9b10437c2bd87 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/session/session_node.c')
-rw-r--r--src/vnet/session/session_node.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/vnet/session/session_node.c b/src/vnet/session/session_node.c
index 34131723665..5ed681d03c7 100644
--- a/src/vnet/session/session_node.c
+++ b/src/vnet/session/session_node.c
@@ -751,10 +751,12 @@ static void
session_update_dispatch_period (session_manager_worker_t * wrk, f64 now,
u32 thread_index)
{
- f64 sample, prev_period = wrk->dispatch_period, a = 0.8;
-
- sample = now - wrk->last_vlib_time;
- wrk->dispatch_period = a * sample + (1 - a) * prev_period;
+ if (wrk->last_tx_packets > 8)
+ {
+ 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;
}
@@ -917,6 +919,7 @@ session_queue_node_fn (vlib_main_t * vm, vlib_node_runtime_t * node,
_vec_len (fifo_events) = 0;
wrk->free_event_vector = fifo_events;
+ wrk->last_tx_packets = n_tx_packets;
vlib_node_increment_counter (vm, session_queue_node.index,
SESSION_QUEUE_ERROR_TX, n_tx_packets);