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:
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.
How I verified it
Run regression test and observe counter-polling performance.
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:
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