]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: When installing a mroute, allow it to flow 17254/head
authorDonald Sharp <sharpd@nvidia.com>
Sat, 26 Oct 2024 01:56:14 +0000 (21:56 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Mon, 28 Oct 2024 19:02:39 +0000 (15:02 -0400)
Currently the mroute code was not allowing the mroute
to be sent to the dataplane.  This leaves us with a
situation where the routes being installed where never
being set as installed and additionally nht against
the mrib would not work if the route came into existence
after the nexthop tracking was asked for.

Turns out all the pieces where there to let this work.
Modify the code to pass it to the dplane and to send
it back up as having worked.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
zebra/dplane_fpm_nl.c
zebra/rt_netlink.c
zebra/rt_socket.c
zebra/zebra_rib.c

index 8a967978cb31f0de43848cabe588d964154359f2..e6b4af3674293812db8cae0c93c91f95dd27416b 100644 (file)
@@ -1712,6 +1712,16 @@ static int fpm_nl_process(struct zebra_dplane_provider *prov)
                 * anyway.
                 */
                if (fnc->socket != -1 && fnc->connecting == false) {
+                       enum dplane_op_e op = dplane_ctx_get_op(ctx);
+
+                       /*
+                        * Just skip multicast routes and let them flow through
+                        */
+                       if ((op == DPLANE_OP_ROUTE_DELETE || op == DPLANE_OP_ROUTE_INSTALL ||
+                            op == DPLANE_OP_ROUTE_UPDATE) &&
+                           dplane_ctx_get_safi(ctx) == SAFI_MULTICAST)
+                               goto skip;
+
                        frr_with_mutex (&fnc->ctxqueue_mutex) {
                                dplane_ctx_enqueue_tail(&fnc->ctxqueue, ctx);
                                cur_queue =
@@ -1722,7 +1732,7 @@ static int fpm_nl_process(struct zebra_dplane_provider *prov)
                                peak_queue = cur_queue;
                        continue;
                }
-
+skip:
                dplane_ctx_set_status(ctx, ZEBRA_DPLANE_REQUEST_SUCCESS);
                dplane_provider_enqueue_out_ctx(prov, ctx);
        }
index dc679ed4954dd0ebc6ceb3695dd9b733cf64d7f3..ab07ef8d2124ba71e61bc05bf1dc1a7e9f2cefbc 100644 (file)
@@ -3178,6 +3178,9 @@ netlink_put_route_update_msg(struct nl_batch *bth, struct zebra_dplane_ctx *ctx)
        } else
                return FRR_NETLINK_ERROR;
 
+       if (dplane_ctx_get_safi(ctx) == SAFI_MULTICAST)
+               return FRR_NETLINK_SUCCESS;
+
        if (RSYSTEM_ROUTE(dplane_ctx_get_type(ctx)))
                return FRR_NETLINK_SUCCESS;
 
index 0bfcd518cade2e78b8dec2ede741165ec95de059..4444eda94ba3b48e48d660ad972f1285d7035513 100644 (file)
@@ -317,12 +317,12 @@ enum zebra_dplane_result kernel_route_update(struct zebra_dplane_ctx *ctx)
        frr_with_privs(&zserv_privs) {
 
                if (dplane_ctx_get_op(ctx) == DPLANE_OP_ROUTE_DELETE) {
-                       if (!RSYSTEM_ROUTE(type))
+                       if (!RSYSTEM_ROUTE(type) && dplane_ctx_get_safi(ctx) != SAFI_MULTICAST)
                                kernel_rtm(RTM_DELETE, dplane_ctx_get_dest(ctx),
                                           dplane_ctx_get_ng(ctx),
                                           dplane_ctx_get_metric(ctx));
                } else if (dplane_ctx_get_op(ctx) == DPLANE_OP_ROUTE_INSTALL) {
-                       if (!RSYSTEM_ROUTE(type))
+                       if (!RSYSTEM_ROUTE(type) && dplane_ctx_get_safi(ctx) != SAFI_MULTICAST)
                                kernel_rtm(RTM_ADD, dplane_ctx_get_dest(ctx),
                                           dplane_ctx_get_ng(ctx),
                                           dplane_ctx_get_metric(ctx));
@@ -330,12 +330,12 @@ enum zebra_dplane_result kernel_route_update(struct zebra_dplane_ctx *ctx)
                        /* Must do delete and add separately -
                         * no update available
                         */
-                       if (!RSYSTEM_ROUTE(old_type))
+                       if (!RSYSTEM_ROUTE(old_type) && dplane_ctx_get_safi(ctx) != SAFI_MULTICAST)
                                kernel_rtm(RTM_DELETE, dplane_ctx_get_dest(ctx),
                                           dplane_ctx_get_old_ng(ctx),
                                           dplane_ctx_get_old_metric(ctx));
 
-                       if (!RSYSTEM_ROUTE(type))
+                       if (!RSYSTEM_ROUTE(type) && dplane_ctx_get_safi(ctx) != SAFI_MULTICAST)
                                kernel_rtm(RTM_ADD, dplane_ctx_get_dest(ctx),
                                           dplane_ctx_get_ng(ctx),
                                           dplane_ctx_get_metric(ctx));
index 8acb07374d6bff8fb6ef25c50408cab6bca44beb..aea39b8ecf18c0f4c69cb944e6314f69af9bd22c 100644 (file)
@@ -637,19 +637,12 @@ int zebra_rib_labeled_unicast(struct route_entry *re)
 void rib_install_kernel(struct route_node *rn, struct route_entry *re,
                        struct route_entry *old)
 {
-       struct nexthop *nexthop;
        struct rib_table_info *info = srcdest_rnode_table_info(rn);
        struct zebra_vrf *zvrf = zebra_vrf_lookup_by_id(re->vrf_id);
        enum zebra_dplane_result ret;
 
        rib_dest_t *dest = rib_dest_from_rnode(rn);
 
-       if (info->safi != SAFI_UNICAST) {
-               for (ALL_NEXTHOPS(re->nhe->nhg, nexthop))
-                       SET_FLAG(nexthop->flags, NEXTHOP_FLAG_FIB);
-               return;
-       }
-
        /*
         * Install the resolved nexthop object first.
         */
@@ -716,17 +709,8 @@ void rib_install_kernel(struct route_node *rn, struct route_entry *re,
 /* Uninstall the route from kernel. */
 void rib_uninstall_kernel(struct route_node *rn, struct route_entry *re)
 {
-       struct nexthop *nexthop;
-       struct rib_table_info *info = srcdest_rnode_table_info(rn);
        struct zebra_vrf *zvrf = zebra_vrf_lookup_by_id(re->vrf_id);
 
-       if (info->safi != SAFI_UNICAST) {
-               UNSET_FLAG(re->status, ROUTE_ENTRY_INSTALLED);
-               for (ALL_NEXTHOPS(re->nhe->nhg, nexthop))
-                       UNSET_FLAG(nexthop->flags, NEXTHOP_FLAG_FIB);
-               return;
-       }
-
        /*
         * Make sure we update the FPM any time we send new information to
         * the dataplane.