From 32bc1b6c148495fb8fca00a3ad78a635e50c3139 Mon Sep 17 00:00:00 2001 From: Neetha John Date: Fri, 12 Feb 2021 23:14:01 -0800 Subject: [PATCH] [bufferorch] Handle NOT IMPLEMENTED status returned during set attr operation (#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 --- orchagent/bufferorch.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/orchagent/bufferorch.cpp b/orchagent/bufferorch.cpp index c7977df43219..c43ac25bd4a2 100644 --- a/orchagent/bufferorch.cpp +++ b/orchagent/bufferorch.cpp @@ -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; @@ -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; @@ -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: