aboutsummaryrefslogtreecommitdiffstats
path: root/src/vlib/main.h
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2019-04-23 15:13:14 -0400
committerDave Wallace <dwallacelf@gmail.com>2019-05-02 22:33:37 +0000
commite1062522d51e50cfd557a8ab66dfe19f1f86b65b (patch)
treee196942543b93f4a200caa863abf91148ccd45d4 /src/vlib/main.h
parent15c31921a628c5500cbed2ebc588d7ddbaa970a3 (diff)
Clean up multi-thread barrier-sync hold-down timer
Main thread: don't bother with the barrier sync hold-down timer if none of the worker threads are busy. Worker threads: avoid epoll_pwait (10ms timeout) when the control-plane has been active in the last half-second. Cherry-pick a recent dangling reference fix: pool_elt_at_index after e.g. rx callback is required, in case the unix file pool expands. DO NOT cherry-pick the patch into master! Change-Id: I130dc72fd95c8a22716fa2f0f98ce35cdccc52d7 Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/vlib/main.h')
-rw-r--r--src/vlib/main.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/vlib/main.h b/src/vlib/main.h
index 474756bebd6..8c2719cee52 100644
--- a/src/vlib/main.h
+++ b/src/vlib/main.h
@@ -63,6 +63,9 @@ typedef struct vlib_main_t
CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
/* Instruction level timing state. */
clib_time_t clib_time;
+ /* Offset from main thread time */
+ f64 time_offset;
+ f64 time_last_barrier_release;
/* Time stamp of last node dispatch. */
u64 cpu_time_last_node_dispatch;
@@ -228,7 +231,7 @@ void vlib_worker_loop (vlib_main_t * vm);
always_inline f64
vlib_time_now (vlib_main_t * vm)
{
- return clib_time_now (&vm->clib_time);
+ return clib_time_now (&vm->clib_time) + vm->time_offset;
}
always_inline f64