diff options
author | Filip Tehlar <ftehlar@cisco.com> | 2021-10-06 12:48:34 +0000 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2021-10-07 15:34:31 +0000 |
commit | 0c56217a307556524cfc92a1aeb1eb72112271d2 (patch) | |
tree | 811e8724ac4dbee01249437e26830ff59057d697 | |
parent | 43289951b23e491510baf1cedfad884321e83c30 (diff) |
udp: fix severity error info
Type: fix
Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Change-Id: I415d68b39ecac546b531f6eb98bca51e7eb6f7f7
-rw-r--r-- | src/vnet/udp/udp.h | 2 | ||||
-rw-r--r-- | src/vnet/udp/udp_error.def | 20 | ||||
-rw-r--r-- | src/vnet/udp/udp_input.c | 12 | ||||
-rw-r--r-- | src/vnet/udp/udp_local.c | 16 | ||||
-rw-r--r-- | test/test_gtpu.py | 4 | ||||
-rw-r--r-- | test/test_trace_filter.py | 2 |
6 files changed, 28 insertions, 28 deletions
diff --git a/src/vnet/udp/udp.h b/src/vnet/udp/udp.h index 89539e58c6d..f157711ba2b 100644 --- a/src/vnet/udp/udp.h +++ b/src/vnet/udp/udp.h @@ -27,7 +27,7 @@ typedef enum { -#define udp_error(n,s) UDP_ERROR_##n, +#define udp_error(f, n, s, d) UDP_ERROR_##f, #include <vnet/udp/udp_error.def> #undef udp_error UDP_N_ERROR, diff --git a/src/vnet/udp/udp_error.def b/src/vnet/udp/udp_error.def index 776d94a8ec1..178d5c96b2c 100644 --- a/src/vnet/udp/udp_error.def +++ b/src/vnet/udp/udp_error.def @@ -15,13 +15,13 @@ * limitations under the License. */ -udp_error (NONE, "No error") -udp_error (NO_LISTENER, "No listener for dst port") -udp_error (LENGTH_ERROR, "Packets with length errors") -udp_error (PUNT, "No listener punt") -udp_error (ENQUEUED, "Packets enqueued") -udp_error (FIFO_FULL, "Fifo full") -udp_error (NOT_READY, "Connection not ready") -udp_error (ACCEPT, "Accepted session") -udp_error (CREATE_SESSION, "Failed to create session") -udp_error (MQ_FULL, "Application msg queue full") +udp_error (NONE, none, INFO, "No error") +udp_error (NO_LISTENER, no_listener, ERROR, "No listener for dst port") +udp_error (LENGTH_ERROR, length_error, ERROR, "Packets with length errors") +udp_error (PUNT, punt, ERROR, "No listener punt") +udp_error (ENQUEUED, enqueued, INFO, "Packets enqueued") +udp_error (FIFO_FULL, fifo_full, ERROR, "Fifo full") +udp_error (NOT_READY, not_ready, ERROR, "Connection not ready") +udp_error (ACCEPT, accept, INFO, "Accepted session") +udp_error (CREATE_SESSION, create_session, ERROR, "Failed to create session") +udp_error (MQ_FULL, mq_full, ERROR, "Application msg queue full") diff --git a/src/vnet/udp/udp_input.c b/src/vnet/udp/udp_input.c index c76c1b796bd..d14bdb8a298 100644 --- a/src/vnet/udp/udp_input.c +++ b/src/vnet/udp/udp_input.c @@ -26,8 +26,8 @@ #include <vnet/udp/udp_packet.h> #include <vnet/session/session.h> -static char *udp_error_strings[] = { -#define udp_error(n,s) s, +static vlib_error_desc_t udp_error_counters[] = { +#define udp_error(f, n, s, d) { #n, d, VL_COUNTER_SEVERITY_##s }, #include "udp_error.def" #undef udp_error }; @@ -350,8 +350,8 @@ VLIB_REGISTER_NODE (udp4_input_node) = .vector_size = sizeof (u32), .format_trace = format_udp_input_trace, .type = VLIB_NODE_TYPE_INTERNAL, - .n_errors = ARRAY_LEN (udp_error_strings), - .error_strings = udp_error_strings, + .n_errors = UDP_N_ERROR, + .error_counters = udp_error_counters, .n_next_nodes = UDP_INPUT_N_NEXT, .next_nodes = { #define _(s, n) [UDP_INPUT_NEXT_##s] = n, @@ -376,8 +376,8 @@ VLIB_REGISTER_NODE (udp6_input_node) = .vector_size = sizeof (u32), .format_trace = format_udp_input_trace, .type = VLIB_NODE_TYPE_INTERNAL, - .n_errors = ARRAY_LEN (udp_error_strings), - .error_strings = udp_error_strings, + .n_errors = UDP_N_ERROR, + .error_counters = udp_error_counters, .n_next_nodes = UDP_INPUT_N_NEXT, .next_nodes = { #define _(s, n) [UDP_INPUT_NEXT_##s] = n, diff --git a/src/vnet/udp/udp_local.c b/src/vnet/udp/udp_local.c index edfec3359c3..06bafbb4be8 100644 --- a/src/vnet/udp/udp_local.c +++ b/src/vnet/udp/udp_local.c @@ -36,6 +36,12 @@ typedef struct u8 bound; } udp_local_rx_trace_t; +static vlib_error_desc_t udp_error_counters[] = { +#define udp_error(f, n, s, d) { #n, d, VL_COUNTER_SEVERITY_##s }, +#include "udp_error.def" +#undef udp_error +}; + #define UDP_NO_NODE_SET ((u16) ~0) #ifndef CLIB_MARCH_VARIANT @@ -342,12 +348,6 @@ udp46_local_inline (vlib_main_t * vm, return from_frame->n_vectors; } -static char *udp_error_strings[] = { -#define udp_error(n,s) s, -#include "udp_error.def" -#undef udp_error -}; - VLIB_NODE_FN (udp4_local_node) (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * from_frame) @@ -369,7 +369,7 @@ VLIB_REGISTER_NODE (udp4_local_node) = { .vector_size = sizeof (u32), .n_errors = UDP_N_ERROR, - .error_strings = udp_error_strings, + .error_counters = udp_error_counters, .n_next_nodes = UDP_LOCAL_N_NEXT, .next_nodes = { @@ -391,7 +391,7 @@ VLIB_REGISTER_NODE (udp6_local_node) = { .vector_size = sizeof (u32), .n_errors = UDP_N_ERROR, - .error_strings = udp_error_strings, + .error_counters = udp_error_counters, .n_next_nodes = UDP_LOCAL_N_NEXT, .next_nodes = { diff --git a/test/test_gtpu.py b/test/test_gtpu.py index 791067c0633..e4a2bfa3670 100644 --- a/test/test_gtpu.py +++ b/test/test_gtpu.py @@ -47,7 +47,7 @@ class TestGtpuUDP(VppTestCase): self.pg_start() err = self.statistics.get_counter( - '/err/ip4-udp-lookup/No listener for dst port')[0] + '/err/ip4-udp-lookup/no_listener')[0] if enabled: self.assertEqual(err, self.ip4_err) @@ -66,7 +66,7 @@ class TestGtpuUDP(VppTestCase): self.pg_start() err = self.statistics.get_counter( - '/err/ip6-udp-lookup/No listener for dst port')[0] + '/err/ip6-udp-lookup/no_listener')[0] if enabled: self.assertEqual(err, self.ip6_err) diff --git a/test/test_trace_filter.py b/test/test_trace_filter.py index fd250ac17c7..a37d4b996c8 100644 --- a/test/test_trace_filter.py +++ b/test/test_trace_filter.py @@ -211,7 +211,7 @@ class TestTracefilter(VppTestCase): """ Drop Packet Capture Filter Test """ self.cli( "pcap trace drop max 1000 " - "error {ip4-udp-lookup}.{No listener for dst port} " + "error {ip4-udp-lookup}.{no_listener} " "file vpp_test_trace_filter_test_pcap_drop.pcap") # the packet we are trying to match p = list() |