summaryrefslogtreecommitdiffstats
path: root/src/plugins/memif/node.c
diff options
context:
space:
mode:
authorOle Troan <ot@cisco.com>2021-03-10 12:52:53 +0100
committerDamjan Marion <dmarion@me.com>2021-05-06 11:10:55 +0000
commitf09d655101d2400df91d2a388168b925eea0dc01 (patch)
tree7a151ef2d7e723b72ed211955bab8940a5ee9fe8 /src/plugins/memif/node.c
parent36f7a6aeb021a549f2d684868303c9891bc0dd00 (diff)
memif: add severity to counters
Also rename counters in stat segment to make them more filesystem friendly. Type: improvement Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: I8a3f3ec318931f5475fcb181f8b4a079a1fa4b9c Signed-off-by: Ole Troan <ot@cisco.com>
Diffstat (limited to 'src/plugins/memif/node.c')
-rw-r--r--src/plugins/memif/node.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/plugins/memif/node.c b/src/plugins/memif/node.c
index b2422f9e323..84bc63fc7c3 100644
--- a/src/plugins/memif/node.c
+++ b/src/plugins/memif/node.c
@@ -31,20 +31,20 @@
#include <memif/private.h>
#define foreach_memif_input_error \
- _ (BUFFER_ALLOC_FAIL, "buffer allocation failed") \
- _ (BAD_DESC, "bad descriptor") \
- _ (NOT_IP, "not ip packet")
+ _ (BUFFER_ALLOC_FAIL, buffer_alloc, ERROR, "buffer allocation failed") \
+ _ (BAD_DESC, bad_desc, ERROR, "bad descriptor") \
+ _ (NOT_IP, not_ip, INFO, "not ip packet")
typedef enum
{
-#define _(f,s) MEMIF_INPUT_ERROR_##f,
+#define _(f, n, s, d) MEMIF_INPUT_ERROR_##f,
foreach_memif_input_error
#undef _
MEMIF_INPUT_N_ERROR,
} memif_input_error_t;
-static __clib_unused char *memif_input_error_strings[] = {
-#define _(n,s) s,
+static vl_counter_t memif_input_error_counters[] = {
+#define _(f, n, s, d) { #n, d, VL_COUNTER_SEVERITY_##s },
foreach_memif_input_error
#undef _
};
@@ -937,7 +937,7 @@ VLIB_REGISTER_NODE (memif_input_node) = {
.type = VLIB_NODE_TYPE_INPUT,
.state = VLIB_NODE_STATE_INTERRUPT,
.n_errors = MEMIF_INPUT_N_ERROR,
- .error_strings = memif_input_error_strings,
+ .error_counters = memif_input_error_counters,
};
/* *INDENT-ON* */