summaryrefslogtreecommitdiffstats
path: root/src/vnet/adj/adj.h
diff options
context:
space:
mode:
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