Skip to content

Commit edfea27

Browse files
stephenxsmssonicbld
authored andcommitted
Fix maximum headroom check failure (sonic-net#2948)
The accumulative headroom on a port is compared with the maximum headroom supported on the port whenever a buffer priority group is created/updated. This depends on the maximum headroom being exposed to the STATE_DB during orchagent initialization. However, in the cold reboot, orchagent starts slow which prevents the threshold from being exposed on time. In this case, the buffer manager is not able to perform the headroom check and the buffer orchagent should handle the possible failure from SAI in case the accumulative headroom exceeds the threshold.
1 parent 19affd3 commit edfea27

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

orchagent/saihelper.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -621,6 +621,20 @@ task_process_status handleSaiSetStatus(sai_api_t api, sai_status_t status, void
621621
break;
622622
}
623623
break;
624+
case SAI_API_BUFFER:
625+
switch (status)
626+
{
627+
case SAI_STATUS_INSUFFICIENT_RESOURCES:
628+
SWSS_LOG_ERROR("Encountered SAI_STATUS_INSUFFICIENT_RESOURCES in set operation, task failed, SAI API: %s, status: %s",
629+
sai_serialize_api(api).c_str(), sai_serialize_status(status).c_str());
630+
return task_failed;
631+
default:
632+
SWSS_LOG_ERROR("Encountered failure in set operation, exiting orchagent, SAI API: %s, status: %s",
633+
sai_serialize_api(api).c_str(), sai_serialize_status(status).c_str());
634+
handleSaiFailure(true);
635+
break;
636+
}
637+
break;
624638
default:
625639
SWSS_LOG_ERROR("Encountered failure in set operation, exiting orchagent, SAI API: %s, status: %s",
626640
sai_serialize_api(api).c_str(), sai_serialize_status(status).c_str());

0 commit comments

Comments
 (0)