summaryrefslogtreecommitdiffstats
path: root/src/vlib
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2017-01-24 01:34:25 -0800
committerDamjan Marion <dmarion.lists@gmail.com>2017-01-25 20:53:26 +0000
commit044183faacc5eb8a055658f9deebefb56b254adc (patch)
tree5d9af96930941b5344b1653e057b7008a75f081e /src/vlib
parentf3dc11a9d71a30ac89e7ceb523abdb1ff13f0ac3 (diff)
[re]Enable per-Adjacency/neighbour counters
Change-Id: I953b3888bbc6d8a5f53f684a5edc8742b382f323 Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vlib')
-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