Skip to content

Switch Tunnel rpc generation bug #2218

@MaksymPry

Description

@MaksymPry

When sai_rpc_server.cpp is generated sai_thrift_create_switch_tunnel function is affected by the following rule:

[%- IF function_name.match(create_switch_function) %]
[%- PROCESS check_switch_id %]
[%- END %]

This leads to returning the switch object instead of creating a switch tunnel:

sai_thrift_object_id_t sai_thrift_create_switch_tunnel(const std::vector<sai_thrift_attribute_t> & attr_list) {
sai_status_t status = SAI_STATUS_SUCCESS;
sai_object_id_t switch_tunnel_oid_out = SAI_NULL_OBJECT_ID;

// need to check if the switch exist
if (switch_id != SAI_NULL_OBJECT_ID) {
    return switch_id;
}

//check if the switch created in syncd
if (gSwitchId != SAI_NULL_OBJECT_ID) {
  switch_id = gSwitchId;
  return switch_id;
}
...

Perhaps we should check for the exact function name and not to match on a substring.

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