summaryrefslogtreecommitdiff
path: root/zebra/interface.c
diff options
context:
space:
mode:
authorAnuradha Karuppiah <anuradhak@cumulusnetworks.com>2020-06-14 07:31:45 -0700
committerAnuradha Karuppiah <anuradhak@nvidia.com>2020-12-14 10:32:40 -0800
commit26ba45e33dafab0cf0f7fc83f747cff8ab32c3b6 (patch)
treec65709afcf1518f26eb02744ba93cfe2e82f7c4f /zebra/interface.c
parent5c843270541c8d911ee59f90a556ec86c25e46d9 (diff)
zebra: update protodown display
protodown state is a combination of the dplane and zebra states. protodown reason is maintained exclusively by zebra. Display this information on two separate lines to make that ownership clearer. Also display n/a for bonds as the dplane doesn't support protodowning the bond device. Sample output - ============== root@torm-11:mgmt:~# vtysh -c "show interface hostbond1"|grep -i protodown protodown: off (n/a) protodown reasons: (uplinks-down) root@torm-11:mgmt:~# vtysh -c "show interface swp5"|grep -i protodown protodown: on protodown reasons: (uplinks-down) root@torm-11:mgmt:~# PS: Cosmetic changes only, no functional change. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Diffstat (limited to 'zebra/interface.c')
-rw-r--r--zebra/interface.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/zebra/interface.c b/zebra/interface.c
index ddad9c9e56..4072eb1568 100644
--- a/zebra/interface.c
+++ b/zebra/interface.c
@@ -1428,6 +1428,14 @@ const char *zebra_protodown_rc_str(enum protodown_reasons protodown_rc,
return pd_buf;
}
+static inline bool if_is_protodown_applicable(struct interface *ifp)
+{
+ if (IS_ZEBRA_IF_BOND(ifp))
+ return false;
+
+ return true;
+}
+
/* Interface's information print out to vty interface. */
static void if_dump_vty(struct vty *vty, struct interface *ifp)
{
@@ -1592,14 +1600,13 @@ static void if_dump_vty(struct vty *vty, struct interface *ifp)
}
zebra_evpn_if_es_print(vty, zebra_if);
- vty_out(vty, " protodown: %s",
- (zebra_if->flags & ZIF_FLAG_PROTODOWN) ? "on" : "off");
+ vty_out(vty, " protodown: %s %s\n",
+ (zebra_if->flags & ZIF_FLAG_PROTODOWN) ? "on" : "off",
+ if_is_protodown_applicable(ifp) ? "" : "(n/a)");
if (zebra_if->protodown_rc)
- vty_out(vty, " rc: %s\n",
+ vty_out(vty, " protodown reasons: %s\n",
zebra_protodown_rc_str(zebra_if->protodown_rc, pd_buf,
sizeof(pd_buf)));
- else
- vty_out(vty, "\n");
if (zebra_if->link_ifindex != IFINDEX_INTERNAL) {
if (zebra_if->link)