From 51d3550d9192e4b751b96d4017cc79b0c91150e8 Mon Sep 17 00:00:00 2001 From: Stephen Sun <5379172+stephenxs@users.noreply.github.com> Date: Sat, 2 Apr 2022 14:58:03 +0800 Subject: [PATCH] Fix issues in clear_qos (#2122) - 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 --- config/main.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/config/main.py b/config/main.py index 1632ffd11402..ed38bcc8413b 100644 --- a/config/main.py +++ b/config/main.py @@ -635,6 +635,8 @@ 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', @@ -642,14 +644,14 @@ def _clear_qos(): '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']