From 2c4acdd8d47a14867d9658debc674323efc78323 Mon Sep 17 00:00:00 2001 From: Ole Troan Date: Thu, 6 May 2021 14:09:50 +0200 Subject: vlib: rename vl_counter_t to vlib_error_desc_t Type: improvement Signed-off-by: Ole Troan Change-Id: I368b0410db2d633d3c52199c840e24d21952c1b4 --- src/plugins/memif/device.c | 2 +- src/plugins/memif/node.c | 2 +- src/plugins/nat/pnat/tests/pnat_test_stubs.h | 2 +- src/tools/vppapigen/vppapigen_c.py | 4 ++-- src/vlib/error.c | 5 ++--- src/vlib/error.h | 9 ++++----- src/vlib/node.h | 4 ++-- src/vnet/interface.h | 2 +- 8 files changed, 14 insertions(+), 16 deletions(-) diff --git a/src/plugins/memif/device.c b/src/plugins/memif/device.c index 872660396d0..d6d4ae3780b 100644 --- a/src/plugins/memif/device.c +++ b/src/plugins/memif/device.c @@ -40,7 +40,7 @@ typedef enum MEMIF_TX_N_ERROR, } memif_tx_func_error_t; -static vl_counter_t memif_tx_func_error_counters[] = { +static vlib_error_desc_t memif_tx_func_error_counters[] = { #define _(f, n, s, d) { #n, d, VL_COUNTER_SEVERITY_##s }, foreach_memif_tx_func_error #undef _ diff --git a/src/plugins/memif/node.c b/src/plugins/memif/node.c index 84bc63fc7c3..7c4de8b8564 100644 --- a/src/plugins/memif/node.c +++ b/src/plugins/memif/node.c @@ -43,7 +43,7 @@ typedef enum MEMIF_INPUT_N_ERROR, } memif_input_error_t; -static vl_counter_t memif_input_error_counters[] = { +static vlib_error_desc_t memif_input_error_counters[] = { #define _(f, n, s, d) { #n, d, VL_COUNTER_SEVERITY_##s }, foreach_memif_input_error #undef _ diff --git a/src/plugins/nat/pnat/tests/pnat_test_stubs.h b/src/plugins/nat/pnat/tests/pnat_test_stubs.h index 1b7450146f5..bfe1838ffa4 100644 --- a/src/plugins/nat/pnat/tests/pnat_test_stubs.h +++ b/src/plugins/nat/pnat/tests/pnat_test_stubs.h @@ -38,7 +38,7 @@ u8 *format_ip4_address(u8 *s, va_list *args) { u8 *format_pnat_match_tuple(u8 *s, va_list *args) { return 0; } u8 *format_pnat_rewrite_tuple(u8 *s, va_list *args) { return 0; } -vl_counter_t pnat_error_counters[10]; +vlib_error_desc_t pnat_error_counters[10]; int ip4_sv_reass_enable_disable_with_refcnt(u32 sw_if_index, int is_enable) { return 0; diff --git a/src/tools/vppapigen/vppapigen_c.py b/src/tools/vppapigen/vppapigen_c.py index ba083499852..b298c3334de 100644 --- a/src/tools/vppapigen/vppapigen_c.py +++ b/src/tools/vppapigen/vppapigen_c.py @@ -1210,7 +1210,7 @@ def generate_include_counters(s, stream): write(' {}_N_ERROR\n'.format(csetname.upper())) write('}} vl_counter_{}_enum_t;\n'.format(csetname)) - write('extern vl_counter_t {}_error_counters[];\n'.format(csetname)) + write('extern vlib_error_desc_t {}_error_counters[];\n'.format(csetname)) def generate_include_types(s, module, stream): @@ -1373,7 +1373,7 @@ def generate_c_boilerplate(services, defines, counters, file_crc, for cnt in counters: csetname = cnt.name - write('vl_counter_t {}_error_counters[] = {{\n'.format(csetname)) + write('vlib_error_desc_t {}_error_counters[] = {{\n'.format(csetname)) for c in cnt.block: write(' {\n') write(' .name = "{}",\n'.format(c['name'])) diff --git a/src/vlib/error.c b/src/vlib/error.c index f93b9a34d09..97cb0b52192 100644 --- a/src/vlib/error.c +++ b/src/vlib/error.c @@ -114,9 +114,8 @@ vlib_error_drop_buffers (vlib_main_t * vm, /* Reserves given number of error codes for given node. */ void -vlib_register_errors (vlib_main_t * vm, - u32 node_index, u32 n_errors, char *error_strings[], - vl_counter_t counters[]) +vlib_register_errors (vlib_main_t *vm, u32 node_index, u32 n_errors, + char *error_strings[], vlib_error_desc_t counters[]) { vlib_error_main_t *em = &vm->error_main; vlib_node_main_t *nm = &vm->node_main; diff --git a/src/vlib/error.h b/src/vlib/error.h index 2bffc6b9367..b921067ee84 100644 --- a/src/vlib/error.h +++ b/src/vlib/error.h @@ -56,7 +56,7 @@ typedef struct char *name; char *desc; enum vl_counter_severity_e severity; -} vl_counter_t; +} vlib_error_desc_t; typedef struct { @@ -68,14 +68,13 @@ typedef struct /* Counter structures in heap. Heap index indexes counter vector. */ - vl_counter_t *counters_heap; + vlib_error_desc_t *counters_heap; } vlib_error_main_t; /* Per node error registration. */ -void vlib_register_errors (struct vlib_main_t *vm, - u32 node_index, +void vlib_register_errors (struct vlib_main_t *vm, u32 node_index, u32 n_errors, char *error_strings[], - vl_counter_t counters[]); + vlib_error_desc_t counters[]); unformat_function_t unformat_vlib_error; diff --git a/src/vlib/node.h b/src/vlib/node.h index fd792dc3fa6..a06c20211d4 100644 --- a/src/vlib/node.h +++ b/src/vlib/node.h @@ -115,7 +115,7 @@ typedef struct _vlib_node_registration /* Error strings indexed by error code for this node. */ char **error_strings; - vl_counter_t *error_counters; + vlib_error_desc_t *error_counters; /* Buffer format/unformat for this node. */ format_function_t *format_buffer; @@ -316,7 +316,7 @@ typedef struct vlib_node_t u32 error_heap_index; /* Counter structures indexed by counter code for this node. */ - vl_counter_t *error_counters; + vlib_error_desc_t *error_counters; /* Vector of next node names. Only used before next_nodes array is initialized. */ diff --git a/src/vnet/interface.h b/src/vnet/interface.h index 744496cdd5d..0ffaffed5d4 100644 --- a/src/vnet/interface.h +++ b/src/vnet/interface.h @@ -229,7 +229,7 @@ typedef struct _vnet_device_class /* Error strings indexed by error code for this node. */ char **tx_function_error_strings; - vl_counter_t *tx_function_error_counters; + vlib_error_desc_t *tx_function_error_counters; /* Number of error codes used by this node. */ u32 tx_function_n_errors; -- cgit 1.2.3-korg