Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions orchagent/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,36 @@ int main(int argc, char **argv)
attr.value.u64 = gSwitchId;
attrs.push_back(attr);

if (gMySwitchType == "voq" || gMySwitchType == "fabric")
{
/* We set this long timeout in order for orchagent to wait enough time for
* response from syncd. It is needed since switch create takes more time
* than default time to create switch if there are lots of front panel ports
* and systems ports to initialize
*/

if (gMySwitchType == "voq")
{
attr.value.u64 = (5 * SAI_REDIS_DEFAULT_SYNC_OPERATION_RESPONSE_TIMEOUT);
}
else if (gMySwitchType == "fabric")
{
attr.value.u64 = (10 * SAI_REDIS_DEFAULT_SYNC_OPERATION_RESPONSE_TIMEOUT);
}

attr.id = SAI_REDIS_SWITCH_ATTR_SYNC_OPERATION_RESPONSE_TIMEOUT;
status = sai_switch_api->set_switch_attribute(gSwitchId, &attr);

if (status != SAI_STATUS_SUCCESS)
{
SWSS_LOG_WARN("Failed to set SAI REDIS response timeout");
}
else
{
SWSS_LOG_NOTICE("SAI REDIS response timeout set successfully to %" PRIu64 " ", attr.value.u64);
}
}

status = sai_switch_api->create_switch(&gSwitchId, (uint32_t)attrs.size(), attrs.data());
if (status != SAI_STATUS_SUCCESS)
{
Expand All @@ -582,6 +612,22 @@ int main(int argc, char **argv)
}
SWSS_LOG_NOTICE("Create a switch, id:%" PRIu64, gSwitchId);

if (gMySwitchType == "voq" || gMySwitchType == "fabric")
{
/* Set syncd response timeout back to the default value */
attr.id = SAI_REDIS_SWITCH_ATTR_SYNC_OPERATION_RESPONSE_TIMEOUT;
attr.value.u64 = SAI_REDIS_DEFAULT_SYNC_OPERATION_RESPONSE_TIMEOUT;
status = sai_switch_api->set_switch_attribute(gSwitchId, &attr);

if (status != SAI_STATUS_SUCCESS)
{
SWSS_LOG_WARN("Failed to set SAI REDIS response timeout to default");
}
else
{
SWSS_LOG_NOTICE("SAI REDIS response timeout set successfully to default: %" PRIu64 " ", attr.value.u64);
}
}

if (gMySwitchType != "fabric")
{
Expand Down