Skip to content

Commit

Permalink
[bufferorch] Handle NOT IMPLEMENTED status returned during set attr o…
Browse files Browse the repository at this point in the history
…peration (sonic-net#1639)

Set operations for some attributes of buffer pool and buffer profile may not be implemented by some vendors and they return SAI_STATUS_ATTR_NOT_IMPLEMENTED_0. Handle that status in the code and ignore that task

Signed-off-by: Neetha John <nejo@microsoft.com>
  • Loading branch information
neethajohn authored Feb 13, 2021
1 parent f9d5959 commit 32bc1b6
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions orchagent/bufferorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,12 @@ task_process_status BufferOrch::processBufferPool(KeyOpFieldsValuesTuple &tuple)
for (auto &attribute : attribs)
{
sai_status = sai_buffer_api->set_buffer_pool_attribute(sai_object, &attribute);
if (SAI_STATUS_SUCCESS != sai_status)
if (SAI_STATUS_ATTR_NOT_IMPLEMENTED_0 == sai_status)
{
SWSS_LOG_NOTICE("Buffer pool SET for name:%s, sai object:%" PRIx64 ", not implemented. status:%d. Ignoring it", object_name.c_str(), sai_object, sai_status);
return task_process_status::task_ignore;
}
else if (SAI_STATUS_SUCCESS != sai_status)
{
SWSS_LOG_ERROR("Failed to modify buffer pool, name:%s, sai object:%" PRIx64 ", status:%d", object_name.c_str(), sai_object, sai_status);
return task_process_status::task_failed;
Expand Down Expand Up @@ -553,7 +558,12 @@ task_process_status BufferOrch::processBufferProfile(KeyOpFieldsValuesTuple &tup
for (auto &attribute : attribs)
{
sai_status = sai_buffer_api->set_buffer_profile_attribute(sai_object, &attribute);
if (SAI_STATUS_SUCCESS != sai_status)
if (SAI_STATUS_ATTR_NOT_IMPLEMENTED_0 == sai_status)
{
SWSS_LOG_NOTICE("Buffer profile SET for name:%s, sai object:%" PRIx64 ", not implemented. status:%d. Ignoring it", object_name.c_str(), sai_object, sai_status);
return task_process_status::task_ignore;
}
else if (SAI_STATUS_SUCCESS != sai_status)
{
SWSS_LOG_ERROR("Failed to modify buffer profile, name:%s, sai object:%" PRIx64 ", status:%d", object_name.c_str(), sai_object, sai_status);
return task_process_status::task_failed;
Expand Down Expand Up @@ -1011,6 +1021,7 @@ void BufferOrch::doTask(Consumer &consumer)
switch(task_status)
{
case task_process_status::task_success :
case task_process_status::task_ignore :
it = consumer.m_toSync.erase(it);
break;
case task_process_status::task_invalid_entry:
Expand Down

0 comments on commit 32bc1b6

Please sign in to comment.