diff --git a/zebra/zebra_vrf.h b/zebra/zebra_vrf.h index 7113c160ac..c7a64d300a 100644 --- a/zebra/zebra_vrf.h +++ b/zebra/zebra_vrf.h @@ -130,6 +130,9 @@ struct zebra_vrf { /* l3-vni info */ vni_t l3vni; + /* pim mroutes installed for vxlan flooding */ + struct hash *vxlan_sg_table; + bool dup_addr_detect; int dad_time; diff --git a/zebra/zebra_vxlan.c b/zebra/zebra_vxlan.c index 461f9dd0ad..2fa1aaf254 100644 --- a/zebra/zebra_vxlan.c +++ b/zebra/zebra_vxlan.c @@ -58,6 +58,7 @@ DEFINE_MTYPE_STATIC(ZEBRA, ZL3VNI, "L3 VNI hash"); DEFINE_MTYPE_STATIC(ZEBRA, ZVNI_VTEP, "VNI remote VTEP"); DEFINE_MTYPE_STATIC(ZEBRA, MAC, "VNI MAC"); DEFINE_MTYPE_STATIC(ZEBRA, NEIGH, "VNI Neighbor"); +DEFINE_MTYPE_STATIC(ZEBRA, ZVXLAN_SG, "zebra VxLAN multicast group"); /* definitions */ /* PMSI strings. */ diff --git a/zebra/zebra_vxlan_private.h b/zebra/zebra_vxlan_private.h index 40e7640cd1..9f945442bb 100644 --- a/zebra/zebra_vxlan_private.h +++ b/zebra/zebra_vxlan_private.h @@ -434,4 +434,26 @@ struct nh_walk_ctx { } #endif +/* + * Multicast hash table. + * + * This table contains - + * 1. The (S, G) entries used for encapsulating and forwarding BUM traffic. + * S is the local VTEP-IP and G is a BUM mcast group address. + * 2. The (X, G) entries used for terminating a BUM flow. + * Multiple L2-VNIs can share the same MDT hence the need to maintain + * an aggregated table that pimd can consume without much + * re-interpretation. + */ +typedef struct zebra_vxlan_sg_ { + struct zebra_vrf *zvrf; + + struct prefix_sg sg; + char sg_str[PREFIX_SG_STR_LEN]; + + /* For SG - num of L2 VNIs using this entry for sending BUM traffic */ + /* For XG - num of SG using this as parent */ + uint32_t ref_cnt; +} zebra_vxlan_sg_t; + #endif /* _ZEBRA_VXLAN_PRIVATE_H */