]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: add a config knob to enable use of L3 NHG for EVPN host routes
authorAnuradha Karuppiah <anuradhak@cumulusnetworks.com>
Mon, 18 May 2020 22:55:39 +0000 (15:55 -0700)
committerAnuradha Karuppiah <anuradhak@nvidia.com>
Tue, 24 Nov 2020 19:06:08 +0000 (11:06 -0800)
Sample config -
vtysh -c "conf t"  -c "router bgp <N>" -c "address-family l2vpn evpn" -c "use-es-l3nhg"

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
bgpd/bgp_evpn_mh.c
bgpd/bgp_evpn_mh.h
bgpd/bgp_evpn_vty.c

index 0407085d4cc3a1a7b96e3e4ee403d4cd771a1761..0494200e34d7707b81e6de799de6024332f08555 100644 (file)
@@ -3703,8 +3703,8 @@ void bgp_evpn_mh_init(void)
        /* config knobs - XXX add cli to control it */
        bgp_mh_info->ead_evi_adv_for_down_links = true;
        bgp_mh_info->consistency_checking = true;
-       bgp_mh_info->install_l3nhg = true;
-       bgp_mh_info->host_routes_use_l3nhg = false;
+       bgp_mh_info->install_l3nhg = false;
+       bgp_mh_info->host_routes_use_l3nhg = BGP_EVPN_MH_USE_ES_L3NHG_DEF;
 
        if (bgp_mh_info->consistency_checking)
                thread_add_timer(bm->master, bgp_evpn_run_consistency_checks,
index 1ccc504cffcd15aa4e9f85459fb6ebcf6d9d9494..a65e8abd17c79ee1f7c8070d36d913d179b0b69e 100644 (file)
@@ -34,6 +34,7 @@
 
 #define BGP_EVPN_CONS_CHECK_INTERVAL 60
 
+#define BGP_EVPN_MH_USE_ES_L3NHG_DEF false
 
 /* Ethernet Segment entry -
  * - Local and remote ESs are maintained in a global RB tree,
index e5e91deb252c46e86c9a841d14c4e0100449584d..f957103df77e9bf3f6e0004c92a7465aa3a917cc 100644 (file)
@@ -3747,6 +3747,16 @@ DEFUN (no_bgp_evpn_advertise_type5,
        return CMD_SUCCESS;
 }
 
+DEFPY (bgp_evpn_use_es_l3nhg,
+       bgp_evpn_use_es_l3nhg_cmd,
+       "[no$no] use-es-l3nhg",
+       NO_STR
+       "use L3 nexthop group for host routes with ES destination\n")
+{
+       bgp_mh_info->host_routes_use_l3nhg = no ? false :true;
+       return CMD_SUCCESS;
+}
+
 DEFPY (bgp_evpn_advertise_pip_ip_mac,
        bgp_evpn_advertise_pip_ip_mac_cmd,
        "[no$no] advertise-pip [ip <A.B.C.D> [mac <X:X:X:X:X:X|X:X:X:X:X:X/M>]]",
@@ -5733,6 +5743,14 @@ void bgp_config_write_evpn_info(struct vty *vty, struct bgp *bgp, afi_t afi,
        if (bgp->evpn_info->advertise_svi_macip)
                vty_out(vty, "  advertise-svi-ip\n");
 
+       if (bgp_mh_info->host_routes_use_l3nhg !=
+                       BGP_EVPN_MH_USE_ES_L3NHG_DEF) {
+               if (bgp_mh_info->host_routes_use_l3nhg)
+                       vty_out(vty, "  use-es-l3nhg\n");
+               else
+                       vty_out(vty, "  no use-es-l3nhg\n");
+       }
+
        if (!bgp->evpn_info->dup_addr_detect)
                vty_out(vty, "  no dup-addr-detection\n");
 
@@ -5877,6 +5895,7 @@ void bgp_ethernetvpn_init(void)
        install_element(BGP_EVPN_NODE, &no_dup_addr_detection_cmd);
        install_element(BGP_EVPN_NODE, &bgp_evpn_flood_control_cmd);
        install_element(BGP_EVPN_NODE, &bgp_evpn_advertise_pip_ip_mac_cmd);
+       install_element(BGP_EVPN_NODE, &bgp_evpn_use_es_l3nhg_cmd);
 
        /* test commands */
        install_element(BGP_EVPN_NODE, &test_es_add_cmd);