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

Do not enter vendor SAI critical section for counter polling/clearing operations #1450

Merged
merged 6 commits into from
Nov 6, 2024

Conversation

stephenxs
Copy link
Contributor

What I did

Do not enter the vendor SAI critical section for counter-polling/-clearing operations.

Why I did it

There are two types of threads in syncd:

  1. The syncd main thread in which the create/destroy/set/get SAI APIs are called
  2. Flex counter threads in which counter-polling/-clearing APIs are called

The critical section in vendor SAI was introduced to protect vendors' SAI from being re-entered, which prevents the flex counter threads from running concurrently, and introduces latency for one flex counter thread when it's waiting for the critical section.
It is not necessary to enter a section in counter-polling/clearing operations since the objects' state won't be changed in that API.

How I verified it

Run regression test and observe counter-polling performance.

Details if related

@kcudnik kcudnik merged commit 0317b16 into sonic-net:master Nov 6, 2024
18 checks passed
@stephenxs stephenxs deleted the rwlock-vendorsai branch November 6, 2024 09:08
shiraez pushed a commit to Marvell-switching/sonic-sairedis that referenced this pull request Dec 12, 2024
… operations (sonic-net#1450)

There are two types of threads in syncd:

The syncd main thread in which the create/destroy/set/get SAI APIs are called
Flex counter threads in which counter-polling/-clearing APIs are called
The critical section in vendor SAI was introduced to protect vendors' SAI from being re-entered, which prevents the flex counter threads from running concurrently, and introduces latency for one flex counter thread when it's waiting for the critical section.
It is not necessary to enter a section in counter-polling/clearing operations since the objects' state won't be changed in that API.
shiraez pushed a commit to Marvell-switching/sonic-sairedis that referenced this pull request Dec 12, 2024
… operations (sonic-net#1450)

There are two types of threads in syncd:

The syncd main thread in which the create/destroy/set/get SAI APIs are called
Flex counter threads in which counter-polling/-clearing APIs are called
The critical section in vendor SAI was introduced to protect vendors' SAI from being re-entered, which prevents the flex counter threads from running concurrently, and introduces latency for one flex counter thread when it's waiting for the critical section.
It is not necessary to enter a section in counter-polling/clearing operations since the objects' state won't be changed in that API.
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.

3 participants