]> git.proxmox.com Git - mirror_frr.git/commitdiff
zebra: debug flags for evpn-mh ES and MAC-ECMP
authorAnuradha Karuppiah <anuradhak@cumulusnetworks.com>
Fri, 27 Mar 2020 22:05:45 +0000 (15:05 -0700)
committerAnuradha Karuppiah <anuradhak@cumulusnetworks.com>
Wed, 5 Aug 2020 13:46:12 +0000 (06:46 -0700)
Filters for MH debug logs

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

index c920fca5ff46a7c4a03126de7fa26e2ca532fced..630614f5edbfe16763febd1a27d9477d61ca320f 100644 (file)
@@ -40,6 +40,7 @@ unsigned long zebra_debug_pw;
 unsigned long zebra_debug_dplane;
 unsigned long zebra_debug_mlag;
 unsigned long zebra_debug_nexthop;
+unsigned long zebra_debug_evpn_mh;
 
 DEFINE_HOOK(zebra_debug_show_debugging, (struct vty *vty), (vty));
 
@@ -109,6 +110,12 @@ DEFUN_NOSH (show_debugging_zebra,
        else if (IS_ZEBRA_DEBUG_NHG)
                vty_out(vty, "  Zebra nexthop debugging is on\n");
 
+       if (IS_ZEBRA_DEBUG_EVPN_MH_ES)
+               vty_out(vty, "  Zebra EVPN-MH ethernet segment debugging is on\n");
+
+       if (IS_ZEBRA_DEBUG_EVPN_MH_NH)
+               vty_out(vty, "  Zebra EVPN-MH nexthop debugging is on\n");
+
        hook_call(zebra_debug_show_debugging, vty);
        return CMD_SUCCESS;
 }
@@ -320,6 +327,34 @@ DEFPY (debug_zebra_mlag,
        return CMD_SUCCESS;
 }
 
+DEFPY (debug_zebra_evpn_mh,
+       debug_zebra_evpn_mh_cmd,
+       "[no$no] debug zebra evpn mh <es$es|nh$nh>",
+       NO_STR
+       DEBUG_STR
+       "Zebra configuration\n"
+       "EVPN\n"
+       "Multihoming\n"
+       "Ethernet Segment Debugging\n"
+       "Nexthop Debugging\n")
+{
+       if (es) {
+               if (no)
+                       UNSET_FLAG(zebra_debug_evpn_mh, ZEBRA_DEBUG_EVPN_MH_ES);
+               else
+                       SET_FLAG(zebra_debug_evpn_mh, ZEBRA_DEBUG_EVPN_MH_ES);
+       }
+
+       if (nh) {
+               if (no)
+                       UNSET_FLAG(zebra_debug_evpn_mh, ZEBRA_DEBUG_EVPN_MH_NH);
+               else
+                       SET_FLAG(zebra_debug_evpn_mh, ZEBRA_DEBUG_EVPN_MH_NH);
+       }
+
+       return CMD_SUCCESS;
+}
+
 DEFUN (no_debug_zebra_events,
        no_debug_zebra_events_cmd,
        "no debug zebra events",
@@ -553,6 +588,14 @@ static int config_write_debug(struct vty *vty)
                vty_out(vty, "debug zebra mlag\n");
                write++;
        }
+       if (IS_ZEBRA_DEBUG_EVPN_MH_ES) {
+               vty_out(vty, "debug zebra evpn mh es\n");
+               write++;
+       }
+       if (IS_ZEBRA_DEBUG_EVPN_MH_NH) {
+               vty_out(vty, "debug zebra evpn mh nh\n");
+               write++;
+       }
        if (IS_ZEBRA_DEBUG_PW) {
                vty_out(vty, "debug zebra pseudowires\n");
                write++;
@@ -589,6 +632,7 @@ void zebra_debug_init(void)
        zebra_debug_pw = 0;
        zebra_debug_dplane = 0;
        zebra_debug_mlag = 0;
+       zebra_debug_evpn_mh = 0;
        zebra_debug_nht = 0;
        zebra_debug_nexthop = 0;
 
@@ -619,6 +663,7 @@ void zebra_debug_init(void)
        install_element(ENABLE_NODE, &no_debug_zebra_rib_cmd);
        install_element(ENABLE_NODE, &no_debug_zebra_fpm_cmd);
        install_element(ENABLE_NODE, &no_debug_zebra_dplane_cmd);
+       install_element(ENABLE_NODE, &debug_zebra_evpn_mh_cmd);
 
        install_element(CONFIG_NODE, &debug_zebra_events_cmd);
        install_element(CONFIG_NODE, &debug_zebra_nht_cmd);
@@ -643,4 +688,5 @@ void zebra_debug_init(void)
        install_element(CONFIG_NODE, &no_debug_zebra_fpm_cmd);
        install_element(CONFIG_NODE, &no_debug_zebra_dplane_cmd);
        install_element(CONFIG_NODE, &debug_zebra_mlag_cmd);
+       install_element(CONFIG_NODE, &debug_zebra_evpn_mh_cmd);
 }
index e513f8865d4faf72462770bf70f132a96da112c7..ffd88d1d44b9c3b8d4a8afb4e907308e429b20fb 100644 (file)
@@ -62,6 +62,9 @@ extern "C" {
 #define ZEBRA_DEBUG_NHG             0x01
 #define ZEBRA_DEBUG_NHG_DETAILED    0x02
 
+#define ZEBRA_DEBUG_EVPN_MH_ES 0x01
+#define ZEBRA_DEBUG_EVPN_MH_NH 0x02
+
 /* Debug related macro. */
 #define IS_ZEBRA_DEBUG_EVENT  (zebra_debug_event & ZEBRA_DEBUG_EVENT)
 
@@ -100,6 +103,9 @@ extern "C" {
 #define IS_ZEBRA_DEBUG_NHG_DETAIL \
        (zebra_debug_nexthop & ZEBRA_DEBUG_NHG_DETAILED)
 
+#define IS_ZEBRA_DEBUG_EVPN_MH_ES (zebra_debug_evpn_mh & ZEBRA_DEBUG_EVPN_MH_ES)
+#define IS_ZEBRA_DEBUG_EVPN_MH_NH (zebra_debug_evpn_mh & ZEBRA_DEBUG_EVPN_MH_NH)
+
 extern unsigned long zebra_debug_event;
 extern unsigned long zebra_debug_packet;
 extern unsigned long zebra_debug_kernel;
@@ -112,6 +118,7 @@ extern unsigned long zebra_debug_pw;
 extern unsigned long zebra_debug_dplane;
 extern unsigned long zebra_debug_mlag;
 extern unsigned long zebra_debug_nexthop;
+extern unsigned long zebra_debug_evpn_mh;
 
 extern void zebra_debug_init(void);