Description
The global variable "gSwitchId" which is required by SAI thrift is not initialized in syncd process.
Actually, it contains default value "0" instead of real SAI switch id.
The SAI thrift doesn't work without it.
Steps to reproduce the issue:
- Set SAI switch log to debug
- Call sai_thrift_clear_all_counters
- Bug. Counters are not cleaned. SAI log contains the below error.
Describe the results you received:
INFO supervisord: syncd sai_thrift_get_switch_attribute
INFO supervisord: syncd 17:31:07 SAI THRIFT DEBUG: sai_thrift_get_switch_attribute(): Called.
INFO supervisord: syncd sai_thrift_get_switch_attribute: switch id = 0x0
ERROR SAI_UTILS: Invalid object type 0 expected 33
DEBUG SAI_UTILS: mlnx_sai_utils.c[2024]- get_dispatch_attribs_handler: Got #0, NUMBER_OF_ACTIVE_PORTS, key:Invalid Switch ID, val:32
Describe the results you expected:
The gSwitchId should contain an actual SAI switch id.
Additional information you deem important (e.g. issue happens only occasionally):
**Output of `show version`:**
```
(paste your output here)
```
**Attach debug file `sudo generate_dump`:**
```
(paste your output here)
```
Description
The global variable "gSwitchId" which is required by SAI thrift is not initialized in syncd process.
Actually, it contains default value "0" instead of real SAI switch id.
The SAI thrift doesn't work without it.
Steps to reproduce the issue:
Describe the results you received:
INFO supervisord: syncd sai_thrift_get_switch_attribute
INFO supervisord: syncd 17:31:07 SAI THRIFT DEBUG: sai_thrift_get_switch_attribute(): Called.
INFO supervisord: syncd sai_thrift_get_switch_attribute: switch id = 0x0
ERROR SAI_UTILS: Invalid object type 0 expected 33
DEBUG SAI_UTILS: mlnx_sai_utils.c[2024]- get_dispatch_attribs_handler: Got #0, NUMBER_OF_ACTIVE_PORTS, key:Invalid Switch ID, val:32
Describe the results you expected:
The gSwitchId should contain an actual SAI switch id.
Additional information you deem important (e.g. issue happens only occasionally):