Skip to content

Read switch_id of fabric switch from config_db#3102

Merged
prsunny merged 16 commits intosonic-net:masterfrom
ysmanman:fabric-switch-id
May 30, 2024
Merged

Read switch_id of fabric switch from config_db#3102
prsunny merged 16 commits intosonic-net:masterfrom
ysmanman:fabric-switch-id

Conversation

@ysmanman
Copy link
Copy Markdown
Contributor

@ysmanman ysmanman commented Apr 5, 2024

What I did
Read switch_id of fabric switch from config_db

Why I did it
Fix sonic-net/sonic-buildimage#18558

How I verified it

Details if related

@ysmanman ysmanman requested a review from prsunny as a code owner April 5, 2024 22:44
Copy link
Copy Markdown
Contributor

@judyjoseph judyjoseph left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, @saksarav-nokia f.y.i

}
else
{
SWSS_LOG_ERROR("Fabric switch id is not configured");
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like its a breaking change. You are exiting orchagent if switch_id is not present in db. Is this intenational. @judyjoseph , @arlakshm

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@prsunny We have the same condition for linecard asics. In latest SAI, switch_id was made mandatory on switch create of fabric asic opencomputeproject/SAI#1793. So, we need this change to pass the correct switch-id. The configuration is expected to have switch_id for both linecard asic and fabric asic.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, please approve the PR

arlakshm
arlakshm previously approved these changes Apr 22, 2024
@arlakshm
Copy link
Copy Markdown
Contributor

/Azp run Azure.sonic-swss

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

attrs.push_back(attr);

//Read switch_id from config_db.
Table cfgDeviceMetaDataTable(&config_db, CFG_DEVICE_METADATA_TABLE_NAME);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you check if VS tests are adopted for this change for Voq?

@kenneth-arista
Copy link
Copy Markdown
Contributor

/Azwp run Azure.sonic-swss

@kenneth-arista
Copy link
Copy Markdown
Contributor

/Azpw run Azure.sonic-swss

@arlakshm
Copy link
Copy Markdown
Contributor

arlakshm commented May 8, 2024

/Azp run Azure.sonic-swss

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@prsunny
Copy link
Copy Markdown
Collaborator

prsunny commented May 8, 2024

@arlakshm , looks like its a genuine VS failure.. please check my comment

@ysmanman ysmanman force-pushed the fabric-switch-id branch from 99e732e to e52eea9 Compare May 13, 2024 21:24
@ysmanman
Copy link
Copy Markdown
Contributor Author

@arlakshm , looks like its a genuine VS failure.. please check my comment

Thanks @prsunny . I will add switch_id in config_db of virtual chassis.

@prsunny
Copy link
Copy Markdown
Collaborator

prsunny commented May 21, 2024

Can you please fix coverage?

@ysmanman ysmanman force-pushed the fabric-switch-id branch from c25aa1d to 47dc4db Compare May 21, 2024 23:09
@ysmanman
Copy link
Copy Markdown
Contributor Author

Can you please fix coverage?

Hi @prsunny updated PR with unit test.

@ysmanman
Copy link
Copy Markdown
Contributor Author

/Azp run Azure.sonic-swss

@azure-pipelines
Copy link
Copy Markdown

Commenter does not have sufficient privileges for PR 3102 in repo sonic-net/sonic-swss

@ysmanman
Copy link
Copy Markdown
Contributor Author

/azpw run Azure.sonic-swss

@mssonicbld
Copy link
Copy Markdown
Collaborator

/AzurePipelines run Azure.sonic-swss

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@arlakshm
Copy link
Copy Markdown
Contributor

/Azp run Azure.sonic-swss

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@ysmanman
Copy link
Copy Markdown
Contributor Author

/azpw run Azure.sonic-swss

@mssonicbld
Copy link
Copy Markdown
Collaborator

/AzurePipelines run Azure.sonic-swss

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@ysmanman ysmanman force-pushed the fabric-switch-id branch from 4f62b62 to 066fc9a Compare May 23, 2024 17:28
@ysmanman ysmanman force-pushed the fabric-switch-id branch from 3073b2f to 94a9cba Compare May 24, 2024 00:28
@ysmanman
Copy link
Copy Markdown
Contributor Author

@arlakshm @prsunny All checks passed. Please help reviewing and merging the PR.

@ysmanman
Copy link
Copy Markdown
Contributor Author

/azpw run Azure.sonic-swss

@mssonicbld
Copy link
Copy Markdown
Collaborator

/AzurePipelines run Azure.sonic-swss

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@prsunny prsunny merged commit 4ae8bfa into sonic-net:master May 30, 2024
Janetxxx pushed a commit to Janetxxx/sonic-swss that referenced this pull request Nov 10, 2025
* Read switch_id of fabric switch from config_db.
* Validate fabric switch_id before create fabric switch.
* Add fabric switch_id for virtual chassis
* Add unit test for handling fabric switch_id.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

[master][voq] fabric switch id is not read from configDb

7 participants