From 47c1d76a6c79fb0460a7079f9e24228bc9052877 Mon Sep 17 00:00:00 2001 From: Stephen Worley Date: Tue, 15 Feb 2022 18:53:01 -0500 Subject: [PATCH] zebra: cleanup protodown netlink logs 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 --- zebra/if_netlink.c | 30 +++++++++++++++++++++--------- zebra/zebra_evpn_mh.c | 3 ++- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/zebra/if_netlink.c b/zebra/if_netlink.c index e21ff533ec..f26f798364 100644 --- a/zebra/if_netlink.c +++ b/zebra/if_netlink.c @@ -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; } diff --git a/zebra/zebra_evpn_mh.c b/zebra/zebra_evpn_mh.c index 43eef69be2..9099c066b1 100644 --- a/zebra/zebra_evpn_mh.c +++ b/zebra/zebra_evpn_mh.c @@ -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); } -- 2.39.5