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

[DropCounter]Fix the ordering issue with dropcounter #3128

Merged
merged 1 commit into from
May 1, 2024

Conversation

dgsudharsan
Copy link
Collaborator

@dgsudharsan dgsudharsan commented Apr 30, 2024

Partially addresses the debug counter comment in sonic-net/sonic-buildimage#11798 (comment)
What I did
During the removal of drop counters, the counter is deleted first followed by removing it from flexcounter. This would result in a race condition where counterpoll might try to access the counter after it is deleted.

Apr 22 21:55:33.131134 r-panther-01 INFO python[125700]: ansible-command Invoked with _raw_params=config dropcounters delete TEST warn=True _uses_shell=False stdin_add_newline=True strip_empty_ends=True argv=None chdir=None executable=None creates=None removes=None stdin=None
Apr 22 21:55:33.611079 r-panther-01 NOTICE syncd#SDK: [SAI_DEBUG_COUNTER.NOTICE] ./src/mlnx_sai_debug_counter.c[1817]- mlnx_remove_debug_counter: Remove DEBUG_COUNTER [OID:0x300000055] [ID:0]
Apr 22 21:55:33.634416 r-panther-01 ERR syncd#SDK: [SAI_DEBUG_COUNTER.ERR] ./src/mlnx_sai_debug_counter.c[390]- mlnx_debug_counter_db_idx_to_data: Debug counter at index 0 is removed or not created yet
Apr 22 21:55:33.634416 r-panther-01 ERR syncd#SDK: :- collectData: Failed to get stats of Switch Debug Counter 0x100000021: -1
Apr 22 21:55:33.635328 r-panther-01 NOTICE swss#orchagent: :- uninstallDebugCounter: Successfully deleted drop counter TEST

Why I did it
To fix the error log appearing when drop counter is removed. The SAI object is removed during object destroy. Hence destroying the counter after flex counter is disabled.

DebugCounter::removeDebugCounterFromSAI();

How I verified it
The existing sonic-swss UT should verify the drop counters functionality.

Details if related

@dgsudharsan dgsudharsan merged commit 2e6c5b2 into sonic-net:master May 1, 2024
17 checks passed
@dgsudharsan
Copy link
Collaborator Author

@yxieca Can you please cherry-pick this fix to 202311?

@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202311: #3191

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