Skip to content

Commit

Permalink
[qosorch]: Add cir and pir parameters for scheduler (sonic-net#991)
Browse files Browse the repository at this point in the history
Signed-off-by: tengfei <[email protected]>
  • Loading branch information
tengfei-astfs authored and antony-rheneus committed Jul 31, 2019
1 parent c679b0b commit d7f6c02
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
24 changes: 24 additions & 0 deletions orchagent/qosorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -870,6 +870,30 @@ task_process_status QosOrch::handleSchedulerTable(Consumer& consumer)
// TODO: The meaning is to be able to adjus priority of the given scheduler group.
// However currently SAI model does not provide such ability.
}
else if (fvField(*i) == scheduler_min_bandwidth_rate_field_name)
{
attr.id = SAI_SCHEDULER_ATTR_MIN_BANDWIDTH_RATE;
attr.value.u64 = (uint64_t)stoi(fvValue(*i));
sai_attr_list.push_back(attr);
}
else if (fvField(*i) == scheduler_min_bandwidth_burst_rate_field_name)
{
attr.id = SAI_SCHEDULER_ATTR_MIN_BANDWIDTH_BURST_RATE;
attr.value.u64 = (uint64_t)stoi(fvValue(*i));
sai_attr_list.push_back(attr);
}
else if (fvField(*i) == scheduler_max_bandwidth_rate_field_name)
{
attr.id = SAI_SCHEDULER_ATTR_MAX_BANDWIDTH_RATE;
attr.value.u64 = (uint64_t)stoi(fvValue(*i));
sai_attr_list.push_back(attr);
}
else if (fvField(*i) == scheduler_max_bandwidth_burst_rate_field_name)
{
attr.id = SAI_SCHEDULER_ATTR_MAX_BANDWIDTH_BURST_RATE;
attr.value.u64 = (uint64_t)stoi(fvValue(*i));
sai_attr_list.push_back(attr);
}
else {
SWSS_LOG_ERROR("Unknown field:%s", fvField(*i).c_str());
return task_process_status::task_invalid_entry;
Expand Down
5 changes: 5 additions & 0 deletions orchagent/qosorch.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ const string scheduler_algo_STRICT = "STRICT";
const string scheduler_weight_field_name = "weight";
const string scheduler_priority_field_name = "priority";

const string scheduler_min_bandwidth_rate_field_name = "cir";//Committed Information Rate
const string scheduler_min_bandwidth_burst_rate_field_name = "cbs";//Committed Burst Size
const string scheduler_max_bandwidth_rate_field_name = "pir";//Peak Information Rate
const string scheduler_max_bandwidth_burst_rate_field_name = "pbs";//Peak Burst Size

const string ecn_field_name = "ecn";
const string ecn_none = "ecn_none";
const string ecn_red = "ecn_red";
Expand Down

0 comments on commit d7f6c02

Please sign in to comment.