]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: Add kernel nexthop group support to `show zebra`
authorDonald Sharp <sharpd@nvidia.com>
Sat, 22 Jan 2022 12:53:24 +0000 (07:53 -0500)
committerDonald Sharp <sharpd@nvidia.com>
Fri, 4 Feb 2022 15:29:38 +0000 (10:29 -0500)
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
zebra/rt_netlink.c
zebra/zebra_router.h
zebra/zebra_vty.c

index 24c01b7f518b458ce12b89aa4f2cd1d88b1c91c2..2d12ad4c8e619370d6a164b87a107df403519999 100644 (file)
@@ -3027,11 +3027,12 @@ int netlink_nexthop_read(struct zebra_ns *zns)
                 * this kernel must support them.
                 */
                supports_nh = true;
-
        if (IS_ZEBRA_DEBUG_KERNEL || IS_ZEBRA_DEBUG_NHG)
                zlog_debug("Nexthop objects %ssupported on this kernel",
                           supports_nh ? "" : "not ");
 
+       zebra_router_set_supports_nhgs(supports_nh);
+
        return ret;
 }
 
index dd788216c77b75589500bc51c759caf8941ff53e..dafe925c26d4757a41f893aee5b93970c5482252 100644 (file)
@@ -209,6 +209,8 @@ struct zebra_router {
         */
        bool asic_offloaded;
        bool notify_on_ack;
+
+       bool supports_nhgs;
 };
 
 #define GRACEFUL_RESTART_TIME 60
@@ -256,6 +258,11 @@ extern enum multicast_mode multicast_mode_ipv4_get(void);
 
 extern bool zebra_router_notify_on_ack(void);
 
+static inline void zebra_router_set_supports_nhgs(bool support)
+{
+       zrouter.supports_nhgs = support;
+}
+
 /* zebra_northbound.c */
 extern const struct frr_yang_module_info frr_zebra_info;
 
index 073f1aa379f3050b33412edd1d21957382fe67b7..31064e55aa5b1564f79328e896378edc5404cdd8 100644 (file)
@@ -3991,6 +3991,9 @@ DEFUN (show_zebra,
        else
                vty_out(vty, "Asic offload is not being used\n");
 
+       vty_out(vty, "Kernel %ssupport Nexthop Groups\n",
+               zrouter.supports_nhgs ? "does " : "does not ");
+
        vty_out(vty,
                "                            Route      Route      Neighbor   LSP        LSP\n");
        vty_out(vty,