]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: When we fail, actually note the failure
authorDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 27 Aug 2020 01:38:47 +0000 (21:38 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 27 Aug 2020 01:51:54 +0000 (21:51 -0400)
During testing it was noticed that routes were considered
installed by zebra, but the kernel did not have the route.
Upon close debugging of the rib it was noticed that FRR
was turning a dplane_ctx_route_init into a success and
FRR was now in a bad state.

2020/08/26 17:55:53.897436 PBR: route_notify_owner: [0.0.0.0/0] Route Removed succeeded for table: 10012
2020/08/26 17:55:53.897572 ZEBRA: 0.0.0.0/0: uptime == 432033, type == 24, instance == 0, table == 10012
2020/08/26 17:55:53.897622 ZEBRA: rib_meta_queue_add: (0:10012):0.0.0.0/0: queued rn 0x5566b0ea7680 into sub-queue 5
2020/08/26 17:55:53.907637 ZEBRA: default(0:10012):0.0.0.0/0: Processing rn 0x5566b0ea7680
2020/08/26 17:55:53.907665 ZEBRA: default(0:10012):0.0.0.0/0: Examine re 0x5566b0d01200 (pbr) status 2 flags 1 dist 200 metric 0
2020/08/26 17:55:53.907702 ZEBRA: default(0:10012):0.0.0.0/0: After processing: old_selected 0x0 new_selected 0x5566b0d01200 old_fib 0x0 new_fib 0x5566b0d01200
2020/08/26 17:55:53.907713 ZEBRA: default(0:10012):0.0.0.0/0: Adding route rn 0x5566b0ea7680, re 0x5566b0d01200 (pbr)
2020/08/26 17:55:53.907879 ZEBRA: default(0:10012):0.0.0.0/0: rn 0x5566b0ea7680 dequeued from sub-queue 5
2020/08/26 17:55:53.907943 ZEBRA: netlink_route_multipath: RTM_NEWROUTE 0.0.0.0/0 vrf 0(10012)
2020/08/26 17:55:53.910756 ZEBRA: default(0:10012):0.0.0.0/0 Processing dplane result ctx 0x5566b0ea82f0, op ROUTE_INSTALL result SUCCESS
2020/08/26 17:55:53.910769 ZEBRA: update_from_ctx: default(0:10012):0.0.0.0/0: SELECTED, re 0x5566b0d01200
2020/08/26 17:55:53.910785 ZEBRA: default(0:10012):0.0.0.0/0 update_from_ctx(): no fib nhg
2020/08/26 17:55:53.910793 ZEBRA: default(0:10012):0.0.0.0/0 update_from_ctx(): rib nhg matched, changed 'true'
2020/08/26 17:55:53.910802 ZEBRA: (0:10012):0.0.0.0/0: Redist update re 0x5566b0d01200 (pbr), old 0x0 (None)
2020/08/26 17:55:53.910812 ZEBRA: Notifying Owner: 24 about prefix 0.0.0.0/0(10012) 2 vrf: 0
2020/08/26 17:55:53.910912 PBR: route_notify_owner: [0.0.0.0/0] Route installed succeeded for table: 10012
2020/08/26 17:55:55.400516 ZEBRA: RTM_DELROUTE 0.0.0.0/0 vrf default(0) table_id: 10012 metric: 20 Admin Distance: 0
2020/08/26 17:55:55.400527 ZEBRA: rib_delete: (0:10012):0.0.0.0/0: rn 0x5566b0ea7680, re 0x5566b0d01200 (pbr) was deleted from kernel, adding

We were receiving a notification from the kernel that the route was deleted and deciding
that we needed to reinstall it.  At that point in time when it got into the dplane
handlers to convert it to the dplane pthread, the dplane decided to drop the request
convert it too a success and not do anything.

This code change removes the conversion from this failure to success and
notifies the upper level about it.  After this change the default route
to table 10012 is now properly marked as rejected:

root@mlx-2700-07:mgmt:/var/log/frr# vtysh -c "show ip route table 10012"
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR, f - OpenFabric,
       > - selected route, * - FIB route, q - queued route, r - rejected route

VRF default table 10012:
F>r 0.0.0.0/0 [200/0] via 172.168.1.164, isp2-uplink (vrf PUBLIC), weight 1, 00:24:48

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
zebra/zebra_dplane.c
zebra/zebra_rib.c

index cafcebfbc69e9c691b08ece86aa5b34534b718dd..97712357179ba0779c2c52161f6f1395b2d8e8e2 100644 (file)
@@ -2353,11 +2353,8 @@ dplane_route_update_internal(struct route_node *rn,
        if (ret == AOK)
                result = ZEBRA_DPLANE_REQUEST_QUEUED;
        else {
-               if (ret == ENOENT)
-                       result = ZEBRA_DPLANE_REQUEST_SUCCESS;
-               else
-                       atomic_fetch_add_explicit(&zdplane_info.dg_route_errors,
-                                                 1, memory_order_relaxed);
+               atomic_fetch_add_explicit(&zdplane_info.dg_route_errors, 1,
+                                         memory_order_relaxed);
                if (ctx)
                        dplane_ctx_free(&ctx);
        }
index 8852ee94671825f3570967850a4e7eca58a17fff..5fcb513e3c07ef79709b5828a47eae5f68da4415 100644 (file)
@@ -499,8 +499,8 @@ void rib_install_kernel(struct route_node *rn, struct route_entry *re,
 
                srcdest_rnode2str(rn, str, sizeof(str));
                flog_err(EC_ZEBRA_DP_INSTALL_FAIL,
-                        "%u:%s: Failed to enqueue dataplane install",
-                        re->vrf_id, str);
+                        "%u:%u:%s: Failed to enqueue dataplane install",
+                        re->vrf_id, re->table, str);
                break;
        }
        case ZEBRA_DPLANE_REQUEST_SUCCESS: