vlib: rename vl_counter_t to vlib_error_desc_t

Type: improvement
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: I368b0410db2d633d3c52199c840e24d21952c1b4
This commit is contained in:
Ole Troan
2021-05-06 14:09:50 +02:00
committed by Damjan Marion
parent a606d92107
commit 2c4acdd8d4
8 changed files with 14 additions and 16 deletions

View File

@@ -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 _

View File

@@ -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 _

View File

@@ -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;

View File

@@ -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']))

View File

@@ -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;

View File

@@ -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;

View File

@@ -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. */

View File

@@ -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;