From 5c6a0ca19c76fdef539fc1bea19a76fe7a353795 Mon Sep 17 00:00:00 2001 From: Divya Mukundan Date: Tue, 21 Feb 2023 17:07:58 +0000 Subject: [PATCH] scheduler config fix for non-hierarchical qos chips --- orchagent/qosorch.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/orchagent/qosorch.cpp b/orchagent/qosorch.cpp index 515d591e00..e8a586f39d 100644 --- a/orchagent/qosorch.cpp +++ b/orchagent/qosorch.cpp @@ -1590,9 +1590,19 @@ bool QosOrch::applySchedulerToQueueSchedulerGroup(Port &port, size_t queue_ind, attr.value.oid = scheduler_profile_id; sai_status = sai_scheduler_group_api->set_scheduler_group_attribute(group_id, &attr); + if (SAI_STATUS_NOT_SUPPORTED != sai_status) + { + /* On some chips, hierarchical scheduler configuration may not be supported. + * Let's try configuring at the queue level */ + attr.id = SAI_QUEUE_ATTR_SCHEDULER_PROFILE_ID; + sai_status = sai_queue_api->set_queue_attribute(queue_id, &attr); + } + if (SAI_STATUS_SUCCESS != sai_status) { - SWSS_LOG_ERROR("Failed applying scheduler profile:0x%" PRIx64 " to scheduler group:0x%" PRIx64 ", port:%s", scheduler_profile_id, group_id, port.m_alias.c_str()); + SWSS_LOG_ERROR("Failed applying scheduler profile:0x%" PRIx64 + " to scheduler group:0x%" PRIx64 " and queue:0x%" PRIx64 + ", port:%s", scheduler_profile_id, group_id, queue_id, port.m_alias.c_str()); task_process_status handle_status = handleSaiSetStatus(SAI_API_SCHEDULER_GROUP, sai_status); if (handle_status != task_success) {