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

Support per buffer pool watermark polling mode #973

Merged
merged 7 commits into from
Jul 25, 2019

Conversation

wendani
Copy link
Contributor

@wendani wendani commented Jul 12, 2019

What I did

Buffer pool watermark design is built on a READ_AND_CLEAR polling mode at the syncd level. We observe some SAI implementation is missing the clear_stats operation support for buffer pool watermark, either simply not coded yet or having hardware limitation. In such cases, we have mismatch between the actual polling behavior and what a user perceives from FLEX_COUNTER_DB read from FLEX_COUNTER_GROUP_TABLE.

To have a consistent view, we propose per buffer pool watermark stats polling mode at the orchagent level when not all buffer pools support clear_stats operation on a switch. The situation is detected by issuing clear_stats operation at the orchagent level to probe the capability over all pools first. If this is truly the case, we then do not set "STATS_MODE" field in "FLEX_COUNTER_GROUP_TABLE:BUFFER_POOL_WATERMARK_STAT_COUNTER", but set it to the per buffer pool table "FLEX_COUNTER_TABLE:BUFFER_POOL_WATERMARK_STAT_COUNTER:oid:<buffer_pool_oid>".

Why I did it

How I verified it
Tested on dut

127.0.0.1:6379[5]> hgetall "FLEX_COUNTER_TABLE:BUFFER_POOL_WATERMARK_STAT_COUNTER:oid:0x180000000005f3"
1) "BUFFER_POOL_COUNTER_ID_LIST"
2) "SAI_BUFFER_POOL_STAT_WATERMARK_BYTES"
3) "STATS_MODE"
4) "STATS_MODE_READ_AND_CLEAR"
127.0.0.1:6379[5]> hgetall "FLEX_COUNTER_TABLE:BUFFER_POOL_WATERMARK_STAT_COUNTER:oid:0x180000000005f4"
1) "BUFFER_POOL_COUNTER_ID_LIST"
2) "SAI_BUFFER_POOL_STAT_WATERMARK_BYTES"
3) "STATS_MODE"
4) "STATS_MODE_READ_AND_CLEAR"
127.0.0.1:6379[5]> hgetall "FLEX_COUNTER_TABLE:BUFFER_POOL_WATERMARK_STAT_COUNTER:oid:0x180000000005f5"
1) "BUFFER_POOL_COUNTER_ID_LIST"
2) "SAI_BUFFER_POOL_STAT_WATERMARK_BYTES"
3) "STATS_MODE"
4) "STATS_MODE_READ"
"FLEX_COUNTER_GROUP_TABLE:BUFFER_POOL_WATERMARK_STAT_COUNTER"
1) "BUFFER_POOL_PLUGIN_LIST"
2) "ca4aef2fce419033b7cd2ca9c787753198880af3"
3) "POLL_INTERVAL"
4) "10000"
5) "FLEX_COUNTER_STATUS"
6) "enable"
$ redis-cli -n 2 hgetall "COUNTERS_BUFFER_POOL_NAME_MAP"
1) "egress_lossless_pool"
2) "oid:0x180000000005f3"
3) "egress_lossy_pool"
4) "oid:0x180000000005f4"
5) "ingress_lossless_pool"
6) "oid:0x180000000005f5"
$ watermarkstat -t buffer_pool
Shared pool maximum occupancy:
                 Pool    Bytes
---------------------  -------
 egress_lossless_pool  1073904
    egress_lossy_pool        0
ingress_lossless_pool  1018160

Details if related

Depend on: sonic-net/sonic-sairedis#485

Signed-off-by: Wenda Ni <wenni@microsoft.com>
Signed-off-by: Wenda Ni <wenni@microsoft.com>
Signed-off-by: Wenda Ni <wenni@microsoft.com>
Signed-off-by: Wenda Ni <wenni@microsoft.com>
Signed-off-by: Wenda Ni <wenni@microsoft.com>
@wendani wendani requested a review from haseebniaz July 12, 2019 22:00
Signed-off-by: Wenda Ni <wenni@microsoft.com>
Signed-off-by: Wenda Ni <wenni@microsoft.com>
@wendani wendani requested a review from qiluo-msft July 16, 2019 00:44
@kcudnik
Copy link
Contributor

kcudnik commented Jul 24, 2019

test this please

@lguohan
Copy link
Contributor

lguohan commented Jul 25, 2019

retest this please

@lguohan lguohan merged commit ab8fead into sonic-net:master Jul 25, 2019
tonytitus pushed a commit to tonytitus/sonic-swss that referenced this pull request Jul 31, 2019
Buffer pool watermark design is built on a READ_AND_CLEAR polling mode at the syncd level. We observe some SAI implementation is missing the clear_stats operation support for buffer pool watermark, either simply not coded yet or having hardware limitation. In such cases, we have mismatch between the actual polling behavior and what a user perceives from FLEX_COUNTER_DB read from FLEX_COUNTER_GROUP_TABLE.

To have a consistent view, we propose per buffer pool watermark stats polling mode at the orchagent level when not all buffer pools support clear_stats operation on a switch. The situation is detected by issuing clear_stats operation at the orchagent level to probe the capability over all pools first. If this is truly the case, we then do not set "STATS_MODE" field in "FLEX_COUNTER_GROUP_TABLE:BUFFER_POOL_WATERMARK_STAT_COUNTER", but set it to the per buffer pool table "FLEX_COUNTER_TABLE:BUFFER_POOL_WATERMARK_STAT_COUNTER:oid:<buffer_pool_oid>".
antony-rheneus pushed a commit to antony-rheneus/sonic-swss that referenced this pull request Aug 1, 2019
Buffer pool watermark design is built on a READ_AND_CLEAR polling mode at the syncd level. We observe some SAI implementation is missing the clear_stats operation support for buffer pool watermark, either simply not coded yet or having hardware limitation. In such cases, we have mismatch between the actual polling behavior and what a user perceives from FLEX_COUNTER_DB read from FLEX_COUNTER_GROUP_TABLE.

To have a consistent view, we propose per buffer pool watermark stats polling mode at the orchagent level when not all buffer pools support clear_stats operation on a switch. The situation is detected by issuing clear_stats operation at the orchagent level to probe the capability over all pools first. If this is truly the case, we then do not set "STATS_MODE" field in "FLEX_COUNTER_GROUP_TABLE:BUFFER_POOL_WATERMARK_STAT_COUNTER", but set it to the per buffer pool table "FLEX_COUNTER_TABLE:BUFFER_POOL_WATERMARK_STAT_COUNTER:oid:<buffer_pool_oid>".
EdenGri pushed a commit to EdenGri/sonic-swss that referenced this pull request Feb 28, 2022
**- What I did**
Support dynamic buffer calculation

**- How I did it**
1. Commands added:
    •	config interface buffer priority-group lossless <add|set|remove>
    •	config interface buffer priority-group lossless add <port> <PG> [headroom-override-profile] for adding the PG for
        the first time providing option headroom-override-profile means to configure the PG as headroom override 
        otherwise as dynamically calculated headroom
    •	config interface buffer priority-group lossless set <port> <PG> [headroom-override-profile] for modifying an existing 
        PG, the option headroom-override-profile has the same meaning as "add"
    •	config interface buffer priority-group lossless remove <port> [PG] for removing the PG specified by option PG. If the 
        option isn't provided, all lossless PGs on the port will be removed
    •	config buffer-profile <add|set|remove> to add, modify or remove buffer profiles
    •	show buffer <configuration|information>
2. db_migrator:
    •	migrate CONFIG_DB from old approach to the new approach 
    •	when system warm starts from old image to the new one, copies related tables from CONFIG_DB to APPL_DB  for the 
        purpose that buffermgrd can start smoothly
3. Warm-reboot script: don't clear BUFFER_MAX_PARAM table across warm reboot
4. CLI reference is also provided

**- How to verify it**

**- Previous command output (if the output of a command-line utility has changed)**

**- New command output (if the output of a command-line utility has changed)**
oleksandrivantsiv pushed a commit to oleksandrivantsiv/sonic-swss that referenced this pull request Mar 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants