-
Notifications
You must be signed in to change notification settings - Fork 57
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
Support multiple database for DPU #188
Conversation
sonic_data_client/mixed_db_client.go
Outdated
// Skip first elem | ||
fullPath.Elem = elems[1:] | ||
// Skip first two elem | ||
// New GNMI path schema, /CONFIG_DB/localhost/PORT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
return db_list, err | ||
} | ||
|
||
func GetDbSeparatorByDBKey(db_name string, dbkey swsscommon.SonicDBKey) (separator string, err error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This wrapper can translate swsscommon exception to error and invoke swsscommon initialize API.
Why I did it
We have updated database configuration to support multiple databases for smartswitch.
And then we need to update sonic-gnmi to support new database configuration and new GNMI path for smartswitch.
HLD PR: sonic-net/SONiC#1625
How I did it
Use a single layer instance for each device to support multiple asic and multiple dpu.
For example, for multiple asic, the instances can be named localhost, asic0, asic1, and so on. For multiple dpu, the instances can be named localhost, dpu0, dpu1, and so on. For multiple asic npu and multiple dpu, the instances can be named localhost, asic0, asic1, ..., dpu0, dpu1, and so on.
I add a new element in GNMI path to support database instance.
The second element is used for target database instance, and it can be localhost, asic0, asic1, ..., dpu0, dpu1, and so on.
How to verify it
Run unit test for sonic-gnmi.
Run end to end test for dash and gnmi.
Which release branch to backport (provide reason below if selected)
Description for the changelog
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)