Add v2r mapping for Switch Packet Integrity Drop counter#423
Merged
abdosi merged 1 commit intosonic-net:masterfrom Aug 26, 2025
Merged
Add v2r mapping for Switch Packet Integrity Drop counter#423abdosi merged 1 commit intosonic-net:masterfrom
abdosi merged 1 commit intosonic-net:masterfrom
Conversation
Contributor
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
6 tasks
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for the v2r mapping of the Switch Packet Integrity Drop counter by introducing new mapping files, updating the virtual DB translation functions, and extending unit tests.
- Adds mapping files that relate a switch identifier to its packet integrity drop OID.
- Updates the virtual database client and translation functions to support the new SWITCH* vpath.
- Extends unit tests to cover the new mapping and ensure proper response for both valid and invalid keys.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| testdata/COUNTERS_DEBUG_NAME_SWITCH_STAT_MAP.txt | New mapping file defining a switch-to-OID mapping. |
| testdata/COUNTERS:oid:0x21000000000000.txt | New mapping file for SAI_SWITCH_STAT_PACKET_INTEGRITY_DROP counter. |
| testdata/COUNTERS:SWITCH_wildcardasic0.txt | New asic-specific mapping file for switch wildcard queries. |
| testdata/COUNTERS:SWITCH_wildcard.txt | New mapping file for switch wildcard queries. |
| testdata/COUNTERS:SWITCH_ID.txt | New mapping file for switch keys with no asic appended. |
| sonic_data_client/virtual_db.go | Implements the v2r mapping logic for switch packet integrity drop counters. |
| sonic_data_client/db_client.go | Invokes new initialization for the switch stat mapping in the DB client. |
| gnmi_server/server_test.go | Extends tests to load and validate the new switch mapping configurations. |
Contributor
|
/azp run |
|
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command. |
Contributor
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
Author
|
@abdosi @zbud-msft please help review |
Contributor
|
@vmittal-msft , please resolve conflicts |
Signed-off-by: Suvarna Meenakshi <[email protected]>
b03660e to
6ad581d
Compare
Contributor
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
abdosi
approved these changes
Aug 26, 2025
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.
Porting Suvarna's PR - #376
Why I did it
Add v2r mapping to get SAI_SWITCH_STAT_PACKET_INTEGRITY_DROP counters for Chassis platform.
How I did it
Read COUNTERS_DEBUG_NAME_SWITCH_STAT_MAP to get OID and map to Counters so that telemetry can use "COUNTERS/SWITCH*" or "COUNTERS/SWITCH_ID" or "COUNTERS/SWITCH_ID-asic0" to get packet integrity drop counters.
How to verify it
Add unit-test:
Verify on Chassis:
Which release branch to backport (provide reason below if selected)
Description for the changelog
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)