return (fib_entry_src_get_source(bsrc));
}
+/**
+ * Return !0 is the entry represents a host prefix
+ */
+int
+fib_entry_is_host (fib_node_index_t fib_entry_index)
+{
+ fib_prefix_t pfx;
+
+ fib_entry_get_prefix(fib_entry_index, &pfx);
+
+ return (fib_prefix_is_host(&pfx));
+}
+
/**
* Return !0 is the entry is reoslved, i.e. will return a valid forwarding
* chain
extern fib_node_index_t fib_entry_get_path_list(fib_node_index_t fib_entry_index);
extern int fib_entry_is_resolved(fib_node_index_t fib_entry_index);
+extern int fib_entry_is_host(fib_node_index_t fib_entry_index);
extern void fib_entry_set_flow_hash_config(fib_node_index_t fib_entry_index,
flow_hash_config_t hash_config);
/*
* inform the covering entry that a new more specific
- * has been inserted beneath it
+ * has been inserted beneath it.
+ * If the prefix that has been inserted is a host route
+ * then it is not possible that it will be the cover for any
+ * other entry, so we can elide the walk. This is particularly
+ * beneficial since there are often many host entries sharing the
+ * same cover (i.e. ADJ or RR sourced entries).
*/
- fib_entry_cover_change_notify(fib_entry_cover_index,
- fib_entry_index);
+ if (!fib_entry_is_host(fib_entry_index))
+ {
+ fib_entry_cover_change_notify(fib_entry_cover_index,
+ fib_entry_index);
+ }
}
}