diff options
author | Neale Ranns <neale@graphiant.com> | 2022-08-09 03:03:29 +0000 |
---|---|---|
committer | Beno�t Ganne <bganne@cisco.com> | 2022-08-11 06:54:16 +0000 |
commit | e22a7041626cf1ebee7534d84068d48e8671a6ab (patch) | |
tree | dc3a7f46c3a4aef4c3af20229d3df18fb5465f8a /src/vnet/ip/reass/ip4_sv_reass.c | |
parent | 93688d7341ada44755dc0432de3e3dbaaa8aa111 (diff) |
ip: Use .api declared error counters
Type: improvement
Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: I822ead1495edb96ee62e53dc5920aa6c565e3621
Diffstat (limited to 'src/vnet/ip/reass/ip4_sv_reass.c')
-rw-r--r-- | src/vnet/ip/reass/ip4_sv_reass.c | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/src/vnet/ip/reass/ip4_sv_reass.c b/src/vnet/ip/reass/ip4_sv_reass.c index dfe3f578e98..4ef144e9bee 100644 --- a/src/vnet/ip/reass/ip4_sv_reass.c +++ b/src/vnet/ip/reass/ip4_sv_reass.c @@ -955,12 +955,6 @@ done: return frame->n_vectors; } -static char *ip4_sv_reass_error_strings[] = { -#define _(sym, string) string, - foreach_ip4_error -#undef _ -}; - VLIB_NODE_FN (ip4_sv_reass_node) (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame) @@ -975,8 +969,8 @@ VLIB_REGISTER_NODE (ip4_sv_reass_node) = { .name = "ip4-sv-reassembly", .vector_size = sizeof (u32), .format_trace = format_ip4_sv_reass_trace, - .n_errors = ARRAY_LEN (ip4_sv_reass_error_strings), - .error_strings = ip4_sv_reass_error_strings, + .n_errors = IP4_N_ERROR, + .error_counters = ip4_error_counters, .n_next_nodes = IP4_SV_REASSEMBLY_N_NEXT, .next_nodes = { @@ -1002,8 +996,8 @@ VLIB_REGISTER_NODE (ip4_sv_reass_node_feature) = { .name = "ip4-sv-reassembly-feature", .vector_size = sizeof (u32), .format_trace = format_ip4_sv_reass_trace, - .n_errors = ARRAY_LEN (ip4_sv_reass_error_strings), - .error_strings = ip4_sv_reass_error_strings, + .n_errors = IP4_N_ERROR, + .error_counters = ip4_error_counters, .n_next_nodes = IP4_SV_REASSEMBLY_N_NEXT, .next_nodes = { @@ -1038,8 +1032,8 @@ VLIB_REGISTER_NODE (ip4_sv_reass_node_output_feature) = { .name = "ip4-sv-reassembly-output-feature", .vector_size = sizeof (u32), .format_trace = format_ip4_sv_reass_trace, - .n_errors = ARRAY_LEN (ip4_sv_reass_error_strings), - .error_strings = ip4_sv_reass_error_strings, + .n_errors = IP4_N_ERROR, + .error_counters = ip4_error_counters, .n_next_nodes = IP4_SV_REASSEMBLY_N_NEXT, .next_nodes = { @@ -1064,8 +1058,8 @@ VLIB_REGISTER_NODE (ip4_sv_reass_custom_node) = { .name = "ip4-sv-reassembly-custom-next", .vector_size = sizeof (u32), .format_trace = format_ip4_sv_reass_trace, - .n_errors = ARRAY_LEN (ip4_sv_reass_error_strings), - .error_strings = ip4_sv_reass_error_strings, + .n_errors = IP4_N_ERROR, + .error_counters = ip4_error_counters, .n_next_nodes = IP4_SV_REASSEMBLY_N_NEXT, .next_nodes = { @@ -1313,13 +1307,12 @@ ip4_sv_reass_walk_expired (vlib_main_t *vm, /* *INDENT-OFF* */ VLIB_REGISTER_NODE (ip4_sv_reass_expire_node) = { - .function = ip4_sv_reass_walk_expired, - .type = VLIB_NODE_TYPE_PROCESS, - .name = "ip4-sv-reassembly-expire-walk", - .format_trace = format_ip4_sv_reass_trace, - .n_errors = ARRAY_LEN (ip4_sv_reass_error_strings), - .error_strings = ip4_sv_reass_error_strings, - + .function = ip4_sv_reass_walk_expired, + .type = VLIB_NODE_TYPE_PROCESS, + .name = "ip4-sv-reassembly-expire-walk", + .format_trace = format_ip4_sv_reass_trace, + .n_errors = IP4_N_ERROR, + .error_counters = ip4_error_counters, }; /* *INDENT-ON* */ |