X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fsession%2Fsession_node.c;h=5ed681d03c7fdfafd8f584e2085b339af097d2f4;hb=c44a558164a466a74a4c10d4e7d7dd1b9a4b01dd;hp=34131723665318732cbaf0a974756079327a5137;hpb=be72ae6149a432899698a887b1820cf5c9d9456f;p=vpp.git 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);