aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/adj/adj.h
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2017-02-21 05:33:14 -0800
committerDamjan Marion <dmarion.lists@gmail.com>2017-03-07 12:11:39 +0000
commit9c6a613feb2d718c5756cecbcd3ab84156241db2 (patch)
tree47ccf5daaa221c6fafdeda224cae2f2748d082c4 /src/vnet/adj/adj.h
parent153b871019d0acbe815640bd7c5000d302d91720 (diff)
make per-adj counters configurable
Change-Id: Ifdd2b204ecf7d855f1269c11224b9c825311904d Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/adj/adj.h')
-rw-r--r--src/vnet/adj/adj.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/vnet/adj/adj.h b/src/vnet/adj/adj.h
index 29bae6733b3..fcc5890c7d7 100644
--- a/src/vnet/adj/adj.h
+++ b/src/vnet/adj/adj.h
@@ -109,6 +109,12 @@ extern ip_adjacency_t *adj_pool;
extern vlib_combined_counter_main_t adjacency_counters;
/**
+ * @brief Global Config for enabling per-adjacency counters
+ * This is configurable because it comes with a non-negligible
+ * performance cost. */
+extern int adj_per_adj_counters;
+
+/**
* @brief
* Get a pointer to an adjacency object from its index
*/
@@ -118,4 +124,13 @@ adj_get (adj_index_t adj_index)
return (vec_elt_at_index(adj_pool, adj_index));
}
+/**
+ * @brief Get the global configuration option for enabling per-adj counters
+ */
+static inline int
+adj_are_counters_enabled (void)
+{
+ return (adj_per_adj_counters);
+}
+
#endif