From: Neale Ranns Date: Tue, 23 Jan 2018 16:38:50 +0000 (-0800) Subject: Improve the error reporting for a IP multicast RPF miss. X-Git-Tag: v18.04-rc1~446 X-Git-Url: https://gerrit.fd.io/r/gitweb?p=vpp.git;a=commitdiff_plain;h=ce111d2ee3bacec2a09d8f5b664dcfafa0dd50c7 Improve the error reporting for a IP multicast RPF miss. now we get: 00:00:04:288925: pg-input ... 00:00:04:289345: ethernet-input ... 00:00:04:289524: ip6-input ... 00:00:04:289553: ip6-mfib-forward-lookup ... 00:00:04:289584: ip6-mfib-forward-rpf entry 14 itf 2 flags Forward, 00:00:04:289754: ip6-drop UDP: 2002::1 -> ff01:2::255 tos 0x00, flow label 0x0, hop limit 64, payload length 21 UDP: 1234 -> 1234 length 21, checksum 0x90d1 00:00:04:289802: error-drop ip4-input: Multicast RPF check failed 08:36:44,517 Count Node Reason 182 ip4-input Multicast RPF check failed 8 ip6-icmp-input neighbor advertisements sent 8 ip6-icmp-input router advertisements sent 8 arp-input ARP replies sent Change-Id: I1b29cda4ec77a88db45bfb25c7473cd64bbf501a Signed-off-by: Neale Ranns --- diff --git a/src/vnet/ip/ip4_error.h b/src/vnet/ip/ip4_error.h index d9b56bc2f49..4e545aeda3c 100644 --- a/src/vnet/ip/ip4_error.h +++ b/src/vnet/ip/ip4_error.h @@ -75,7 +75,10 @@ \ /* Errors singalled by ip4-inacl */ \ _ (INACL_TABLE_MISS, "input ACL table-miss drops") \ - _ (INACL_SESSION_DENY, "input ACL session deny drops") + _ (INACL_SESSION_DENY, "input ACL session deny drops") \ + \ + /* Erros from mfib-forward */ \ + _ (RPF_FAILURE, "Multicast RPF check failed") typedef enum { diff --git a/src/vnet/mfib/mfib_forward.c b/src/vnet/mfib/mfib_forward.c index 3d8f4f98cb0..3d0e0d47996 100644 --- a/src/vnet/mfib/mfib_forward.c +++ b/src/vnet/mfib/mfib_forward.c @@ -252,8 +252,8 @@ format_mfib_forward_rpf_trace (u8 * s, va_list * args) mfib_forward_rpf_trace_t * t = va_arg (*args, mfib_forward_rpf_trace_t *); s = format (s, "entry %d", t->entry_index); - s = format (s, " %d", t->sw_if_index); - s = format (s, " %U", format_mfib_itf_flags, t->itf_flags); + s = format (s, " itf %d", t->sw_if_index); + s = format (s, " flags %U", format_mfib_itf_flags, t->itf_flags); return s; } @@ -342,7 +342,12 @@ mfib_forward_rpf (vlib_main_t * vm, { u32 n_left_from, n_left_to_next, * from, * to_next; mfib_forward_rpf_next_t next; + vlib_node_runtime_t *error_node; + if (is_v4) + error_node = vlib_node_get_runtime (vm, ip4_input_node.index); + else + error_node = vlib_node_get_runtime (vm, ip6_input_node.index); from = vlib_frame_vector_args (frame); n_left_from = frame->n_vectors; next = MFIB_FORWARD_RPF_NEXT_DROP; @@ -361,6 +366,7 @@ mfib_forward_rpf (vlib_main_t * vm, u32 pi0, next0; mfib_itf_flags_t iflags0; mfib_entry_flags_t eflags0; + u8 error0; pi0 = from[0]; to_next[0] = pi0; @@ -369,6 +375,7 @@ mfib_forward_rpf (vlib_main_t * vm, n_left_to_next -= 1; n_left_from -= 1; + error0 = IP4_ERROR_NONE; b0 = vlib_get_buffer (vm, pi0); mfei0 = vnet_buffer (b0)->ip.adj_index[VLIB_TX]; mfe0 = mfib_entry_get(mfei0); @@ -444,8 +451,11 @@ mfib_forward_rpf (vlib_main_t * vm, else { next0 = MFIB_FORWARD_RPF_NEXT_DROP; + error0 = IP4_ERROR_RPF_FAILURE; } + b0->error = error0 ? error_node->errors[error0] : 0; + if (b0->flags & VLIB_BUFFER_IS_TRACED) { mfib_forward_rpf_trace_t *t0; diff --git a/test/test_ip_mcast.py b/test/test_ip_mcast.py index f3d23a612db..b4554c67f42 100644 --- a/test/test_ip_mcast.py +++ b/test/test_ip_mcast.py @@ -406,6 +406,15 @@ class TestIPMcast(VppTestCase): # # a stream that matches the route for (*, ff01::/16) + # sent on the non-accepting interface + # + self.vapi.cli("clear trace") + tx = self.create_stream_ip6(self.pg1, "2002::1", "ff01:2::255") + self.send_and_assert_no_replies(self.pg1, tx, "RPF miss") + + # + # a stream that matches the route for (*, ff01::/16) + # sent on the accepting interface # self.vapi.cli("clear trace") tx = self.create_stream_ip6(self.pg0, "2002::1", "ff01:2::255")