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

SONiC bulk counter support #1009

Merged
merged 3 commits into from Jun 23, 2022

Conversation

Junchao-Mellanox
Copy link
Contributor

@Junchao-Mellanox Junchao-Mellanox commented May 26, 2022

PR https://github.com/opencomputeproject/SAI/pull/1352/files introduced new SAI APIs that supports bulk stats:

  • sai_bulk_object_get_stats
  • sai_bulk_object_clear_stats

SONiC flex counter infrastructure shall utilize bulk stats API to gain better performance. This document discusses how to integrate these two new APIs to SONiC.

Related PRs:

PR title state context
[sonic-sairedis] Support bulk counter GitHub issue/pull request detail GitHub pull request check contexts


##### Statistic Collect

![Collect Counter Flow](/doc/bulk_counter/counter_collect.svg).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. If mode SAI_STATS_MODE_BULK_READ_AND_CLEAR is supported, call sai_bulk_object_get_stats is enough. I think it is equative to sai_bulk_object_get_stats(mode=BULK_READ) and then sai_bulk_object_clear_stats(mode=BULK_CLEAR).
  2. If not sucess after sai_bulk_object_get_stats or sai_bulk_object_clear_stats, why go to 'Old way'?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. yes, you are right
  2. we need keep backward compatible

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we fall back to old way?

@jimmyzhai
Copy link

For performance improvement, do you have any raw data in your prototype to estimate how much the gain is for bulk get vs get?

@jimmyzhai jimmyzhai requested a review from kcudnik June 14, 2022 06:44
@jimmyzhai
Copy link

@kcudnik please review it.

@Junchao-Mellanox
Copy link
Contributor Author

For performance improvement, do you have any raw data in your prototype to estimate how much the gain is for bulk get vs get?

Add a performance section to describe the performance improvement.

@liat-grozovik liat-grozovik merged commit d2c949f into sonic-net:master Jun 23, 2022
itamar-talmon pushed a commit to itamar-talmon/SONiC that referenced this pull request Oct 2, 2022
PR https://github.com/opencomputeproject/SAI/pull/1352/files introduced new SAI APIs that supports bulk stats:
sai_bulk_object_get_stats
sai_bulk_object_clear_stats
SONiC flex counter infrastructure shall utilize bulk stats API to gain better performance. This document discusses how to integrate these two new APIs to SONiC.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants