Commit 264e548 1 parent 34b582c commit 264e548 Copy full SHA for 264e548
File tree 1 file changed +12
-8
lines changed
1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -220,14 +220,9 @@ int main(int argc, char **argv)
220
220
attrs.push_back (attr);
221
221
}
222
222
223
- status = sai_switch_api->create_switch (&gSwitchId , (uint32_t )attrs.size (), attrs.data ());
224
- if (status != SAI_STATUS_SUCCESS)
225
- {
226
- SWSS_LOG_ERROR (" Failed to create a switch, rv:%d" , status);
227
- exit (EXIT_FAILURE);
228
- }
229
- SWSS_LOG_NOTICE (" Create a switch" );
230
-
223
+ // SAI_REDIS_SWITCH_ATTR_SYNC_MODE attribute only setBuffer and g_syncMode to true
224
+ // since it is not using ASIC_DB, we can execute it before create_switch
225
+ // when g_syncMode is set to true here, create_switch will wait the response from syncd
231
226
if (gSyncMode )
232
227
{
233
228
attr.id = SAI_REDIS_SWITCH_ATTR_SYNC_MODE;
@@ -236,6 +231,15 @@ int main(int argc, char **argv)
236
231
sai_switch_api->set_switch_attribute (gSwitchId , &attr);
237
232
}
238
233
234
+
235
+ status = sai_switch_api->create_switch (&gSwitchId , (uint32_t )attrs.size (), attrs.data ());
236
+ if (status != SAI_STATUS_SUCCESS)
237
+ {
238
+ SWSS_LOG_ERROR (" Failed to create a switch, rv:%d" , status);
239
+ exit (EXIT_FAILURE);
240
+ }
241
+ SWSS_LOG_NOTICE (" Create a switch" );
242
+
239
243
/* Get switch source MAC address if not provided */
240
244
if (!gMacAddress )
241
245
{
You can’t perform that action at this time.
0 commit comments