Skip to content

Commit

Permalink
Update 0001-update-swss-main-cpp.patch
Browse files Browse the repository at this point in the history
  • Loading branch information
pettershao-ragilenetworks authored Mar 20, 2023
1 parent a36b592 commit d5a539a
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions 0001-update-swss-main-cpp.patch
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
--- sonic-buildimage-one/src/sonic-swss/orchagent/main.cpp 2023-02-08 15:12:59.842183729 +0800
+++ sonic-buildimage-two/src/sonic-swss/orchagent/main.cpp 2023-02-08 15:15:05.767154906 +0800
@@ -569,7 +569,9 @@ int main(int argc, char **argv)
@@ -570,7 +570,9 @@ int main(int argc, char **argv)
attr.value.u64 = gSwitchId;
attrs.push_back(attr);

- if (gMySwitchType == "voq" || gMySwitchType == "fabric" || gMySwitchType == "chassis-packet")
- if (gMySwitchType == "voq" || gMySwitchType == "fabric")
+ /* centec create switch take longtime */
+ char *platform = getenv("platform");
+ if (gMySwitchType == "voq" || gMySwitchType == "fabric" || gMySwitchType == "chassis-packet" || (platform && strstr(platform, CENTEC_PLATFORM_SUBSTRING)))
+ if (gMySwitchType == "voq" || gMySwitchType == "fabric" || (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
@@ -585,6 +587,10 @@ int main(int argc, char **argv)
@@ -586,6 +588,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);
@@ -607,11 +613,16 @@ int main(int argc, char **argv)
@@ -608,11 +614,16 @@ 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)))
- if (gMySwitchType == "voq" || gMySwitchType == "fabric")
+ if (gMySwitchType == "voq" || gMySwitchType == "fabric" || (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;
Expand All @@ -38,5 +38,5 @@
+ 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)

0 comments on commit d5a539a

Please sign in to comment.