File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -220,14 +220,9 @@ int main(int argc, char **argv)
220220 attrs.push_back (attr);
221221 }
222222
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
231226 if (gSyncMode )
232227 {
233228 attr.id = SAI_REDIS_SWITCH_ATTR_SYNC_MODE ;
@@ -236,6 +231,15 @@ int main(int argc, char **argv)
236231 sai_switch_api->set_switch_attribute (gSwitchId , &attr);
237232 }
238233
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+
239243 /* Get switch source MAC address if not provided */
240244 if (!gMacAddress )
241245 {
You can’t perform that action at this time.
0 commit comments