Skip to content

Comments

Fix dash meter COUNTERS_DB keys to use VID instead of RID#1725

Merged
prsunny merged 1 commit intosonic-net:masterfrom
mukeshmv:meter_eni_vid
Jan 22, 2026
Merged

Fix dash meter COUNTERS_DB keys to use VID instead of RID#1725
prsunny merged 1 commit intosonic-net:masterfrom
mukeshmv:meter_eni_vid

Conversation

@mukeshmv
Copy link
Contributor

@mukeshmv mukeshmv commented Dec 10, 2025

Problem
All dash ENI meter class stats were incorrectly written to COUNTERS_DB using the RID instead of the VID as the keys for the switch and ENI oid.

Fix
Use the Switch and ENI VID in the COUNTER_DB keys for dash meter class.

sonic-db-cli COUNTERS_DB hgetall 'COUNTERS:{"switch_id":"oid:0x21000000000000","eni_id":"oid:0x700800000001c","meter_class":"89"}'
{'SAI_METER_BUCKET_ENTRY_STAT_INBOUND_BYTES': '0', 'SAI_METER_BUCKET_ENTRY_STAT_OUTBOUND_BYTES': '210'}

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@seveerap79
Copy link

@prabhataravind and @prsunny : Please can you review and approve this DASH Metering PR

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mukeshmv
Copy link
Contributor Author

@prabhataravind, can you rerun the sanity. Seems like a random failure

@prsunny prsunny requested a review from vivekrnv January 5, 2026 21:58
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

swss::Table countersTable(&pipeline, COUNTERS_TABLE, true);
for (const auto& object_key: it->second.object_keys) {
countersTable.del(sai_serialize_meter_bucket_entry(object_key.key.meter_bucket_entry));
auto meter_bucket_entry = object_key.key.meter_bucket_entry;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same functionality is repeated multiple times. Can we move this to a new method?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, addressed.

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Signed-off-by: mukeshmv <mukesh@pensando.io>
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

Cherry-pick PR to msft-202506: Azure/sonic-sairedis.msft#103

@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202511: #1750

@mssonicbld
Copy link
Collaborator

@mukeshmv cherry pick PR didn't pass PR checker. Please check!!!
#1750

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants