Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes QoS scheduler config on chips that do not support hierarchical scheduler #2674

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion orchagent/qosorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest using

        if (SAI_STATUS_IS_ATTR_NOT_SUPPORTED(status) || SAI_STATUS_IS_ATTR_NOT_IMPLEMENTED(status)
                 || status ==  SAI_STATUS_NOT_SUPPORTED || status == SAI_STATUS_NOT_IMPLEMENTED)

Refer https://github.com/sonic-net/sonic-swss/blob/master/orchagent/switchorch.cpp#L678 as an example.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for reviewing. This condition "SAI_STATUS_NOT_SUPPORTED != sai_status" was not right in the first place. Will fix this.

{
/* 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)
{
Expand Down