summaryrefslogtreecommitdiff
path: root/zebra/zebra_vty.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2020-09-18 15:47:27 -0400
committerDonald Sharp <sharpd@nvidia.com>2020-09-22 15:57:43 -0400
commit5a3cf85391b3665b5344d577e98aaa29a1927818 (patch)
tree3a741a61822632d23877cf37a9f25999dd482fe1 /zebra/zebra_vty.c
parent4c56ce1cead5f6514ea2af34f0b7a07c35746520 (diff)
lib, zebra: Add ability to read kernel notice of TRAP/OFFLOAD
The linux kernel is getting RTM_F_TRAP and RTM_F_OFFLOAD for kernel routes that have an underlying asic offload. Write the code to receive these notifications from the linux kernel and to store that data for display about the routes. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'zebra/zebra_vty.c')
-rw-r--r--zebra/zebra_vty.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c
index 3c360901b3..28c33a70fe 100644
--- a/zebra/zebra_vty.c
+++ b/zebra/zebra_vty.c
@@ -192,6 +192,14 @@ static char re_status_output_char(const struct route_entry *re,
star_p = true;
}
+ if (zrouter.asic_offloaded
+ && CHECK_FLAG(re->flags, ZEBRA_FLAG_TRAPPED))
+ return 't';
+
+ if (zrouter.asic_offloaded
+ && !CHECK_FLAG(re->flags, ZEBRA_FLAG_OFFLOADED))
+ return 'o';
+
if (star_p)
return '*';
else
@@ -862,6 +870,12 @@ static void vty_show_ip_route(struct vty *vty, struct route_node *rn,
if (CHECK_FLAG(re->status, ROUTE_ENTRY_QUEUED))
json_object_boolean_true_add(json_route, "queued");
+ if (CHECK_FLAG(re->flags, ZEBRA_FLAG_TRAPPED))
+ json_object_boolean_true_add(json_route, "trapped");
+
+ if (CHECK_FLAG(re->flags, ZEBRA_FLAG_OFFLOADED))
+ json_object_boolean_true_add(json_route, "offloaded");
+
if (re->tag)
json_object_int_add(json_route, "tag", re->tag);