@@ -1253,10 +1253,25 @@ void performWarmRestart()
12531253 sai_object_id_t orig_rid = translate_vid_to_rid (switch_vid);
12541254
12551255 sai_object_id_t switch_rid;
1256- sai_attribute_t switch_attr;
1257- switch_attr.id = SAI_SWITCH_ATTR_INIT_SWITCH;
1258- switch_attr.value .booldata = true ;
1259- sai_status_t status = sai_metadata_sai_switch_api->create_switch (&switch_rid, 1 , &switch_attr);
1256+ sai_attr_id_t notifs[] = {
1257+ SAI_SWITCH_ATTR_SWITCH_STATE_CHANGE_NOTIFY,
1258+ SAI_SWITCH_ATTR_SHUTDOWN_REQUEST_NOTIFY,
1259+ SAI_SWITCH_ATTR_FDB_EVENT_NOTIFY,
1260+ SAI_SWITCH_ATTR_PORT_STATE_CHANGE_NOTIFY,
1261+ SAI_SWITCH_ATTR_PACKET_EVENT_NOTIFY,
1262+ SAI_SWITCH_ATTR_QUEUE_PFC_DEADLOCK_NOTIFY
1263+ };
1264+ #define NELMS (arr ) (sizeof (arr) / sizeof (arr[0 ]))
1265+ sai_attribute_t switch_attrs[NELMS (notifs) + 1 ];
1266+ switch_attrs[0 ].id = SAI_SWITCH_ATTR_INIT_SWITCH;
1267+ switch_attrs[0 ].value .booldata = true ;
1268+ for (size_t i = 0 ; i < NELMS (notifs); i++)
1269+ {
1270+ switch_attrs[i+1 ].id = notifs[i];
1271+ switch_attrs[i+1 ].value .ptr = (void *)1 ; // any non-null pointer
1272+ }
1273+ check_notifications_pointers ((uint32_t )NELMS (switch_attrs), &switch_attrs[0 ]);
1274+ sai_status_t status = sai_metadata_sai_switch_api->create_switch (&switch_rid, (uint32_t )NELMS (switch_attrs), &switch_attrs[0 ]);
12601275
12611276 if (status != SAI_STATUS_SUCCESS)
12621277 {
0 commit comments