File tree 2 files changed +17
-0
lines changed
2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -1234,6 +1234,10 @@ sai_status_t handle_generic(
1234
1234
if (object_type == SAI_OBJECT_TYPE_SWITCH)
1235
1235
{
1236
1236
on_switch_create (switch_id);
1237
+ #ifdef SAITHRIFT
1238
+ gSwitchId = real_object_id;
1239
+ SWSS_LOG_NOTICE (" Initialize gSwitchId with ID = 0x%lx" , gSwitchId );
1240
+ #endif
1237
1241
}
1238
1242
}
1239
1243
@@ -1762,6 +1766,7 @@ void on_switch_create_in_init_view(
1762
1766
1763
1767
#ifdef SAITHRIFT
1764
1768
gSwitchId = switch_rid;
1769
+ SWSS_LOG_NOTICE (" Initialize gSwitchId with ID = 0x%lx" , gSwitchId );
1765
1770
#endif
1766
1771
1767
1772
/*
Original file line number Diff line number Diff line change @@ -47,6 +47,13 @@ static sai_object_id_t g_switch_vid = SAI_NULL_OBJECT_ID;
47
47
48
48
static std::shared_ptr<SaiSwitch> g_sw;
49
49
50
+ #ifdef SAITHRIFT
51
+ /*
52
+ * SAI switch global needed for RPC server
53
+ */
54
+ extern sai_object_id_t gSwitchId ;
55
+ #endif
56
+
50
57
void processAttributesForOids (
51
58
_In_ sai_object_type_t objectType,
52
59
_In_ uint32_t attr_count,
@@ -418,6 +425,11 @@ void processSwitches()
418
425
419
426
sai_status_t status = sai_metadata_sai_switch_api->create_switch (&switch_rid, attr_count, attr_list);
420
427
428
+ #ifdef SAITHRIFT
429
+ gSwitchId = switch_rid;
430
+ SWSS_LOG_NOTICE (" Initialize gSwitchId with ID = 0x%lx" , gSwitchId );
431
+ #endif
432
+
421
433
if (status != SAI_STATUS_SUCCESS)
422
434
{
423
435
SWSS_LOG_THROW (" failed to create switch RID: %s" ,
You can’t perform that action at this time.
0 commit comments