diff options
author | Chirag Shah <chirag@nvidia.com> | 2023-01-24 07:18:24 +0100 |
---|---|---|
committer | Chirag Shah <chirag@nvidia.com> | 2023-01-24 07:25:12 +0100 |
commit | 3cdb03fba7b40240fb38469a12b7b05a11043e09 (patch) | |
tree | c6cc5b4e99a18cf3e99566b596640313a367f471 /bgpd | |
parent | Merge pull request #12677 from opensourcerouting/fix/ospf_potential_memory_leak (diff) | |
download | frr-3cdb03fba7b40240fb38469a12b7b05a11043e09.tar.xz frr-3cdb03fba7b40240fb38469a12b7b05a11043e09.zip |
bgpd: evpn route detail json display non prett
For BGP evpn route table detail json to use
non pretty form of display.
Problem:
In scaled evpn route table detail json dump
occupies high resources (CPU + memory) of the system.
In high scale evpn route dump using pretty form
hogs CPU for a while which can trigger watchfrr
to kill bgpd.
Solution:
Avoid pretty JSON print for detail version dump
Signed-off-by: Chirag Shah <chirag@nvidia.com>
Diffstat (limited to 'bgpd')
-rw-r--r-- | bgpd/bgp_evpn_vty.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/bgpd/bgp_evpn_vty.c b/bgpd/bgp_evpn_vty.c index ca6f07940..3c7fb4cb1 100644 --- a/bgpd/bgp_evpn_vty.c +++ b/bgpd/bgp_evpn_vty.c @@ -4807,8 +4807,15 @@ DEFUN(show_bgp_l2vpn_evpn_route, evpn_show_all_routes(vty, bgp, type, json, detail); - if (uj) - vty_json(vty, json); + if (uj) { + if (detail) { + vty_out(vty, "%s\n", json_object_to_json_string(json)); + json_object_free(json); + } else { + vty_json(vty, json); + } + } + return CMD_SUCCESS; } |