-
Notifications
You must be signed in to change notification settings - Fork 283
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
Optimize counter initialization by reducing the number of bulk counter poll calls and communication between swss/sairedis #1527
base: master
Are you sure you want to change the base?
Conversation
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
@@ -2618,6 +2819,171 @@ | |||
notifyPoll(); | |||
} | |||
|
|||
void FlexCounter::bulkAddCounter( |
Check notice
Code scanning / CodeQL
Irregular enum initialization Note
/azpw run |
/AzurePipelines run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
d2a613b
to
ad06ae8
Compare
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azpw run |
/AzurePipelines run |
Azure Pipelines successfully started running 1 pipeline(s). |
the failure is not relevant to the commits
|
syncd/FlexCounterManager.cpp
Outdated
SWSS_LOG_ENTER(); | ||
|
||
auto fc = getInstance(instanceId); | ||
sai_object_type_t objectType = VidManager::objectTypeQuery(vids[0]); // VID and RID will have the same object type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check if array is not empty and use .at()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed to .at(0)
but no need to check empty here.
it has already checked in the caller https://github.com/sonic-net/sonic-sairedis/pull/1527/files#diff-0f282bb4fdc70639e695cdafd322730eaa1c141b3b4e87ec0fda6e317f687017R2797
@@ -2791,49 +2791,95 @@ sai_status_t Syncd::processFlexCounterEvent( | |||
} | |||
|
|||
auto groupName = key.substr(0, delimiter); | |||
auto strVid = key.substr(delimiter + 1); | |||
auto strVids = key.substr(delimiter + 1); | |||
auto vidStringVector = swss::tokenize(strVids, ','); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like this changes from single vid to multiple, will here be possible compatibility issue ? for example newer swss and older syncd that will expect 1 vid only and crash on deserialize when it will receive multiple ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes but it doesn't look like a valid use case.
Swss depends on sairedis, which means sairedis can be newer but won't be older than swss.
What do you think?
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Stephen Sun <[email protected]>
Signed-off-by: Stephen Sun <[email protected]>
Signed-off-by: Stephen Sun <[email protected]>
Signed-off-by: Stephen Sun <[email protected]>
Signed-off-by: Stephen Sun <[email protected]>
Signed-off-by: Stephen Sun <[email protected]>
Signed-off-by: Stephen Sun <[email protected]>
Signed-off-by: Stephen Sun <[email protected]>
Signed-off-by: Stephen Sun <[email protected]>
Signed-off-by: Stephen Sun <[email protected]>
1. add more comments 2. change function name 3. reduce log severity to DEBUG for counter polling to avoid rate limit Signed-off-by: Stephen Sun <[email protected]>
Signed-off-by: Stephen Sun <[email protected]>
Signed-off-by: Stephen Sun <[email protected]>
Signed-off-by: Stephen Sun <[email protected]>
Signed-off-by: Stephen Sun <[email protected]>
Signed-off-by: Stephen Sun <[email protected]>
Signed-off-by: Stephen Sun <[email protected]>
…ed by bulk call Signed-off-by: Stephen Sun <[email protected]>
Signed-off-by: Stephen Sun <[email protected]>
Signed-off-by: Stephen Sun <[email protected]>
Signed-off-by: Stephen Sun <[email protected]>
…ithout plugin Signed-off-by: Stephen Sun <[email protected]>
Signed-off-by: Stephen Sun <[email protected]>
add a map to simplify bulkAddCounter and addCounter fix issue that bulkAddCounter isn't supported by attr counter Signed-off-by: Stephen Sun <[email protected]>
Signed-off-by: Stephen Sun <[email protected]>
11034f3
to
fe9a9be
Compare
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Optimize counter initialization by reducing the number of bulk counter poll calls and communication between swss/sairedis for the following counter groups
HLD sonic-net/SONiC#1862