]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: cleanup protodown netlink logs 10427/head
authorStephen Worley <sworley@nvidia.com>
Tue, 15 Feb 2022 23:53:01 +0000 (18:53 -0500)
committerStephen Worley <sworley@nvidia.com>
Wed, 9 Mar 2022 23:02:45 +0000 (18:02 -0500)
Cleanup the logs in the netlink code for setting
protodown on/off to be more useful to a user parsing them
after an issue.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
zebra/if_netlink.c
zebra/zebra_evpn_mh.c

index e21ff533ecffb2e04476d89df8ccfad2f1c9ee5c..f26f79836448567ed21850de12fe1b7de5a6b0fd 100644 (file)
@@ -870,16 +870,27 @@ static void netlink_proc_dplane_if_protodown(struct zebra_if *zif,
 
        if (zebra_evpn_is_es_bond_member(zif->ifp)) {
                /* Check it's not already being sent to the dplane first */
-               if (protodown && CHECK_FLAG(zif->flags, ZIF_FLAG_SET_PROTODOWN))
+               if (protodown &&
+                   CHECK_FLAG(zif->flags, ZIF_FLAG_SET_PROTODOWN)) {
+                       if (IS_ZEBRA_DEBUG_EVPN_MH_ES || IS_ZEBRA_DEBUG_KERNEL)
+                               zlog_debug(
+                                       "bond mbr %s protodown on recv'd but already sent protodown on to the dplane",
+                                       zif->ifp->name);
                        return;
+               }
 
-               if (!protodown
-                   && CHECK_FLAG(zif->flags, ZIF_FLAG_UNSET_PROTODOWN))
+               if (!protodown &&
+                   CHECK_FLAG(zif->flags, ZIF_FLAG_UNSET_PROTODOWN)) {
+                       if (IS_ZEBRA_DEBUG_EVPN_MH_ES || IS_ZEBRA_DEBUG_KERNEL)
+                               zlog_debug(
+                                       "bond mbr %s protodown off recv'd but already sent protodown off to the dplane",
+                                       zif->ifp->name);
                        return;
+               }
 
                if (IS_ZEBRA_DEBUG_EVPN_MH_ES || IS_ZEBRA_DEBUG_KERNEL)
                        zlog_debug(
-                               "bond mbr %s re-instate protdown %s in the dplane",
+                               "bond mbr %s reinstate protodown %s in the dplane",
                                zif->ifp->name, old_protodown ? "on" : "off");
 
                if (old_protodown)
@@ -2227,8 +2238,9 @@ void interface_list(struct zebra_ns *zns)
 void if_netlink_set_frr_protodown_r_bit(uint8_t bit)
 {
        if (IS_ZEBRA_DEBUG_KERNEL)
-               zlog_debug("FRR protodown reason bit change %u -> %u",
-                          frr_protodown_r_bit, bit);
+               zlog_debug(
+                       "Protodown reason bit index changed: bit-index %u -> bit-index %u",
+                       frr_protodown_r_bit, bit);
 
        frr_protodown_r_bit = bit;
 }
@@ -2236,9 +2248,9 @@ void if_netlink_set_frr_protodown_r_bit(uint8_t bit)
 void if_netlink_unset_frr_protodown_r_bit(void)
 {
        if (IS_ZEBRA_DEBUG_KERNEL)
-               zlog_debug("FRR protodown reason bit change %u -> %u",
-                          frr_protodown_r_bit,
-                          FRR_PROTODOWN_REASON_DEFAULT_BIT);
+               zlog_debug(
+                       "Protodown reason bit index changed: bit-index %u -> bit-index %u",
+                       frr_protodown_r_bit, FRR_PROTODOWN_REASON_DEFAULT_BIT);
 
        frr_protodown_r_bit = FRR_PROTODOWN_REASON_DEFAULT_BIT;
 }
index 43eef69be20d986d08fb5a3506201649f6eacc6d..9099c066b1edc06e3049425a6c02ef07f22af950 100644 (file)
@@ -3470,7 +3470,8 @@ void zebra_evpn_mh_json(json_object *json)
                                json_object_new_string("startupDelay"));
                if (CHECK_FLAG(zmh_info->protodown_rc,
                               ZEBRA_PROTODOWN_EVPN_UPLINK_DOWN))
-                       json_object_array_add(json_array,
+                       json_object_array_add(
+                               json_array,
                                json_object_new_string("uplinkDown"));
                json_object_object_add(json, "protodownReasons", json_array);
        }