mirror of
https://git.proxmox.com/git/mirror_frr
synced 2026-01-25 21:36:38 +00:00
zebra: Move resolve/add depend install into api
Move the resolving and installing of a single nhg_hash_entry into the install function itself, rather than letting zebra_rib handle it. Further, ensure depends are installed/queued before installing a group. The ordering should be find here since only one thread will call this API. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
This commit is contained in:
parent
8dfbc65724
commit
f429bd1b24
@ -1475,6 +1475,16 @@ uint8_t zebra_nhg_nhe2grp(struct nh_grp *grp, struct nhg_hash_entry *nhe)
|
||||
|
||||
void zebra_nhg_install_kernel(struct nhg_hash_entry *nhe)
|
||||
{
|
||||
struct nhg_connected *rb_node_dep = NULL;
|
||||
|
||||
/* Resolve it first */
|
||||
nhe = zebra_nhg_resolve(nhe);
|
||||
|
||||
/* Make sure all depends are installed/queued */
|
||||
frr_each (nhg_connected_tree, &nhe->nhg_depends, rb_node_dep) {
|
||||
zebra_nhg_install_kernel(rb_node_dep->nhe);
|
||||
}
|
||||
|
||||
if (!CHECK_FLAG(nhe->flags, NEXTHOP_GROUP_INSTALLED)
|
||||
&& !CHECK_FLAG(nhe->flags, NEXTHOP_GROUP_QUEUED)) {
|
||||
nhe->is_kernel_nh = false;
|
||||
|
||||
@ -519,7 +519,6 @@ void rib_install_kernel(struct route_node *rn, struct route_entry *re,
|
||||
struct zebra_vrf *zvrf = vrf_info_lookup(re->vrf_id);
|
||||
const struct prefix *p, *src_p;
|
||||
enum zebra_dplane_result ret;
|
||||
struct nhg_hash_entry *nhe;
|
||||
|
||||
rib_dest_t *dest = rib_dest_from_rnode(rn);
|
||||
|
||||
@ -549,9 +548,7 @@ void rib_install_kernel(struct route_node *rn, struct route_entry *re,
|
||||
/*
|
||||
* Install the resolved nexthop object first.
|
||||
*/
|
||||
nhe = zebra_nhg_resolve(zebra_nhg_lookup_id(re->nhe_id));
|
||||
if (!nhe->is_kernel_nh)
|
||||
zebra_nhg_install_kernel(nhe);
|
||||
zebra_nhg_install_kernel(zebra_nhg_lookup_id(re->nhe_id));
|
||||
|
||||
/*
|
||||
* If this is a replace to a new RE let the originator of the RE
|
||||
|
||||
Loading…
Reference in New Issue
Block a user