summaryrefslogtreecommitdiffstats
path: root/zebra
diff options
context:
space:
mode:
authorAnuradha Karuppiah <anuradhak@cumulusnetworks.com>2019-03-19 21:56:46 +0100
committerAnuradha Karuppiah <anuradhak@cumulusnetworks.com>2019-04-20 17:33:20 +0200
commit4ab3321f29151f0d911a49fc0f8593736799a349 (patch)
tree07fb13609323331ed3f2e3170d880e54c2a3ad11 /zebra
parentzebra: trigger SG update on l2-vni<=>mcast-grp changes (diff)
downloadfrr-4ab3321f29151f0d911a49fc0f8593736799a349.tar.xz
frr-4ab3321f29151f0d911a49fc0f8593736799a349.zip
lib, zebra: changes to propagate vxlan mcast SG entries to pimd
These updates act as triggers to pimd to - 1. join the MDT for rxing VxLAN encapsulated BUM traffic 2. register the local-vtep-ip as a source for the MDT Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Diffstat (limited to 'zebra')
-rw-r--r--zebra/zebra_vxlan.c40
-rw-r--r--zebra/zserv.c2
-rw-r--r--zebra/zserv.h2
3 files changed, 44 insertions, 0 deletions
diff --git a/zebra/zebra_vxlan.c b/zebra/zebra_vxlan.c
index b13b56e97..aa85af649 100644
--- a/zebra/zebra_vxlan.c
+++ b/zebra/zebra_vxlan.c
@@ -9407,6 +9407,41 @@ static int zebra_vxlan_dad_mac_auto_recovery_exp(struct thread *t)
}
/************************** vxlan SG cache management ************************/
+/* Inform PIM about the mcast group */
+static int zebra_vxlan_sg_send(struct prefix_sg *sg,
+ char *sg_str, uint16_t cmd)
+{
+ struct zserv *client = NULL;
+ struct stream *s = NULL;
+
+ client = zserv_find_client(ZEBRA_ROUTE_PIM, 0);
+ if (!client)
+ return 0;
+
+ s = stream_new(ZEBRA_MAX_PACKET_SIZ);
+
+ zclient_create_header(s, cmd, VRF_DEFAULT);
+ stream_putl(s, IPV4_MAX_BYTELEN);
+ stream_put(s, &sg->src.s_addr, IPV4_MAX_BYTELEN);
+ stream_put(s, &sg->grp.s_addr, IPV4_MAX_BYTELEN);
+
+ /* Write packet size. */
+ stream_putw_at(s, 0, stream_get_endp(s));
+
+ if (IS_ZEBRA_DEBUG_VXLAN)
+ zlog_debug(
+ "Send %s %s to %s",
+ (cmd == ZEBRA_VXLAN_SG_ADD) ? "add" : "del", sg_str,
+ zebra_route_string(client->proto));
+
+ if (cmd == ZEBRA_VXLAN_SG_ADD)
+ client->vxlan_sg_add_cnt++;
+ else
+ client->vxlan_sg_del_cnt++;
+
+ return zserv_send_message(client, s);
+}
+
static unsigned int zebra_vxlan_sg_hash_key_make(void *p)
{
zebra_vxlan_sg_t *vxlan_sg = p;
@@ -9482,6 +9517,8 @@ static zebra_vxlan_sg_t *zebra_vxlan_sg_add(struct zebra_vrf *zvrf,
return vxlan_sg;
}
+ zebra_vxlan_sg_send(sg, vxlan_sg->sg_str, ZEBRA_VXLAN_SG_ADD);
+
return vxlan_sg;
}
@@ -9502,6 +9539,9 @@ static void zebra_vxlan_sg_del(zebra_vxlan_sg_t *vxlan_sg)
zebra_vxlan_sg_do_deref(zvrf, sip, vxlan_sg->sg.grp);
}
+ zebra_vxlan_sg_send(&vxlan_sg->sg, vxlan_sg->sg_str,
+ ZEBRA_VXLAN_SG_DEL);
+
hash_release(vxlan_sg->zvrf->vxlan_sg_table, vxlan_sg);
if (IS_ZEBRA_DEBUG_VXLAN)
diff --git a/zebra/zserv.c b/zebra/zserv.c
index 80fdbefcd..df5f236c0 100644
--- a/zebra/zserv.c
+++ b/zebra/zserv.c
@@ -970,6 +970,8 @@ static void zebra_show_client_detail(struct vty *vty, struct zserv *client)
client->v4_nh_watch_add_cnt, 0, client->v4_nh_watch_rem_cnt);
vty_out(vty, "NHT v6 %-12d%-12d%-12d\n",
client->v6_nh_watch_add_cnt, 0, client->v6_nh_watch_rem_cnt);
+ vty_out(vty, "VxLAN SG %-12d%-12d%-12d\n", client->vxlan_sg_add_cnt,
+ 0, client->vxlan_sg_del_cnt);
vty_out(vty, "Interface Up Notifications: %d\n", client->ifup_cnt);
vty_out(vty, "Interface Down Notifications: %d\n", client->ifdown_cnt);
vty_out(vty, "VNI add notifications: %d\n", client->vniadd_cnt);
diff --git a/zebra/zserv.h b/zebra/zserv.h
index 86863d961..90fd19571 100644
--- a/zebra/zserv.h
+++ b/zebra/zserv.h
@@ -141,6 +141,8 @@ struct zserv {
uint32_t v4_nh_watch_rem_cnt;
uint32_t v6_nh_watch_add_cnt;
uint32_t v6_nh_watch_rem_cnt;
+ uint32_t vxlan_sg_add_cnt;
+ uint32_t vxlan_sg_del_cnt;
time_t nh_reg_time;
time_t nh_dereg_time;