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

[counters][202205] Improve performance by polling only configured ports buffer queue/pg counters #2474

Merged

Conversation

vadymhlushko-mlnx
Copy link
Contributor

@vadymhlushko-mlnx vadymhlushko-mlnx commented Sep 29, 2022

This reverts commit 8eea92e.
Signed-off-by: Vadym Hlushko vadymh@nvidia.com

commit 6f1199afc3458e526c26b5d7c498fdaf810fbaca
Author: Shlomi Bitton <shlomibi@nvidia.com>
Date:   Sun Jan 2 16:55:58 2022 +0000

Filter unconfigured ports buffers queue/pg counters configurations on init.
If no buffer configurations available, no counters will be created.
Allow creating/removing counters on runtime if buffer PG/Queue is created or removed.
New UT added to verify new flow.

Signed-off-by: Shlomi Bitton <shlomibi@nvidia.com>

Propagating sonic-swss/pull/2143 with resolved merge conflicts

Depends on:

sonic-utilities/pull/2239
sonic-utilities/pull/2406
sonic-mgmt/pull/6431

What I did
Currently, in SONiC all ports queue and pg counters are created by default with the max possible amount of counters.
This feature changes this behavior to poll only configured counters provided by the config DB BUFFER_PG and BUFFER_QUEUE tables.
If no tables are present in the DB, no counters will be created for ports.
Filter the unwanted queues/pgs returned by SAI API calls and skip the creation of these queue/pg counters.
Also, allow creating/removing counters on runtime if buffer PG/Queue is configured or removed.

Why I did it
Improve performance by filtering unconfigured queue/pg counters on init.

How I verified it
Check after enabling the counters, if configured counters are created in Counters DB according to the configurations.
Add/Remove buffer PG/Queue configurations and observe the corresponding counters created/removed accordingly.
New UT was added to verify this flow.

Details if related

@nazariig
Copy link
Collaborator

nazariig commented Oct 3, 2022

The fix for LGTM is available in master: #2475, need to cherry-pick to 202205

**Why I did it**
lgtm build process broken. This PR will fix it.
```
[2022-09-30 18:21:33] [build-stderr] In file included from defaultvalueprovider.cpp:10:
[2022-09-30 18:21:33] [build-stderr] defaultvalueprovider.h:8:10: fatal error: libyang/libyang.h: No such file or directory
[2022-09-30 18:21:33] [build-stderr]     8 | #include <libyang/libyang.h>
[2022-09-30 18:21:33] [build-stderr]       |          ^~~~~~~~~~~~~~~~~~~
[2022-09-30 18:21:33] [build-stderr] compilation terminated.
```

**How I verified it**
The lgtm.yml change does not take effect in this PR's checker. I manually test it https://lgtm.com/logs/19f4015aec3863d7d4e7d5667cbbc251efd1d0f4/lang:cpp
@liat-grozovik
Copy link
Collaborator

@prsunny as this was prev approved, can you please merge it now that all the tests are passing?

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.

5 participants