From 920e571ed7b894d43f52712566e3436bd3ca349a Mon Sep 17 00:00:00 2001 From: Aravindu Maneti Date: Fri, 4 Oct 2019 00:18:01 -0700 Subject: [PATCH] [qosorch] Handle 'config qos clear' for queue, scheduler and wred in orchagent --- orchagent/qosorch.cpp | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/orchagent/qosorch.cpp b/orchagent/qosorch.cpp index 4e92275d79..e5e3bd8915 100644 --- a/orchagent/qosorch.cpp +++ b/orchagent/qosorch.cpp @@ -550,7 +550,7 @@ bool WredMapHandler::removeQosItem(sai_object_id_t sai_object) sai_status = sai_wred_api->remove_wred(sai_object); if (SAI_STATUS_SUCCESS != sai_status) { - SWSS_LOG_ERROR("Failed to remove scheduler profile, status:%d", sai_status); + SWSS_LOG_ERROR("Failed to remove wred profile, status:%d", sai_status); return false; } return true; @@ -1253,6 +1253,20 @@ task_process_status QosOrch::handleQueueTable(Consumer& consumer) SWSS_LOG_ERROR("Resolving scheduler reference failed"); return task_process_status::task_failed; } + else + { + /* config qos clear */ + if (op == DEL_COMMAND) + { + result = applySchedulerToQueueSchedulerGroup(port, queue_ind, SAI_NULL_OBJECT_ID); + if (!result) + { + SWSS_LOG_ERROR("Failed unbinding field:%s to port:%s, queue:%zd, line:%d", + scheduler_field_name.c_str(), port.m_alias.c_str(), queue_ind, __LINE__); + return task_process_status::task_failed; + } + } + } sai_object_id_t sai_wred_profile; resolve_result = resolveFieldRefValue(m_qos_maps, wred_profile_field_name, tuple, sai_wred_profile); @@ -1304,6 +1318,20 @@ task_process_status QosOrch::handleQueueTable(Consumer& consumer) return task_process_status::task_failed; } } + else + { + /* config qos clear */ + if (op == DEL_COMMAND) + { + result = applyWredProfileToQueue(port, queue_ind, SAI_NULL_OBJECT_ID); + if (!result) + { + SWSS_LOG_ERROR("Failed unbinding field:%s from port:%s, queue:%zd, line:%d", + wred_profile_field_name.c_str(), port.m_alias.c_str(), queue_ind, __LINE__); + return task_process_status::task_failed; + } + } + } } } SWSS_LOG_DEBUG("finished");