-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bgpd: show json output changes to optimize various show commands #17431
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please write a topotest to verify this new CLI command + documentation.
c32f90a
to
b2af790
Compare
Introduced JSON support of "show bgp router" command VTY: mlx-3700-19# show bgp router BGP started gracefully at Tue Nov 14 21:18:34 2023 Graceful restart completed at Tue Nov 14 21:18:37 2023 Number of BGP instances (including default): 1 JSON: mlx-3700-19# show bgp router json { "bgpStartedAt":"Tue Nov 14 21:18:34 2023\n", "bgpStartedGracefully":"Yes", "grComplete":"Yes", "grCompletedAt":"Tue Nov 14 21:18:37 2023\n", "bgpInMaintenanceMode":"No", "bgpInstanceCount":1 } Issue:3624937 Signed-off-by: Pooja Jagadeesh Doijode <pdoijode@nvidia.com>
Json object could lead to out-of-memory in scaled bgp l2vpn evpn route setup. Changes: - not use pretty print and stringify smaller json objects to reduce memory usage - free memory after ouput of json_rd - minor formatting of json output Commands supported with this Json stringify: show bgp l2vpn evpn route detail json show bgp l2vpn evpn route detail type 2 json show bgp l2vpn evpn route detail type 2 self-originate json show bgp l2vpn evpn route detail self-originate json show bgp l2vpn evpn route json show bgp l2vpn evpn route type 2 json show bgp l2vpn evpn route type 2 self-originate json show bgp l2vpn evpn route self-originate json Ticket:#3513249 Issue:3513249 Signed-off-by: Ashwini Reddy <ashred@nvidia.com> Signed-off-by: Sindhu Parvathi Gopinathan's <sgopinathan@nvidia.com>
cc3769b
to
819db39
Compare
Please fix frrbot yet. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still, the documentation is missing for this new CLI command.
6c0726e
to
631ba8f
Compare
Done |
Lots of failed existing tests? |
631ba8f
to
3acfbc8
Compare
JSON object could lead to out-of-memory in scaled bgp neighbors received-routes/advertised-routes setup. Changes: not use pretty print and stringify smaller json objects to reduce memory usage free memory after ouput of json object Commands supported with this Json stringify: ``` show bgp vrf <vrf-id> neighbors <nbr-id> advertised-routes json show bgp vrf <vrf-id> neighbors <nbr-id> advertised-routes detail json show bgp vrf <vrf-id> neighbors <nbr-id> advertised-routes <prefix> json show bgp vrf <vrf-id> neighbors <nbr-id> received-routes json show bgp vrf <vrf-id> neighbors <nbr-id> received-routes detail json show bgp vrf <vrf-id> neighbors <nbr-id> received-routes <prefix> json ``` Ticket:#3513253, #3513254 Issue:3513253, 3513254 Signed-off-by: Sindhu Parvathi Gopinathan's <sgopinathan@nvidia.com>
Issue: 3576989 Ticket# 3576989 Signed-off-by: Sindhu Parvathi Gopinathan's <sgopinathan@nvidia.com> Signed-off-by: Ashwini Reddy's <ashred@nvidia.com>
This commit has changes to validate show bgp router json command Signed-off-by: Krishnasamy R <krishnasamyr@nvidia.com>
Signed-off-by: Krishnasamy R <krishnasamyr@nvidia.com>
3acfbc8
to
4d8207c
Compare
Fixed the json format issue |
CI:rerun |
if (json) | ||
if (json) { | ||
if (first) { | ||
vty_out(vty, "\"%s\":", rd_str); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused by these literal json outputs: why do we want to hard-code these kinds of components in the output? if we're not managing the json object hierarchy correctly, I'd rather we fix that than stick some hard-coded tokens in the output like this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of the parameters were identified to stringify them in the output so that the overall memory consumption is reduced when the json command was executed in a high scale setup.
Hi @ton31337, This is taken care. Please take a look! |
This PR includes multiple commits that optimize the show json output for various BGP show commands in scaled setup.