]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: Use curr_active to check multipath_num
authorStephen Worley <sworley@cumulusnetworks.com>
Thu, 21 Nov 2019 20:27:12 +0000 (15:27 -0500)
committerStephen Worley <sworley@cumulusnetworks.com>
Thu, 21 Nov 2019 20:27:12 +0000 (15:27 -0500)
We were re-counting the entire group's active number on
every iteration of this nexthop_active_update() loop.

This is not great from a performance perspective but also
it was failing to properly mark things according to the
specified multipath_num.

Since a nexthop is set as active before this check, if its == to
the set ecmp, it gets marked inactive even though if its
under the max ecmp wanted!

ex)

set ecmp to 1.
`/usr/lib/frr/zebra -e 1`

All kernel routes will be marked inactive even with just one nexthop!

K   1.1.1.1/32 [0/0] is directly connected, dummy1 inactive, 00:00:10
K   1.1.1.2/32 [0/0] is directly connected, dummy2 inactive, 00:00:10
K   1.1.1.3/32 [0/0] is directly connected, dummy3 inactive, 00:00:10
K   1.1.1.4/32 [0/0] is directly connected, dummy4 inactive, 00:00:10
K   1.1.1.5/32 [0/0] is directly connected, dummy5 inactive, 00:00:10
K   1.1.1.6/32 [0/0] is directly connected, dummy6 inactive, 00:00:10
K   1.1.1.7/32 [0/0] is directly connected, dummy7 inactive, 00:00:10
K   1.1.1.8/32 [0/0] is directly connected, dummy8 inactive, 00:00:10
K   1.1.1.9/32 [0/0] is directly connected, dummy9 inactive, 00:00:10

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

index 2d7521d8be09b088fc1b8e77cd684155b5f576f0..019c22891826ac062def3caaeb27ffb3bf4b9625 100644 (file)
@@ -1675,9 +1675,7 @@ int nexthop_active_update(struct route_node *rn, struct route_entry *re)
                new_active =
                        nexthop_active_check(rn, re, nexthop);
 
-               if (new_active
-                   && nexthop_group_active_nexthop_num(&new_grp)
-                              >= zrouter.multipath_num) {
+               if (new_active && curr_active >= zrouter.multipath_num) {
                        UNSET_FLAG(nexthop->flags, NEXTHOP_FLAG_ACTIVE);
                        new_active = 0;
                }