From: Sindhu Parvathi Gopinathan Date: Wed, 19 Jul 2023 07:00:24 +0000 (-0700) Subject: zebra: non pretty json output for evpn route X-Git-Tag: base_9.1~214^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=fadf87f358e90abddf17c1196e3c70df32127049;p=mirror%2Ffrr.git zebra: non pretty json output for evpn route Currently, json output of evpn route command are no pretty format. This is an extremely expensive operation at high VNI scale EVPN json non-pretty command support added: ``` show evpn mac vni detail json show evpn vni detail json ``` Ticket:#3513256 Issue:3513256 Testing: UT done Signed-off-by: Sindhu Parvathi Gopinathan's --- diff --git a/zebra/zebra_vxlan.c b/zebra/zebra_vxlan.c index 5178448ebc..50a7462d89 100644 --- a/zebra/zebra_vxlan.c +++ b/zebra/zebra_vxlan.c @@ -3229,7 +3229,11 @@ void zebra_vxlan_print_macs_vni(struct vty *vty, struct zebra_vrf *zvrf, if (use_json) { json_object_object_add(json, "macs", json_mac); - vty_json(vty, json); + /* + * This is an extremely expensive operation at scale + * and non-pretty reduces memory footprint significantly. + */ + vty_json_no_pretty(vty, json); } } @@ -4014,8 +4018,12 @@ void zebra_vxlan_print_vnis_detail(struct vty *vty, struct zebra_vrf *zvrf, void *))zl3vni_print_hash_detail, &zes); + /* + * This is an extremely expensive operation at scale + * and non-pretty reduces memory footprint significantly. + */ if (use_json) - vty_json(vty, json_array); + vty_json_no_pretty(vty, json_array); } /*