Add multi-asic namespace support for crm show resources command#4290
Open
william8545 wants to merge 1 commit intosonic-net:masterfrom
Open
Add multi-asic namespace support for crm show resources command#4290william8545 wants to merge 1 commit intosonic-net:masterfrom
william8545 wants to merge 1 commit intosonic-net:masterfrom
Conversation
Signed-off-by: William Tsai <willtsai@nvidia.com>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
oleksandrivantsiv
approved these changes
Feb 20, 2026
Author
|
/azpw run |
Collaborator
|
/AzurePipelines run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
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 the
--namespace(-n) option to thecrm show resourcescommand. This allows users to query CRM resource usage and availability for a specific ASIC in a multi-ASIC environment.How I did it
@multi_asic_util.multi_asic_click_option_namespacedecorator to theresourcescommand group incrm/main.py.namespaceargument to the CRM context (ctx.obj["crm"].multi_asic.namespace_option).show_resources) already utilize the@multi_asic_util.run_on_multi_asicdecorator, simply setting thenamespace_optionallows the existing multi-ASIC framework to seamlessly handle database connections for the targeted ASIC.tests/crm_test.pyto ensure the-noption works correctly.How to verify it
Verify by running the
crm show resourcescommand with the-noption on a multi-ASIC device, and observing that only the specified ASIC's information is returned:crm show resources -n asic0 allcrm show resources -n asic0 fdbcrm show resources -n asic0 ipv4 routecrm show resources -n asic0 acl groupPrevious 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)