Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch ID question for VOQ systems #1088

Open
tbgowda opened this issue Jul 21, 2022 · 0 comments
Open

Switch ID question for VOQ systems #1088

tbgowda opened this issue Jul 21, 2022 · 0 comments

Comments

@tbgowda
Copy link
Contributor

tbgowda commented Jul 21, 2022

Hello,

This is probably a SAI question but I am asking it here since I am seeing a behavior in syncd that is leaving me baffled.

The switch ID terminology is confusing me, I am hoping to get these questions answered and get a clarification.

Consider an example VOQ switch with two linecards : LC0 and LC1

Lets start from create_switch SAI API. The output parameter switch_id is the object ID of the "switch" formed by the SAI layer and returned back to the caller. Lets call it "switch_object_id" to avoid confusion.

/**
 * @brief Create switch
 *
 * SDK initialization/connect to SDK. After the call the capability attributes should be
 * ready for retrieval via sai_get_switch_attribute(). Same Switch Object id should be
 * given for create/connect for each NPU.
 *
 * @param[out] switch_id The Switch Object ID
 * @param[in] attr_count Number of attributes
 * @param[in] attr_list Array of attributes
 *
 * @return #SAI_STATUS_SUCCESS on success, failure status code on error
 */
typedef sai_status_t (*sai_create_switch_fn)(
        _Out_ sai_object_id_t *switch_id,
        _In_ uint32_t attr_count,
        _In_ const sai_attribute_t *attr_list);

Now, in a VOQ system should the SAI layer return the same "switch_object_id" for all the nodes in the chassis? In our VOQ switch, should SAI on LC0 and LC1 return the same switch_object_id or different "switch_object_id"s?

There is a "switch_id" in the DEVICE_METADATA of the SONiC config_db.json. Lets call it "switch_voq_id". Ex:

    "DEVICE_METADATA": {
        "localhost": {
            "hwsku": "Force10-S6000",
            "platform": "x86_64-kvm_x86_64-r0",
            "mac": "52:54:00:75:65:02",
            "switch_id": "2",
            "switch_type": "voq",
            "max_cores": "48",
            "type": "Spine",
            "asic_name": "Asic0",
            "hostname": "Linecard0",
            "deployment_id": "1"
        }
    }

This I presume is local to the node, meaning in our example LC0 and LC1 will have different "switch_voq_id"s. If not, please correct me.

This "switch_voq_id" is also what is used in defining system port configs in SONiC?

    "Linecard2|Asic0|Ethernet112": {
      "speed": "40000",
      "system_port_id": "61",
      "switch_id": "2",
      "core_index": "1",
      "core_port_index": "13"
    }

Questions:

  1. Is there any co-relation between switch_voq_id and switch_object_id?
  2. If yes, when create_switch is called, should the SAI layer embed the switch_voq_id into the switch_object_id?
  3. Say, SAI generates a switch_object_id following some internal logic, will all the subsequent invocation of SAI APIs from syncd use this generated switch_object_id for all the SAI objects (once that needs switch_object_id)?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant