summaryrefslogtreecommitdiff
path: root/zebra/zebra_fpm.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-11-30 14:03:07 -0500
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-12-05 17:26:32 -0500
commit5f7a4718e201724a8ca697dedaa8ce008949c3f5 (patch)
tree076ee09a55a48257a55f90812babd340ba012b4f /zebra/zebra_fpm.c
parent17473b9a4589054ce2b3c81e4f2f32e7573d75c3 (diff)
zebra: Replace SELECTED_FIB flag with a rib_dest_t pointer
The SELECTED_FIB flag was placed upon the entry that we have inserted into the kernel. Remove this flag and replace with a `rib_dest_t` *selected_fib. Just keep track of the selected_fib as we modify it. This removes allot of FOREACH_RE loops as that we do not need to find the entry anymore. At this point in time I think this is a very minor performance boost. Most `rib_dest_t` structures do not typically carry more than 1 route_entry, but the minute you start having more than one entry you can and will start having significant processing time spent finding the selected_fib. A future commit may re-order the route entries and possibly keep more pointers on `rib_dest_t` to avoid lookup. This is a bit tricky because of the FIB_OVERRIDE code. Signed-off-by Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'zebra/zebra_fpm.c')
-rw-r--r--zebra/zebra_fpm.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/zebra/zebra_fpm.c b/zebra/zebra_fpm.c
index 7448292d9f..0d0a2cb3bf 100644
--- a/zebra/zebra_fpm.c
+++ b/zebra/zebra_fpm.c
@@ -842,19 +842,7 @@ static inline int zfpm_encode_route(rib_dest_t *dest, struct route_entry *re,
*/
struct route_entry *zfpm_route_for_update(rib_dest_t *dest)
{
- struct route_entry *re;
-
- RE_DEST_FOREACH_ROUTE (dest, re) {
- if (!CHECK_FLAG(re->status, ROUTE_ENTRY_SELECTED_FIB))
- continue;
-
- return re;
- }
-
- /*
- * We have no route for this destination.
- */
- return NULL;
+ return dest->selected_fib;
}
/*