Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adjust design according to internal comments
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen Sun <stephens@nvidia.com>
stephenxs committed Aug 4, 2021
1 parent 0726f31 commit 78da8fe
Showing 12 changed files with 32 additions and 392 deletions.
Binary file not shown.
Binary file modified doc/qos/reclaim-reserved-buffer-images/dynamic-new.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/qos/reclaim-reserved-buffer-images/normal.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -67,44 +67,6 @@ sequenceDiagram
sonic cfggen ->>- CLI: Finish
```

```mermaid
%Deploy lossy PGs flow
sequenceDiagram
participant script
participant DATABASE
rect rgb(255, 0, 0)
loop for each active port
script ->>+ DATABASE: Get lanes
DATABASE ->>- script: Result
alt there are 8 lanes on the port
script ->> DATABASE: Create lossy PG for the port, using lossy profile for 8 lanes (reserved size doubled)
else there are 1, 2, or 4 lanes on the port
script ->> DATABASE: Create lossy PG for the port, using normal lossy profile
end
end
end
```

```mermaid
%System start
sequenceDiagram
participant swss
participant SAI
participant SDK
CLI ->> swss: Start swss, syncd and other services
CLI ->>- User: finish
Note over swss, SDK: Unrelated calls omitted
loop for each port
swss ->> SAI: sai_port_api->create_port
SAI ->> SDK: Create port
rect rgb(0, 128, 255)
loop for each buffer objects created by SDK
SAI ->> SDK: Set reserved size to 0
end
end
end
```

```mermaid
%Normal flow
sequenceDiagram
@@ -118,11 +80,7 @@ sequenceDiagram
DATABASE ->> buffer manager: Update notification
alt Handle the case port is admin-down
rect rgb(255, 0, 255)
alt Zero buffer profile exists (Mellanox approach)
buffer manager ->> DATABASE: Create buffer PG with zero buffer profile and push them into BUFFER_PG
else Non zero buffer profile exist (Other vendors)
buffer manager ->> DATABASE: Finish (do nothing)
end
buffer manager ->> DATABASE: Remove lossless buffer PG
end
else
opt cable length or speed is not configured
@@ -205,159 +163,6 @@ sequenceDiagram
buffer orch ->>- DATABASE: Finish
```

```mermaid
%Startup SAI flow
sequenceDiagram
participant User
participant DATABASE
participant port manager
participant ports orch
participant SAI
participant SDK
User ->> DATABASE: Startup a port
DATABASE ->> port manager: Update notification
port manager ->> DATABASE: Update APPL_DB.PORT.admin_status
DATABASE ->>+ ports orch: Update notification
Note over ports orch, SAI: attr.id = SAI_PORT_ATTR_ADMIN_STATE
Note over ports orch, SAI: attr.value.booldata = whether the admin state is up
ports orch ->>+ SAI: sai_port_api->set_port_attribute(port, attr)
rect rgb(0, 128, 255)
alt Port state is admin up
SAI ->>+ SDK: Set headroom size of management PG to the original value
else
SAI ->>+ SDK: Set headroom size of management PG to 0
end
SDK ->>- SAI: Finish
end
SAI ->>- ports orch: Finish
ports orch ->>- DATABASE: Finish
```

```mermaid
%Shutdown flow
sequenceDiagram
participant User
participant DATABASE
participant buffer manager
participant buffer orch
participant SAI
participant SDK
User ->> DATABASE: Shutdown a port
DATABASE ->> buffer manager: Update notification
rect rgb(0, 255, 0)
buffer manager ->> DATABASE: Remove the buffer PG 3-4
end
DATABASE ->>+ buffer orch: Update notification
rect rgb(0, 255, 0)
loop for each priority-group in the list [3, 4]
Note over buffer orch, SAI: attr.id = SAI_INGRESS_PRIORITY_GROUP_ATTR_BUFFER_PROFILE
Note over buffer orch, SAI: attr.value.oid = SAI_NULL_OBJECT_ID;
buffer orch ->>+ SAI: sai_buffer_api->set_ingress_priority_group_attribute(attr)
rect rgb(255, 255, 255)
SAI ->>+ SDK: Set headroom size of PG to 0
SDK ->>- SAI: Finish
end
SAI ->>- buffer orch: Finish
end
end
buffer orch ->>- DATABASE: Finish```
```mermaid
%remove queue flow
sequenceDiagram
participant User
participant DATABASE
participant buffer orch
participant SAI
participant SDK
User ->> DATABASE: Remove the BUFFER_QUEUE entry of the port
DATABASE ->>+ buffer orch: Update notification
rect rgb(0, 255, 0)
loop for each queue in the list
Note over buffer orch, SAI: attr.id = SAI_QUEUE_ATTR_BUFFER_PROFILE_ID
Note over buffer orch, SAI: attr.value.oid = SAI_NULL_OBJECT_ID;
buffer orch ->>+ SAI: sai_queue_api->set_queue_attribute(queue_id, &attr)
rect rgb(255, 255, 255)
SAI ->>+ SDK: Set reserved size of queue to 0
SDK ->>- SAI: Finish
end
SAI ->>- buffer orch: Finish
end
end
buffer orch ->>- DATABASE: Finish
```

```mermaid
%remove profile list flow
sequenceDiagram
participant User
participant DATABASE
participant buffer orch
participant SAI
participant SDK
User ->> DATABASE: Remove BUFFER_PORT_INGRESS/EGRESS_PROFILE_LIST
DATABASE ->>+ buffer orch: Update notification
rect rgb(0, 255, 0)
Note over buffer orch, SAI: attr.id = SAI_PORT_ATTR_QOS_INGRESS/EGRESS_BUFFER_PROFILE_LIST
Note over buffer orch, SAI: attr.value.objlist.list = [SAI_NULL_OBJECT_ID]
buffer orch ->>+ SAI: sai_port_api->set_port_attribute(port.m_port_id, &attr)
rect rgb(0, 128, 255)
loop for each port buffer pool originally in the list
SAI ->>+ SDK: Set reserved size of the port buffer pool to 0
SDK ->>- SAI: Finish
end
end
SAI ->>- buffer orch:
end
buffer orch ->>- DATABASE: Finish
```

```mermaid
%Recalculate buffer pool flow
sequenceDiagram
participant User
participant DATABASE
participant buffer orch
participant SAI
participant SDK
User ->> User: Recalculate buffer pool and shared headroom pool size
User ->> DATABASE: Set buffer pool size and shared headroom pool size
DATABASE ->>+ buffer orch: Update notification
Note over buffer orch, SAI: attr.id = SAI_BUFFER_POOL_ATTR_SIZE attr.value.u64 = size of shared buffer pool
opt ingress_lossless_pool?
Note over buffer orch, SAI: attr.id = SAI_BUFFER_POOL_ATTR_XOFF_SIZE attr.value.u64 = size of shared headroom pool
end
buffer orch ->>+ SAI: sai_buffer_api->set_buffer_pool_attribute
SAI ->>+ SDK: Set the buffer pool size and shared headroom pool size accordingly
SDK ->>- SAI: Finish
SAI ->>- buffer orch: Finish
buffer orch ->>- DATABASE: Finish
```

```mermaid
%Shutdown SAI flow
sequenceDiagram
participant User
participant DATABASE
participant port manager
participant ports orch
participant SAI
participant SDK
User ->> DATABASE: Shutdown a port
DATABASE ->> port manager: Update notification
port manager ->> DATABASE: Update APPL_DB.PORT.admin_status
DATABASE ->>+ ports orch: Update notification
Note over ports orch, SAI: attr.id = SAI_PORT_ATTR_ADMIN_STATE
Note over ports orch, SAI: attr.value.booldata = false;
ports orch ->>+ SAI: sai_port_api->set_port_attribute(port, attr)
rect rgb(0, 128, 255)
SAI ->>+ SDK: Set headroom size of management PG to 0
SDK ->>- SAI: Finish
end
SAI ->>- ports orch: Finish
ports orch ->>- DATABASE: Finish
```

```mermaid
%Dynamic-original-flow
sequenceDiagram
@@ -392,14 +197,12 @@ sequenceDiagram
User ->> CONFIG_DB: Shutdown the port
CONFIG_DB ->> buffer manager: Update notification
rect rgb(255, 0, 255)
opt zero buffer solution supported
opt zero buffer profiles NOT exist
buffer manager ->> APPL_DB: Create zero buffer profiles
end
opt zero buffer profiles NOT exist
buffer manager ->> APPL_DB: Create zero buffer profiles
end
buffer manager ->> buffer manager: Fetch the zero buffer profile on ingress side
loop for each buffer PG object on the port
alt zero buffer profiles exist
alt lossy priority-group
buffer manager ->> APPL_DB: set the profile of the PG to corresponding zero buffer profile in BUFFER_PG
else
rect rgb(255, 255, 255)
@@ -409,25 +212,15 @@ sequenceDiagram
end
buffer manager ->> buffer manager: Fetch the zero buffer profile on egress side
loop for each buffer queue object on the port
alt zero buffer profiles exist
buffer manager ->> APPL_DB: set the profile of the queue to corresponding zero buffer profile in BUFFER_QUEUE
else
rect rgb(255, 255, 255)
buffer manager ->> APPL_DB: Remove the buffer item from BUFFER_QUEUE
end
end
end
opt zero buffer profiles exist
alt ingress_lossy_pool exists
buffer manager ->> buffer manager: set ingress zero profile list to [ingress_zero_lossless_profile, ingress_zero_lossy_profile]
else
buffer manager ->> buffer manager: set ingress zero profile list to [ingress_zero_lossless_profile]
end
buffer manager ->> APPL_DB: set the profile_list of the port to egress zero buffer profile list in BUFFER_PORT_INGRESS_PROFILE_LIST
end
opt zero buffer profiles exist
buffer manager ->> buffer manager: set egress zero profile list to [egress_zero_lossless_profile, egress_zero_lossy_profile]
buffer manager ->> APPL_DB: set the profile_list of the port to egress zero buffer profile list in BUFFER_PORT_EGRESS_PROFILE_LIST
alt ingress_lossy_pool exists
buffer manager ->> buffer manager: set ingress zero profile list to [ingress_zero_lossless_profile, ingress_zero_lossy_profile]
else
buffer manager ->> buffer manager: set ingress zero profile list to [ingress_zero_lossless_profile]
end
buffer manager ->> APPL_DB: set the profile_list of the port to egress zero buffer profile list in BUFFER_PORT_INGRESS_PROFILE_LIST
buffer manager ->> buffer manager: set egress zero profile list to [egress_zero_lossless_profile, egress_zero_lossy_profile]
buffer manager ->> APPL_DB: set the profile_list of the port to egress zero buffer profile list in BUFFER_PORT_EGRESS_PROFILE_LIST
end
```
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
195 changes: 21 additions & 174 deletions doc/qos/reclaim-reserved-buffer.md

Large diffs are not rendered by default.

0 comments on commit 78da8fe

Please sign in to comment.