Skip to content

Commit 32bc1b6

Browse files
authored
[bufferorch] Handle NOT IMPLEMENTED status returned during set attr operation (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>
1 parent f9d5959 commit 32bc1b6

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

orchagent/bufferorch.cpp

+13-2
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,12 @@ task_process_status BufferOrch::processBufferPool(KeyOpFieldsValuesTuple &tuple)
367367
for (auto &attribute : attribs)
368368
{
369369
sai_status = sai_buffer_api->set_buffer_pool_attribute(sai_object, &attribute);
370-
if (SAI_STATUS_SUCCESS != sai_status)
370+
if (SAI_STATUS_ATTR_NOT_IMPLEMENTED_0 == sai_status)
371+
{
372+
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);
373+
return task_process_status::task_ignore;
374+
}
375+
else if (SAI_STATUS_SUCCESS != sai_status)
371376
{
372377
SWSS_LOG_ERROR("Failed to modify buffer pool, name:%s, sai object:%" PRIx64 ", status:%d", object_name.c_str(), sai_object, sai_status);
373378
return task_process_status::task_failed;
@@ -553,7 +558,12 @@ task_process_status BufferOrch::processBufferProfile(KeyOpFieldsValuesTuple &tup
553558
for (auto &attribute : attribs)
554559
{
555560
sai_status = sai_buffer_api->set_buffer_profile_attribute(sai_object, &attribute);
556-
if (SAI_STATUS_SUCCESS != sai_status)
561+
if (SAI_STATUS_ATTR_NOT_IMPLEMENTED_0 == sai_status)
562+
{
563+
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);
564+
return task_process_status::task_ignore;
565+
}
566+
else if (SAI_STATUS_SUCCESS != sai_status)
557567
{
558568
SWSS_LOG_ERROR("Failed to modify buffer profile, name:%s, sai object:%" PRIx64 ", status:%d", object_name.c_str(), sai_object, sai_status);
559569
return task_process_status::task_failed;
@@ -1011,6 +1021,7 @@ void BufferOrch::doTask(Consumer &consumer)
10111021
switch(task_status)
10121022
{
10131023
case task_process_status::task_success :
1024+
case task_process_status::task_ignore :
10141025
it = consumer.m_toSync.erase(it);
10151026
break;
10161027
case task_process_status::task_invalid_entry:

0 commit comments

Comments
 (0)