aboutsummaryrefslogtreecommitdiffstats
path: root/src/vlib/counter.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/vlib/counter.h')
-rw-r--r--src/vlib/counter.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/vlib/counter.h b/src/vlib/counter.h
index a79032065d9..abfa89eea6d 100644
--- a/src/vlib/counter.h
+++ b/src/vlib/counter.h
@@ -273,6 +273,20 @@ vlib_increment_combined_counter (vlib_combined_counter_main_t * cm,
}
}
+#define vlib_prefetch_combined_counter(_cm, _cpu_index, _index) \
+{ \
+ vlib_mini_counter_t *_cpu_minis; \
+ \
+ /* \
+ * This CPU's mini index is assumed to already be in cache \
+ */ \
+ _cpu_minis = (_cm)->minis[(_cpu_index)]; \
+ CLIB_PREFETCH(_cpu_minis + (_index), \
+ sizeof(*_cpu_minis), \
+ STORE); \
+}
+
+
/** Get the value of a combined counter, never called in the speed path
Scrapes the entire set of mini counters. Innacurate unless
worker threads which might increment the counter are