diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-11-30 14:03:07 -0500 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-12-05 17:26:32 -0500 |
| commit | 5f7a4718e201724a8ca697dedaa8ce008949c3f5 (patch) | |
| tree | 076ee09a55a48257a55f90812babd340ba012b4f /zebra/rib.h | |
| parent | 17473b9a4589054ce2b3c81e4f2f32e7573d75c3 (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/rib.h')
| -rw-r--r-- | zebra/rib.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/zebra/rib.h b/zebra/rib.h index 818844cb6d..6027385cac 100644 --- a/zebra/rib.h +++ b/zebra/rib.h @@ -85,8 +85,7 @@ struct route_entry { /* to simplify NHT logic when NHs change, instead of doing a NH by NH cmp */ #define ROUTE_ENTRY_NEXTHOPS_CHANGED 0x2 #define ROUTE_ENTRY_CHANGED 0x4 -#define ROUTE_ENTRY_SELECTED_FIB 0x8 -#define ROUTE_ENTRY_LABELS_CHANGED 0x10 +#define ROUTE_ENTRY_LABELS_CHANGED 0x8 /* Nexthop information. */ u_char nexthop_num; @@ -122,6 +121,8 @@ typedef struct rib_dest_t_ { */ struct route_entry *routes; + struct route_entry *selected_fib; + /* * Flags, see below. */ |
