diff --git a/orchagent/main.cpp b/orchagent/main.cpp index 5ae5aea342..fd1486e2da 100644 --- a/orchagent/main.cpp +++ b/orchagent/main.cpp @@ -585,7 +585,9 @@ int main(int argc, char **argv) attr.value.u64 = gSwitchId; attrs.push_back(attr); - if (gMySwitchType == "voq" || gMySwitchType == "fabric" || gMySwitchType == "chassis-packet") + /* centec create switch take longtime */ + char *platform = getenv("platform"); + if (gMySwitchType == "voq" || gMySwitchType == "fabric" || gMySwitchType == "chassis-packet" || (platform && strstr(platform, CENTEC_PLATFORM_SUBSTRING))) { /* 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 @@ -601,6 +603,10 @@ int main(int argc, char **argv) { attr.value.u64 = (10 * SAI_REDIS_DEFAULT_SYNC_OPERATION_RESPONSE_TIMEOUT); } + else if (platform && strstr(platform, CENTEC_PLATFORM_SUBSTRING)) + { + 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); @@ -623,11 +629,18 @@ int main(int argc, char **argv) } SWSS_LOG_NOTICE("Create a switch, id:%" PRIu64, gSwitchId); - if (gMySwitchType == "voq" || gMySwitchType == "fabric" || gMySwitchType == "chassis-packet") + if (gMySwitchType == "voq" || gMySwitchType == "fabric" || gMySwitchType == "chassis-packet" || (platform && strstr(platform, CENTEC_PLATFORM_SUBSTRING))) { /* 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; + + /* centec platform set 3X default timeout*/ + if (platform && strstr(platform, CENTEC_PLATFORM_SUBSTRING)) + { + attr.value.u64 = (3 * SAI_REDIS_DEFAULT_SYNC_OPERATION_RESPONSE_TIMEOUT); + } + status = sai_switch_api->set_switch_attribute(gSwitchId, &attr); if (status != SAI_STATUS_SUCCESS) diff --git a/orchagent/orch.h b/orchagent/orch.h index efee98a73c..c96de3b229 100644 --- a/orchagent/orch.h +++ b/orchagent/orch.h @@ -41,6 +41,7 @@ const char state_db_key_delimiter = '|'; #define MRVL_PLATFORM_SUBSTRING "marvell" #define CISCO_8000_PLATFORM_SUBSTRING "cisco-8000" #define XS_PLATFORM_SUBSTRING "xsight" +#define CENTEC_PLATFORM_SUBSTRING "centec" #define CONFIGDB_KEY_SEPARATOR "|" #define DEFAULT_KEY_SEPARATOR ":"