summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOle Troan <ot@cisco.com>2017-09-13 09:28:48 +0200
committerFlorin Coras <florin.coras@gmail.com>2017-09-13 17:22:18 +0000
commitaeedf2665cd6173a17ca844db34ecaf8997dcf62 (patch)
treedbbf9c440a8801a23a2c1bd91443daa449502030
parent01ffc0c1a3f8c5c15dc40cbe4560bdb3c2484152 (diff)
STATS: Refactor missed adding messages to CRC dictionary.
Change-Id: I0d74856d4fd999dd9ca5886b8375ab8dd700b8a9 Signed-off-by: Ole Troan <ot@cisco.com>
-rw-r--r--src/vpp/stats/stats.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/vpp/stats/stats.c b/src/vpp/stats/stats.c
index ff52c4dbfc6..b07dc17e6ca 100644
--- a/src/vpp/stats/stats.c
+++ b/src/vpp/stats/stats.c
@@ -60,6 +60,19 @@ _(WANT_IP6_NBR_STATS, want_ip6_nbr_stats) \
_(VNET_GET_SUMMARY_STATS, vnet_get_summary_stats)
+#define vl_msg_name_crc_list
+#include <vpp/stats/stats.api.h>
+#undef vl_msg_name_crc_list
+
+static void
+setup_message_id_table (api_main_t * am)
+{
+#define _(id,n,crc) \
+ vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id);
+ foreach_vl_msg_name_crc_stats;
+#undef _
+}
+
/* These constants ensure msg sizes <= 1024, aka ring allocation */
#define SIMPLE_COUNTER_BATCH_SIZE 126
#define COMBINED_COUNTER_BATCH_SIZE 63
@@ -1836,6 +1849,11 @@ stats_init (vlib_main_t * vm)
am->message_bounce[VL_API_VNET_IP4_NBR_COUNTERS] = 1;
am->message_bounce[VL_API_VNET_IP6_NBR_COUNTERS] = 1;
+ /*
+ * Set up the (msg_name, crc, message-id) table
+ */
+ setup_message_id_table (am);
+
return 0;
}