[multi-ASIC] counterpoll flowcnt-route namespace-aware capability check#4604
Open
DavidZagury wants to merge 3 commits into
Open
[multi-ASIC] counterpoll flowcnt-route namespace-aware capability check#4604DavidZagury wants to merge 3 commits into
DavidZagury wants to merge 3 commits into
Conversation
Pass the namespace to exit_if_route_flow_counter_not_support() so the STATE_DB capability check queries the correct per-namespace instance instead of the hardcoded 127.0.0.1 address. Signed-off-by: david.zagury <davidza@nvidia.com>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
…r branches Pin the two SonicV2Connector paths in get_route_flow_counter_capability: namespace=None/'' uses host='127.0.0.1', namespace='asic0' uses unix socket with SonicDBConfig initialization. Signed-off-by: david.zagury <davidza@nvidia.com>
0d48105 to
3fe7c37
Compare
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
|
I already created PR #4586 . Why do we need another PR? |
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.
Pass the namespace to exit_if_route_flow_counter_not_support() so the STATE_DB capability check queries the correct per-namespace instance instead of the hardcoded 127.0.0.1 address.
What I did
Added multi-ASIC support for counterpoll flowcnt-route by making the route flow counter capability check namespace-aware.
How I did it
The flowcnt_route group in counterpoll/main.py already accepted a -n/--namespace option and connected to the correct per-namespace ConfigDB, but the capability check (exit_if_route_flow_counter_not_support) was still querying STATE_DB at the hardcoded address 127.0.0.1, ignoring the selected namespace.
Two changes were made:
How to verify it
Should check capability against the correct namespace STATE_DB
counterpoll flowcnt-route -n asic0 enable
counterpoll flowcnt-route -n asic1 enable
Single-ASIC / no namespace — backward-compatible behavior unchanged
counterpoll flowcnt-route enable
counterpoll flowcnt-route disable
counterpoll flowcnt-route interval 5000
Confirm that on a namespace where route flow counters are not supported, the command correctly exits with "Route flow counter is not supported on this platform" rather than silently succeeding or querying the wrong STATE_DB instance.
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)