FIB walk process - wake-up rate unnecessarily high 94/7094/4
authorNeale Ranns <nranns@cisco.com>
Sat, 10 Jun 2017 08:43:44 +0000 (01:43 -0700)
committerNeale Ranns <nranns@cisco.com>
Tue, 13 Jun 2017 12:20:55 +0000 (12:20 +0000)
Change-Id: I7dedf283c83c7f0e0b7642f095b68bc0b40898cf
Signed-off-by: Neale Ranns <nranns@cisco.com>
src/vnet/fib/fib_walk.c

index 7018013..9429744 100644 (file)
@@ -399,7 +399,17 @@ typedef enum fib_walk_sleep_type_t_
  * @brief Durations for the sleep types
  */
 static f64 fib_walk_sleep_duration[] = {
-    [FIB_WALK_LONG_SLEEP] = 1e-3,
+    /**
+     * Long sleep when there is no more work, i.e. the queues are empty.
+     * This is a sleep (as opposed to a wait for event) just to be sure we
+     * are not missing events by sleeping forever.
+     */
+    [FIB_WALK_LONG_SLEEP] = 2,
+
+    /**
+     * Short sleep. There is work left in the queues. We are yielding the CPU
+     * momentarily.
+     */
     [FIB_WALK_SHORT_SLEEP] = 1e-8,
 };