[multi-asic] Add namespace support for show/config subinterface commands#4298
Open
william8545 wants to merge 6 commits intosonic-net:masterfrom
Open
[multi-asic] Add namespace support for show/config subinterface commands#4298william8545 wants to merge 6 commits intosonic-net:masterfrom
william8545 wants to merge 6 commits intosonic-net:masterfrom
Conversation
Signed-off-by: William Tsai <willtsai@nvidia.com>
Signed-off-by: William Tsai <willtsai@nvidia.com>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: William Tsai <willtsai@nvidia.com>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: William Tsai <willtsai@nvidia.com>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: William Tsai <willtsai@nvidia.com>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: William Tsai <willtsai@nvidia.com>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
oleksandrivantsiv
approved these changes
Feb 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What I did
Added multi-ASIC namespace support for
show subinterfaces statusandconfig subinterface (add | del)commands.On multi-ASIC platforms, subinterfaces belong to a specific ASIC namespace. Previously, these commands did not accept a namespace option, so they could only operate on the default (host) namespace. This change enables users to target a specific ASIC namespace when showing or configuring subinterfaces.
How I did it
config subinterface(config/main.py): Added-n/--namespaceoption to theconfig subinterfacegroup command. The namespace is required on multi-ASIC systems and is passed toConfigDBConnectorso that add/del operations target the correct per-ASIC config DB.show subinterfaces status(show/main.py): Added@multi_asic_click_optionsdecorator to inject the standard-n/--namespaceand-d/--displayoptions. These are forwarded to theintfutilscript.intfutil(scripts/intfutil): Updated the subinterface status display logic to:skip_display.show interfaces mpls(show/interfaces/__init__.py): Added a guard to skip subinterface entries (e.g.,Ethernet0.100) when iterating PORT table keys, preventingKeyErroron multi-ASIC systems where subinterface keys may appear alongside port keys.Command Reference (
doc/Command-Reference.md): Updated documentation forshow subinterfaces statusandconfig subinterface add/delto reflect the new namespace options, usage syntax, and multi-ASIC examples.Unit tests: Added comprehensive multi-ASIC unit tests in
tests/multi_asic_subintf_test.pycovering:show subinterfaces statuswith namespace filtering and "all" displayconfig subinterface add/delwith namespace for Ethernet and PortChannel parent interfaces (both long and short names)tests/mock_tables/asic0/andtests/mock_tables/asic1/for subinterface testingtests/conftest.pywith asetup_multi_asic_dbfixture for multi-ASIC DB initializationtests/multi_asic_intfutil_test.pywith subinterface status test casesHow to verify it
Previous command output (if the output of a command-line utility has changed)
New command output (if the output of a command-line utility has changed)
Single namespace query:
All namespaces (no
-noption on a multi-ASIC system):