From 7b8a4249ea9481ced4a5c29a7b5cacc0e3acb80d Mon Sep 17 00:00:00 2001 From: Mark Stapp Date: Fri, 1 Sep 2023 10:06:10 -0400 Subject: lib,zebra: add tx queuelen to interface struct Add the txqlen attribute to the common interface struct. Capture the value in zebra, and distribute it through the interface lib module's zapi messaging. Signed-off-by: Mark Stapp --- zebra/interface.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'zebra/interface.c') diff --git a/zebra/interface.c b/zebra/interface.c index 9ca330571f..5c01e64e0f 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -2060,6 +2060,7 @@ static void zebra_if_dplane_ifp_handling(struct zebra_dplane_ctx *ctx) ifp->metric = 0; ifp->speed = kernel_get_speed(ifp, NULL); ifp->ptm_status = ZEBRA_PTM_STATUS_UNKNOWN; + ifp->txqlen = dplane_ctx_get_intf_txqlen(ctx); /* Set interface type */ zebra_if_set_ziftype(ifp, zif_type, zif_slave_type); @@ -2142,6 +2143,7 @@ static void zebra_if_dplane_ifp_handling(struct zebra_dplane_ctx *ctx) set_ifindex(ifp, ifindex, zns); ifp->mtu6 = ifp->mtu = mtu; ifp->metric = 0; + ifp->txqlen = dplane_ctx_get_intf_txqlen(ctx); /* * Update interface type - NOTE: Only slave_type can @@ -2786,8 +2788,8 @@ static void if_dump_vty(struct vty *vty, struct interface *ifp) return; } - vty_out(vty, " index %d metric %d mtu %d speed %u ", ifp->ifindex, - ifp->metric, ifp->mtu, ifp->speed); + vty_out(vty, " index %d metric %d mtu %d speed %u txqlen %u", + ifp->ifindex, ifp->metric, ifp->mtu, ifp->speed, ifp->txqlen); if (ifp->mtu6 != ifp->mtu) vty_out(vty, "mtu6 %d ", ifp->mtu6); vty_out(vty, "\n flags: %s\n", if_flag_dump(ifp->flags)); @@ -3174,6 +3176,7 @@ static void if_dump_vty_json(struct vty *vty, struct interface *ifp, if (ifp->mtu6 != ifp->mtu) json_object_int_add(json_if, "mtu6", ifp->mtu6); json_object_int_add(json_if, "speed", ifp->speed); + json_object_int_add(json_if, "txqlen", ifp->txqlen); json_object_string_add(json_if, "flags", if_flag_dump(ifp->flags)); /* Hardware address. */ -- cgit v1.2.3