]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: register with MLAG on the first VxLAN SG
authorAnuradha Karuppiah <anuradhak@cumulusnetworks.com>
Thu, 6 Feb 2020 17:30:31 +0000 (09:30 -0800)
committerAnuradha Karuppiah <anuradhak@cumulusnetworks.com>
Fri, 14 Feb 2020 17:18:30 +0000 (09:18 -0800)
Channel with the MLAG daemon is setup on the first VxLAN BUM MDT or
pim-mlag AA SVI.

This channel is used for -
1. rxing MLAG status status updates (peer state, role etc.)
2. for syncing active-active upstream entries with the peer MLAG
switch.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
pimd/pim_vxlan.c
pimd/pim_vxlan.h

index fc34f3f6006f8d058cb38e7b7cf159b1da00a3b3..4d8fe779ae17d96f69a49682868043cc2fa40661 100644 (file)
@@ -660,6 +660,14 @@ static struct pim_vxlan_sg *pim_vxlan_sg_new(struct pim_instance *pim,
 
        vxlan_sg = hash_get(pim->vxlan.sg_hash, vxlan_sg, hash_alloc_intern);
 
+       /* we register with the MLAG daemon in the first VxLAN SG and never
+        * de-register during that life of the pimd
+        */
+       if (pim->vxlan.sg_hash->count == 1) {
+               vxlan_mlag.flags |= PIM_VXLAN_MLAGF_DO_REG;
+               pim_mlag_register();
+       }
+
        return vxlan_sg;
 }
 
@@ -717,6 +725,11 @@ void pim_vxlan_sg_del(struct pim_instance *pim, struct prefix_sg *sg)
 }
 
 /******************************* MLAG handling *******************************/
+bool pim_vxlan_do_mlag_reg(void)
+{
+       return (vxlan_mlag.flags & PIM_VXLAN_MLAGF_DO_REG);
+}
+
 /* The peerlink sub-interface is added as an OIF to the origination-mroute.
  * This is done to send a copy of the multicast-vxlan encapsulated traffic
  * to the MLAG peer which may mroute it over the underlay if there are any
index c6507a474c97637154cf44a8ab6d5b0a0466e066..22ed1f761a2d1deee13d30ec6f4b5becc1b0013b 100644 (file)
@@ -66,7 +66,8 @@ struct pim_vxlan_sg {
 
 enum pim_vxlan_mlag_flags {
        PIM_VXLAN_MLAGF_NONE = 0,
-       PIM_VXLAN_MLAGF_ENABLED = (1 << 0)
+       PIM_VXLAN_MLAGF_ENABLED = (1 << 0),
+       PIM_VXLAN_MLAGF_DO_REG = (1 << 1)
 };
 
 enum pim_vxlan_mlag_role {
@@ -142,5 +143,6 @@ extern void pim_vxlan_mlag_update(bool enable, bool peer_state, uint32_t role,
                                struct interface *peerlink_rif,
                                struct in_addr *reg_addr);
 extern void pim_vxlan_config_write(struct vty *vty, char *spaces, int *writes);
+extern bool pim_vxlan_do_mlag_reg(void);
 
 #endif /* PIM_VXLAN_H */