Skip to content

[qosorch] Handle 'config qos clear' for queue, scheduler and wred in orchagent #1083

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

Open
wants to merge 2 commits 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
30 changes: 29 additions & 1 deletion orchagent/qosorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Copy link
Collaborator

Choose a reason for hiding this comment

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

Probably I miss something here, why we didn't hit this case:

            if (ref_resolve_status::success == resolve_result)
            {
                ....
                else if (op == DEL_COMMAND)
                {
                    // NOTE: The map is un-bound from the port. But the map itself still exists.
                    result = applySchedulerToQueueSchedulerGroup(port, queue_ind, SAI_NULL_OBJECT_ID);
                }
               ...

what is the value of "resolve_result" during you test?

{
/* 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);
Expand Down Expand Up @@ -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");
Expand Down