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

Update GNMI path schema to support multi-asic and smartswitch #1625

Merged
merged 2 commits into from
Oct 29, 2024

Conversation

ganglyu
Copy link
Contributor

@ganglyu ganglyu commented Feb 27, 2024

Signed-off-by: Gang Lv [email protected]

What is the motivation for this PR?

GNMI native needs to support multi-asic device and smartswitch, so we need to update GNMI path schema.

PR:

PR title state context
[Support multiple database for DPU](sonic-net/sonic-gnmi#188) GitHub issue/pull request detail GitHub pull request check contexts
[Update test for new GNMI path schema](sonic-net/sonic-mgmt#11780) GitHub issue/pull request detail GitHub pull request check contexts

* We use the first element to specify the target database.

* We use the second element to specify the database instance:
* For single asic device, this element is "localhost"
Copy link
Contributor

Choose a reason for hiding this comment

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

Does single asic recognize "localhost" and parse that from GNMI's end?
I ask this because when we show running config, multi-asic has one more asic layer than single asic.

multi-asic's running config:

{
  "localhost": {// host config
    "ACL_TABLE":{..}
  },
  "aisc0": {// asic0 config, only exists if multi-asic
    "ACL_TABLE":{..}
  }
}

single asic's running config:

{//host's config
  "ACL_TABLE":{..}
}

qiluo-msft pushed a commit to sonic-net/sonic-gnmi that referenced this pull request Mar 13, 2024
### Why I did it
We need to update sonic-gnmi to support new GNMI path schema.
HLD PR: sonic-net/SONiC#1625

#### How I did it
I add a new element in GNMI path to support database instance.
```
/APPL_DB/localhost/DASH_VNET_TABLE/vnet1/
```
The second element is used for target database instance, and it's localhost by default.

#### How to verify it
Run unit test for sonic-gnmi.
Run end to end test for dash and gnmi.
ganglyu added a commit to sonic-net/sonic-gnmi that referenced this pull request Mar 18, 2024
#### 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
* Support new database configuration

```
{
    "INCLUDES" : [
        {
            "include" : "../../redis/sonic-db/database_config.json"
        },
        {
            "container_name" : "dpu0",
            "include" : "../../redisdpu0/sonic-db/database_config.json"
        }
    ],
    "VERSION" : "1.0"
}
```

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.

```
        "DPU_APPL_DB" : {
            "id" : 15,
            "separator": ":",
            "instance" : "redis",
            "format": "proto"
        },
```

* Update GNMI path to support multiple database

I add a new element in GNMI path to support database instance.
```
/APPL_DB/dpu0/DASH_VNET_TABLE/vnet1/
```
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.
@ganglyu ganglyu merged commit 1a5399b into sonic-net:master Oct 29, 2024
1 check passed
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

Successfully merging this pull request may close these issues.

3 participants