]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: Use NHE id on kernel route sends
authorStephen Worley <sworley@cumulusnetworks.com>
Tue, 14 May 2019 23:42:39 +0000 (16:42 -0700)
committerStephen Worley <sworley@cumulusnetworks.com>
Fri, 25 Oct 2019 15:13:40 +0000 (11:13 -0400)
If the kernel supports nexthop objects, send the route
using an nhg_hash_entry ID instead.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
zebra/rt_netlink.c
zebra/zebra_dplane.c

index 83e3fd558b1259b0cf6817b4ce53829310ccd326..5d2d407688c5c8c3275d889f2aa4ca7b3e6fbd1f 100644 (file)
@@ -1637,6 +1637,13 @@ static int netlink_route_multipath(int cmd, struct zebra_dplane_ctx *ctx)
                          RTA_PAYLOAD(rta));
        }
 
+       if (dplane_ctx_get_nhe_id(ctx)) {
+               /* Kernel supports nexthop objects */
+               addattr32(&req.n, sizeof(req), RTA_NH_ID,
+                         dplane_ctx_get_nhe_id(ctx));
+               goto skip;
+       }
+
        /* Count overall nexthops so we can decide whether to use singlepath
         * or multipath case.
         */
index 21427b80631fe59632ec01e2ae7ced6cc52e210b..d3e10bbb5d311cac27238b0b0c4967c7b5876ec9 100644 (file)
@@ -1525,6 +1525,9 @@ static int dplane_ctx_route_init(struct zebra_dplane_ctx *ctx,
        zns = zvrf->zns;
        dplane_ctx_ns_init(ctx, zns, (op == DPLANE_OP_ROUTE_UPDATE));
 
+       if (re->nhe_id && zns->supports_nh)
+               ctx->u.rinfo.nhe.id = re->nhe_id;
+
        /* Trying out the sequence number idea, so we can try to detect
         * when a result is stale.
         */