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

QOS bug fix #85

Merged
merged 1 commit into from
Sep 21, 2016
Merged
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
36 changes: 19 additions & 17 deletions orchagent/qosorch.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#include "sai.h"
#include "tokenize.h"
#include "qosorch.h"
#include "logger.h"
Expand Down Expand Up @@ -635,7 +634,7 @@ task_process_status QosOrch::handleSchedulerTable(Consumer& consumer)
else if (fvField(*i) == scheduler_weight_field_name)
{
attr.id = SAI_SCHEDULER_ATTR_SCHEDULING_WEIGHT;
attr.value.s32 = stoi(fvValue(*i));
attr.value.u8 = stoi(fvValue(*i));
sai_attr_list.push_back(attr);
}
else if (fvField(*i) == scheduler_priority_field_name)
Expand All @@ -647,28 +646,31 @@ task_process_status QosOrch::handleSchedulerTable(Consumer& consumer)
SWSS_LOG_ERROR("Unknown field:%s", fvField(*i).c_str());
return task_process_status::task_invalid_entry;
}
if (SAI_NULL_OBJECT_ID != sai_object)
}

if (SAI_NULL_OBJECT_ID != sai_object)
{
for (auto attr : sai_attr_list)
{
for (auto attr : sai_attr_list)
{
sai_status = sai_scheduler_api->set_scheduler_attribute(sai_object, &attr);
if (sai_status != SAI_STATUS_SUCCESS)
{
SWSS_LOG_ERROR("fail to set scheduler attribute, id:%d", attr.id);
return task_process_status::task_failed;
}
}
}
else {
sai_status = sai_scheduler_api->create_scheduler_profile(&sai_object, sai_attr_list.size(), sai_attr_list.data());
sai_status = sai_scheduler_api->set_scheduler_attribute(sai_object, &attr);
if (sai_status != SAI_STATUS_SUCCESS)
{
SWSS_LOG_ERROR("fail to call sai_scheduler_api->create_scheduler_profile: %d", sai_status);
SWSS_LOG_ERROR("fail to set scheduler attribute, id:%d", attr.id);
return task_process_status::task_failed;
}
(*(m_qos_type_maps[qos_map_type_name]))[qos_object_name] = sai_object;
}
}
else
{
sai_status = sai_scheduler_api->create_scheduler_profile(&sai_object, sai_attr_list.size(), sai_attr_list.data());
if (sai_status != SAI_STATUS_SUCCESS)
{
SWSS_LOG_ERROR("fail to call sai_scheduler_api->create_scheduler_profile: %d", sai_status);
return task_process_status::task_failed;
}
SWSS_LOG_NOTICE("Create scheduler profile");
(*(m_qos_type_maps[qos_map_type_name]))[qos_object_name] = sai_object;
}
}
else if (op == DEL_COMMAND)
{
Expand Down