@@ -335,11 +335,14 @@ task_process_status BufferOrch::processBufferPool(Consumer &consumer)
335
335
}
336
336
if (SAI_NULL_OBJECT_ID != sai_object)
337
337
{
338
- sai_status = sai_buffer_api->set_buffer_pool_attribute (sai_object, &attribs[0 ]);
339
- if (SAI_STATUS_SUCCESS != sai_status)
338
+ for (auto &attribute : attribs)
340
339
{
341
- SWSS_LOG_ERROR (" Failed to modify buffer pool, name:%s, sai object:%" PRIx64 " , status:%d" , object_name.c_str (), sai_object, sai_status);
342
- return task_process_status::task_failed;
340
+ sai_status = sai_buffer_api->set_buffer_pool_attribute (sai_object, &attribute);
341
+ if (SAI_STATUS_SUCCESS != sai_status)
342
+ {
343
+ SWSS_LOG_ERROR (" Failed to modify buffer pool, name:%s, sai object:%" PRIx64 " , status:%d" , object_name.c_str (), sai_object, sai_status);
344
+ return task_process_status::task_failed;
345
+ }
343
346
}
344
347
SWSS_LOG_DEBUG (" Modified existing pool:%" PRIx64 " , type:%s name:%s " , sai_object, map_type_name.c_str (), object_name.c_str ());
345
348
}
@@ -504,11 +507,14 @@ task_process_status BufferOrch::processBufferProfile(Consumer &consumer)
504
507
if (SAI_NULL_OBJECT_ID != sai_object)
505
508
{
506
509
SWSS_LOG_DEBUG (" Modifying existing sai object:%" PRIx64, sai_object);
507
- sai_status = sai_buffer_api->set_buffer_profile_attribute (sai_object, &attribs[0 ]);
508
- if (SAI_STATUS_SUCCESS != sai_status)
510
+ for (auto &attribute : attribs)
509
511
{
510
- SWSS_LOG_ERROR (" Failed to modify buffer profile, name:%s, sai object:%" PRIx64 " , status:%d" , object_name.c_str (), sai_object, sai_status);
511
- return task_process_status::task_failed;
512
+ sai_status = sai_buffer_api->set_buffer_profile_attribute (sai_object, &attribute);
513
+ if (SAI_STATUS_SUCCESS != sai_status)
514
+ {
515
+ SWSS_LOG_ERROR (" Failed to modify buffer profile, name:%s, sai object:%" PRIx64 " , status:%d" , object_name.c_str (), sai_object, sai_status);
516
+ return task_process_status::task_failed;
517
+ }
512
518
}
513
519
}
514
520
else
0 commit comments