Skip to content

gSwitchId required by SAI thrift is not initialized in syncd  #1405

@andrii-savka

Description

@andrii-savka

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:

  1. Set SAI switch log to debug
  2. Call sai_thrift_clear_all_counters
  3. 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)
```

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions