]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: non pretty json output for evpn route 14076/head
authorSindhu Parvathi Gopinathan <sgopinathan@nvidia.com>
Wed, 19 Jul 2023 07:00:24 +0000 (00:00 -0700)
committerChirag Shah <chirag@nvidia.com>
Fri, 21 Jul 2023 17:15:25 +0000 (10:15 -0700)
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 <vni-id> detail json
show evpn vni detail json
```

Ticket:#3513256
Issue:3513256

Testing: UT done

Signed-off-by: Sindhu Parvathi Gopinathan's <sgopinathan@nvidia.com>
zebra/zebra_vxlan.c

index 5178448ebcbe3f1f87d34844ef67162c86213794..50a7462d89cc93d93aa540344700365d76e257bb 100644 (file)
@@ -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);
 }
 
 /*