-
Notifications
You must be signed in to change notification settings - Fork 753
Improved show ip interface cli performance by listing only interfaces… #4103
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
base: master
Are you sure you want to change the base?
Conversation
… wih ip without affecting the exsting behavior
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
… wih ip without affecting the exsting behavior
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Tested the fix on a testbed ToR and the latency of 'show ip interface' has substantially gone down. Using "ip -o addr show" cmd helps considerably |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
kktheballer
left a comment
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.
Tested the PR on a DUT and verified that 'show ip interface' lag was brought down from indefinitely long to 9-13 seconds which is great (tested using a scale of 428 subinterfaces)
Improved show ip interface cli performance by listing only interfaces with ip, without affecting the existing behavior.
show ip interface was very slow at large scale because the code iterated all kernel netdevices and called netifaces.ifaddresses() per interface—even for L2-only ports without any IPs. With ~5k netdevices, this caused multi-minute runs or forced aborts.
What I did
Changed enumeration to only process interfaces that actually have IP addresses for the selected family.
Avoided per-iface sysfs reads (flags, carrier) unless the iface has at least one IP.
Kept CLI surface/output format and multi-ASIC behavior unchanged.
How I did it
Used ip -o -f inet|inet6 addr show to seed the set of (namespace, interface) that have addresses.
Built the BGP neighbor map as before; enriched rows only for those interfaces.
Read admin/oper/master state only for the filtered set.
Merged per-namespace results the same way as the original implementation.
How to verify it
time show ip interface > /dev/null (compute only)
time show ip interface | head (partial print)
time show ip interface (full print)
Expect ~4–12s depending on scale (previously minutes/aborts).
Previous command output (if the output of a command-line utility has changed)
No change
New command output (if the output of a command-line utility has changed)
No change