From c25048bd05a319511aa7386f75e1fae2b2a623c4 Mon Sep 17 00:00:00 2001 From: Dave Barach Date: Wed, 29 Jan 2020 18:05:24 -0500 Subject: vppinfra: improve clocks_per_second convergence Apply exponential smoothing to the clock rate update calculation in clib_time_verify_frequency(), with a half-life of 1 minute and a sampling frequency of 16 seconds. Within 5 minutes or so, the calculation converges With each rate recalculation: reset total_cpu_time based on the kernel timebase delta since vpp started, and the new clock rate Improve the "show clock [verbose]" debug CLI command. BFD echo + echo fail tests marked off until the BFD code can be reworked a bit. Type: fix Signed-off-by: Dave Barach Change-Id: I24e88a78819b12867736c875067b386ef6115c5c --- src/vnet/bfd/bfd_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/vnet/bfd/bfd_main.c') diff --git a/src/vnet/bfd/bfd_main.c b/src/vnet/bfd/bfd_main.c index 34e98042e86..a9a6d054636 100644 --- a/src/vnet/bfd/bfd_main.c +++ b/src/vnet/bfd/bfd_main.c @@ -1327,7 +1327,7 @@ bfd_main_init (vlib_main_t * vm) bm->vlib_main = vm; bm->vnet_main = vnet_get_main (); clib_memset (&bm->wheel, 0, sizeof (bm->wheel)); - bm->cpu_cps = vm->clib_time.clocks_per_second; + bm->cpu_cps = (u64) vm->clib_time.clocks_per_second; BFD_DBG ("cps is %.2f", bm->cpu_cps); bm->default_desired_min_tx_clocks = bfd_usec_to_clocks (bm, BFD_DEFAULT_DESIRED_MIN_TX_USEC); -- cgit 1.2.3-korg