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

fix config qos clear and key only update #1562

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
34 changes: 21 additions & 13 deletions orchagent/qosorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1073,6 +1073,12 @@ task_process_status QosOrch::handleQueueTable(Consumer& consumer)
vector<string> port_names;

ref_resolve_status resolve_result;

if((op != SET_COMMAND) && (op != DEL_COMMAND))
{
SWSS_LOG_ERROR("Unknown operation type %s", op.c_str());
return task_process_status::task_invalid_entry;
}
// sample "QUEUE: {Ethernet4|0-1}"
tokens = tokenize(key, config_db_key_delimiter);
if (tokens.size() != 2)
Expand Down Expand Up @@ -1109,22 +1115,17 @@ task_process_status QosOrch::handleQueueTable(Consumer& consumer)
{
result = applySchedulerToQueueSchedulerGroup(port, queue_ind, sai_scheduler_profile);
}
else if (op == DEL_COMMAND)
else
{
// NOTE: The map is un-bound from the port. But the map itself still exists.
result = applySchedulerToQueueSchedulerGroup(port, queue_ind, SAI_NULL_OBJECT_ID);
}
else
{
SWSS_LOG_ERROR("Unknown operation type %s", op.c_str());
return task_process_status::task_invalid_entry;
}
if (!result)
{
SWSS_LOG_ERROR("Failed setting 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;
}
SWSS_LOG_DEBUG("Applied scheduler to port:%s", port_name.c_str());
SWSS_LOG_DEBUG("Applied scheduler to port:%s queue:%zd", port_name.c_str(), queue_ind);
}
else if (resolve_result != ref_resolve_status::field_not_found)
{
Expand All @@ -1136,6 +1137,18 @@ task_process_status QosOrch::handleQueueTable(Consumer& consumer)
SWSS_LOG_ERROR("Resolving scheduler reference failed");
return task_process_status::task_failed;
}
else
{
/* config qos clear or SET/DEL with NULL:NULL or only key*/
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;
}
SWSS_LOG_DEBUG("Removed scheduler to port:%s queue:%zd", port_name.c_str(), queue_ind);
}

sai_object_id_t sai_wred_profile;
string wred_profile_name;
Expand All @@ -1146,16 +1159,11 @@ task_process_status QosOrch::handleQueueTable(Consumer& consumer)
{
result = applyWredProfileToQueue(port, queue_ind, sai_wred_profile);
}
else if (op == DEL_COMMAND)
else
{
// NOTE: The map is un-bound from the port. But the map itself still exists.
result = applyWredProfileToQueue(port, queue_ind, SAI_NULL_OBJECT_ID);
}
else
{
SWSS_LOG_ERROR("Unknown operation type %s", op.c_str());
return task_process_status::task_invalid_entry;
}
if (!result)
{
SWSS_LOG_ERROR("Failed setting field:%s to port:%s, queue:%zd, line:%d", wred_profile_field_name.c_str(), port.m_alias.c_str(), queue_ind, __LINE__);
Expand Down