sonic-swss icon indicating copy to clipboard operation
sonic-swss copied to clipboard

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

Open vadymhlushko-mlnx opened this issue 3 years ago • 2 comments

This reverts commit 8eea92e7f57ac457cc5b4d8cd3e8d8c89e301872. Signed-off-by: Vadym Hlushko [email protected]

commit 6f1199afc3458e526c26b5d7c498fdaf810fbaca
Author: Shlomi Bitton <[email protected]>
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 <[email protected]>

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

vadymhlushko-mlnx avatar Sep 29 '22 07:09 vadymhlushko-mlnx

The fix for LGTM is available in master: https://github.com/sonic-net/sonic-swss/pull/2475, need to cherry-pick to 202205

nazariig avatar Oct 03 '22 09:10 nazariig

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

liat-grozovik avatar Oct 18 '22 09:10 liat-grozovik