Skip to content

Commit

Permalink
Fix issues in clear_qos (sonic-net#2122)
Browse files Browse the repository at this point in the history
- What I did
Fix issues in clear_qos

1. Remove tables BUFFER_PORT_INGRESS_PROFILE_LIST and BUFFER_PORT_EGRESS_PROFILE_LIST
When clear_qos is executed, all QoS- and buffer-related tables should be removed. Currently, both tables are missed. This is to fix it.
2. Adjust the order in which the buffer and QoS tables are removed
Remove the tables whose entries depend on other tables first and then the tables whose entries are referenced by other tables.
Any object can be removed from SAI only if there is no object referencing it. There are retrying and dependency-tracking mechanisms to guarantee it in orchagent.
If CLI operates the table in an order where the referencing tables removed first before referenced tables, it is possible to reduce the probability to retry theoretically.
The order does not guarantee it but adjusting the order is almost zero-cost so we would like to do it.

- How I did it

- How to verify it

Signed-off-by: Stephen Sun stephens@nvidia.com
  • Loading branch information
stephenxs committed Apr 2, 2022
1 parent 6d3aa1e commit 51d3550
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions config/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -635,21 +635,23 @@ def _clear_cbf():

def _clear_qos():
QOS_TABLE_NAMES = [
'PORT_QOS_MAP',
'QUEUE',
'TC_TO_PRIORITY_GROUP_MAP',
'MAP_PFC_PRIORITY_TO_QUEUE',
'TC_TO_QUEUE_MAP',
'DSCP_TO_TC_MAP',
'MPLS_TC_TO_TC_MAP',
'SCHEDULER',
'PFC_PRIORITY_TO_PRIORITY_GROUP_MAP',
'PORT_QOS_MAP',
'WRED_PROFILE',
'QUEUE',
'CABLE_LENGTH',
'BUFFER_POOL',
'BUFFER_PROFILE',
'BUFFER_PG',
'BUFFER_QUEUE',
'BUFFER_PORT_INGRESS_PROFILE_LIST',
'BUFFER_PORT_EGRESS_PROFILE_LIST',
'BUFFER_PROFILE',
'BUFFER_POOL',
'DEFAULT_LOSSLESS_BUFFER_PARAMETER',
'LOSSLESS_TRAFFIC_PATTERN']

Expand Down

0 comments on commit 51d3550

Please sign in to comment.