Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FC] Fix the update failure in switch debug counters #1556

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

vivekrnv
Copy link
Contributor

DropCouter updates are not honoured and only the first counter is polled.

Steps to repro:

config dropcounters install COUNTER_SMAC_MULTICAST SWITCH_INGRESS_DROPS [SMAC_MULTICAST]
config dropcounters install COUNTER_SMAC_EQUALS_DMAC SWITCH_INGRESS_DROPS [SMAC_EQUALS_DMAC]

Observed Behavior:

sonic-db-cli COUNTERS_DB hgetall "COUNTERS_DEBUG_NAME_SWITCH_STAT_MAP"
{'COUNTER_SMAC_MULTICAST': 'SAI_SWITCH_STAT_IN_CONFIGURED_DROP_REASONS_0_DROPPED_PKTS', 'COUNTER_SMAC_EQUALS_DMAC': 'SAI_SWITCH_STAT_IN_CONFIGURED_DROP_REASONS_1_DROPPED_PKTS'}

<Only the first counter is being polled, others are not honored>
sonic-db-cli COUNTERS_DB hgetall "COUNTERS:oid:0x21000000000000"
{'SAI_SWITCH_STAT_IN_CONFIGURED_DROP_REASONS_0_DROPPED_PKTS': '0'}
<After the Fix:>
sonic-db-cli COUNTERS_DB hgetall "COUNTERS:oid:0x21000000000000"
{'SAI_SWITCH_STAT_IN_CONFIGURED_DROP_REASONS_0_DROPPED_PKTS': '0', 'SAI_SWITCH_STAT_IN_CONFIGURED_DROP_REASONS_1_DROPPED_PKTS': '0'}

Happening because map.emplace on an existing object is a no-op

@mssonicbld
Copy link
Collaborator

/azp run

@vivekrnv vivekrnv requested a review from stephenxs March 14, 2025 15:06
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@stephenxs stephenxs requested a review from kcudnik March 14, 2025 15:11
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.

4 participants