aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/memif/device.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/device.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/device.c')
-rw-r--r--src/plugins/memif/device.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/plugins/memif/device.c b/src/plugins/memif/device.c
index 101c3f79426..872660396d0 100644
--- a/src/plugins/memif/device.c
+++ b/src/plugins/memif/device.c
@@ -28,20 +28,20 @@
#include <memif/memif.h>
#include <memif/private.h>
-#define foreach_memif_tx_func_error \
-_(NO_FREE_SLOTS, "no free tx slots") \
-_(ROLLBACK, "no enough space in tx buffers")
+#define foreach_memif_tx_func_error \
+ _ (NO_FREE_SLOTS, no_free_slots, ERROR, "no free tx slots") \
+ _ (ROLLBACK, rollback, ERROR, "no enough space in tx buffers")
typedef enum
{
-#define _(f,s) MEMIF_TX_ERROR_##f,
+#define _(f, n, s, d) MEMIF_TX_ERROR_##f,
foreach_memif_tx_func_error
#undef _
MEMIF_TX_N_ERROR,
} memif_tx_func_error_t;
-static char *memif_tx_func_error_strings[] = {
-#define _(n,s) s,
+static vl_counter_t memif_tx_func_error_counters[] = {
+#define _(f, n, s, d) { #n, d, VL_COUNTER_SEVERITY_##s },
foreach_memif_tx_func_error
#undef _
};
@@ -490,7 +490,7 @@ VNET_DEVICE_CLASS (memif_device_class) = {
.format_device = format_memif_device,
.format_tx_trace = format_memif_tx_trace,
.tx_function_n_errors = MEMIF_TX_N_ERROR,
- .tx_function_error_strings = memif_tx_func_error_strings,
+ .tx_function_error_counters = memif_tx_func_error_counters,
.rx_redirect_to_node = memif_set_interface_next_node,
.clear_counters = memif_clear_hw_interface_counters,
.admin_up_down_function = memif_interface_admin_up_down,