mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-09 09:22:32 +00:00
zebra: Add function to install a nhe into the kernel
Add a function for installing Nexthop Group hash entires into the kernel. It sends the entry to the dataplane and does any post-processing immediately after that. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
This commit is contained in:
parent
7f6077d063
commit
5be96a2d3a
@ -36,6 +36,7 @@
|
|||||||
#include "zebra/zebra_routemap.h"
|
#include "zebra/zebra_routemap.h"
|
||||||
#include "zebra/rt.h"
|
#include "zebra/rt.h"
|
||||||
#include "zebra_errors.h"
|
#include "zebra_errors.h"
|
||||||
|
#include "zebra_dplane.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* zebra_nhg_lookup_id() - Lookup the nexthop group id in the id table
|
* zebra_nhg_lookup_id() - Lookup the nexthop group id in the id table
|
||||||
@ -845,3 +846,27 @@ int nexthop_active_update(struct route_node *rn, struct route_entry *re)
|
|||||||
|
|
||||||
return curr_active;
|
return curr_active;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* zebra_nhg_install_kernel() - Install Nexthop Group hash entry into kernel
|
||||||
|
*
|
||||||
|
* @nhe: Nexthop Group hash entry to install
|
||||||
|
*/
|
||||||
|
void zebra_nhg_install_kernel(struct nhg_hash_entry *nhe)
|
||||||
|
{
|
||||||
|
int ret = dplane_nexthop_add(nhe);
|
||||||
|
switch (ret) {
|
||||||
|
case ZEBRA_DPLANE_REQUEST_QUEUED:
|
||||||
|
SET_FLAG(nhe->flags, NEXTHOP_GROUP_QUEUED);
|
||||||
|
break;
|
||||||
|
case ZEBRA_DPLANE_REQUEST_FAILURE:
|
||||||
|
flog_err(EC_ZEBRA_DP_INSTALL_FAIL,
|
||||||
|
"Failed to install Nexthop ID (%u) into the kernel",
|
||||||
|
nhe->id);
|
||||||
|
break;
|
||||||
|
case ZEBRA_DPLANE_REQUEST_SUCCESS:
|
||||||
|
SET_FLAG(nhe->flags, NEXTHOP_GROUP_INSTALLED);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -78,4 +78,6 @@ void zebra_nhg_release(struct nhg_hash_entry *nhe);
|
|||||||
void zebra_nhg_decrement_ref(struct nhg_hash_entry *nhe);
|
void zebra_nhg_decrement_ref(struct nhg_hash_entry *nhe);
|
||||||
|
|
||||||
extern int nexthop_active_update(struct route_node *rn, struct route_entry *re);
|
extern int nexthop_active_update(struct route_node *rn, struct route_entry *re);
|
||||||
|
|
||||||
|
void zebra_nhg_install_kernel(struct nhg_hash_entry *nhe);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user