summaryrefslogtreecommitdiffstats
path: root/zebra/interface.c
diff options
context:
space:
mode:
authorStephen Worley <sworley@cumulusnetworks.com>2019-05-15 00:03:29 +0200
committerStephen Worley <sworley@cumulusnetworks.com>2019-10-25 17:13:40 +0200
commite22e80010ee4226cbb4c1cb570d520ff071add89 (patch)
tree526bb712a327a786e1246e3d971bfea9dd484605 /zebra/interface.c
parentzebra: Free the nhe dataplane ctx always (diff)
downloadfrr-e22e80010ee4226cbb4c1cb570d520ff071add89.tar.xz
frr-e22e80010ee4226cbb4c1cb570d520ff071add89.zip
zebra: Use a nhe context dataplane and rib metaq
We will use a nhe context for dataplane interaction with nextho group hash entries. New nhe's from the kernel will be put into a group array if they are a group and queued on the rib metaq to be processed later. New nhe's sent to the kernel will be set on the dataplane context with approprate ID's in the group array if needed. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
Diffstat (limited to 'zebra/interface.c')
-rw-r--r--zebra/interface.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/zebra/interface.c b/zebra/interface.c
index 798cb9269..94f5cb58c 100644
--- a/zebra/interface.c
+++ b/zebra/interface.c
@@ -189,6 +189,20 @@ static int if_zebra_new_hook(struct interface *ifp)
return 0;
}
+static void if_nhg_dependents_release(struct interface *ifp)
+{
+ if (!if_nhg_dependents_is_empty(ifp)) {
+ struct nhg_connected *rb_node_dep = NULL;
+ struct zebra_if *zif = (struct zebra_if *)ifp->info;
+
+ RB_FOREACH (rb_node_dep, nhg_connected_head,
+ &zif->nhg_dependents) {
+ rb_node_dep->nhe->ifp = NULL;
+ zebra_nhg_set_invalid(rb_node_dep->nhe);
+ }
+ }
+}
+
/* Called when interface is deleted. */
static int if_zebra_delete_hook(struct interface *ifp)
{
@@ -210,6 +224,7 @@ static int if_zebra_delete_hook(struct interface *ifp)
list_delete(&rtadv->AdvDNSSLList);
#endif /* HAVE_RTADV */
+ if_nhg_dependents_release(ifp);
zebra_if_nhg_dependents_free(zebra_if);
XFREE(MTYPE_TMP, zebra_if->desc);
@@ -983,7 +998,7 @@ bool if_nhg_dependents_is_empty(const struct interface *ifp)
return false;
}
-void if_down_nhg_dependents(const struct interface *ifp)
+static void if_down_nhg_dependents(const struct interface *ifp)
{
if (!if_nhg_dependents_is_empty(ifp)) {
struct nhg_connected *rb_node_dep = NULL;