Skip to content

[YANG]: Add Yang model support for Multi ASIC port and device_metadata #351

Merged
gechiang merged 2 commits intoAzure:202205from
xincunli-sonic:xincun/cherrypick-18444-and-18704
Apr 27, 2024
Merged

[YANG]: Add Yang model support for Multi ASIC port and device_metadata #351
gechiang merged 2 commits intoAzure:202205from
xincunli-sonic:xincun/cherrypick-18444-and-18704

Conversation

@xincunli-sonic
Copy link

@xincunli-sonic xincunli-sonic commented Apr 26, 2024

Why I did it

Cherry pick from public repo: sonic-buildiamge:

  1. [YANG]: Add Yang model support for Multi ASIC port and device_metadata
  2. Rename the leaf nodes to lower case.

In Multi ASIC scenario,

  1. PORT configuration table requires core_id, core_port_id and num_voq:
{
    "PORT": {
        "Ethernet0": {
            "index": "0",
            "lanes": "101,102",
            "description": "fortyGigE1/1/1",
            "mtu": "9100",
            "alias": "fortyGigE1/1/1",
            "speed": "40000",
            "link_training": "off",
            "laser_freq": "191300",
            "tx_power": "-27.3",
            "coreId": "1",
            "corePortId": "1",
            "numVoq": "8"
        },
        "Ethernet1": {
            "index": "1",
            "lanes": "103,104",
            "description": "fortyGigE1/1/2",
            "mtu": "9100",
            "alias": "fortyGigE1/1/2",
            "admin_status": "up",
            "speed": "40000",
            "link_training": "on",
            "laser_freq": "191300",
            "tx_power": "-27.3",
            "coreId": "0",
            "corePortId": "14",
            "numVoq": "8"
        },
        "Ethernet63": {
            "index": "63",
            "lanes": "87,88",
            "description": "fortyGigE1/4/16",
            "mtu": "9100",
            "alias": "fortyGigE1/4/16",
            "speed": "40000",
            "laser_freq": "191300",
            "tx_power": "-27.3",
            "coreId": "0",
            "corePortId": "15",
            "numVoq": "8"
        }
    }
}
  1. DEVICE_METADATA configuration table requires asic_id:
{
"DEVICE_METADATA": {
        "localhost": {
        "asic_id": "06:00.0",
        "asic_name": "asic0",
        "hwsku": "Force10-S6100",
        "default_bgp_status": "up",
        "docker_routing_config_mode": "unified",
        "hostname": "sonic-s6100-01",
        "platform": "x86_64-dell_s6100_c2538-r0",
        "mac": "4c:76:25:f4:70:82",
        "default_pfcwd_status": "disable",
        "bgp_asn": "65100",
        "deployment_id": "1",
        "type": "ToRRouter",
        "bgp_adv_lo_prefix_as_128" : "true",
        "buffer_model": "traditional",
        "yang_config_validation": "disable",
        "rack_mgmt_map": "dummy_value",
        "timezome": "Europe/Kiev"
    }
  }
}
Work item tracking
  • Microsoft ADO (number only): 27252814, 27253157

How I did it

  1. Added core_id, core_port_id and num_voq field to CONFIG_DB PORT table.
  2. Added asic_id field to CONFIG_DB DEVICE_METADATA table.

How to verify it

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211
  • 202305

Tested branch (Please provide the tested image version)

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

…a (#18444)

### Why I did it

In Multi ASIC scenario,
1. PORT configuration table requires `coreId`, `corePortId` and `numVoq`:
```json
{
    "PORT": {
        "Ethernet0": {
            "index": "0",
            "lanes": "101,102",
            "description": "fortyGigE1/1/1",
            "mtu": "9100",
            "alias": "fortyGigE1/1/1",
            "speed": "40000",
            "link_training": "off",
            "laser_freq": "191300",
            "tx_power": "-27.3",
            "dom_polling": "enabled",
            "coreId": "1",
            "corePortId": "1",
            "numVoq": "8"
        },
        "Ethernet1": {
            "index": "1",
            "lanes": "103,104",
            "description": "fortyGigE1/1/2",
            "mtu": "9100",
            "alias": "fortyGigE1/1/2",
            "admin_status": "up",
            "speed": "40000",
            "link_training": "on",
            "laser_freq": "191300",
            "tx_power": "-27.3",
            "dom_polling": "enabled",
            "coreId": "0",
            "corePortId": "14",
            "numVoq": "8"
        },
        "Ethernet63": {
            "index": "63",
            "lanes": "87,88",
            "description": "fortyGigE1/4/16",
            "mtu": "9100",
            "alias": "fortyGigE1/4/16",
            "speed": "40000",
            "laser_freq": "191300",
            "tx_power": "-27.3",
            "dom_polling": "disabled",
            "coreId": "0",
            "corePortId": "15",
            "numVoq": "8"
        }
    }
}
```
2. DEVICE_METADATA configuration table requires `asic_id`:
```json
{
"DEVICE_METADATA": {
        "localhost": {
        "asic_id": "06:00.0",
        "asic_name": "asic0",
        "hwsku": "Force10-S6100",
        "default_bgp_status": "up",
        "docker_routing_config_mode": "unified",
        "hostname": "sonic-s6100-01",
        "platform": "x86_64-dell_s6100_c2538-r0",
        "mac": "4c:76:25:f4:70:82",
        "default_pfcwd_status": "disable",
        "bgp_asn": "65100",
        "deployment_id": "1",
        "type": "ToRRouter",
        "bgp_adv_lo_prefix_as_128" : "true",
        "buffer_model": "traditional",
        "yang_config_validation": "disable",
        "rack_mgmt_map": "dummy_value",
        "timezome": "Europe/Kiev"
    }
  }
}

```

##### Work item tracking
- Microsoft ADO **(number only)**: 27252814, 27253157

#### How I did it
1. Added `coreId`, `corePortId` and `numVoq` field to CONFIG_DB PORT table.
2. Added `asic_id` and `asic_name` field to CONFIG_DB DEVICE_METADATA table.
### Why I did it
Consolidate the `numvoq`, `coreid`, `coreportid` to be lower case which matches other leaf node convention.

### How I did it

Rename to lower case.

#### How to verify it
No need to verify.
Copy link
Contributor

@gechiang gechiang left a comment

Choose a reason for hiding this comment

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

We should not combine two PRs into one. We should have raised two separate PRs instead of just one. This way if something went wrong we have finer way to revert/fix the issue.
For this time I will allow it... but please don't combine PRs next time. @xincunli-sonic .

@gechiang gechiang merged commit b976280 into Azure:202205 Apr 27, 2024
abdosi pushed a commit to abdosi/sonic-buildimage-msft that referenced this pull request Jun 28, 2024
…D automatically (#15610)

src/sonic-platform-daemons

* d24cca4 - (HEAD -> 202205, origin/202205) PSUD-Delete or update CHASSIS_INFO table PSU/Modules data if added or… (Azure#351) (4 days ago) [prem-nokia]
prabhataravind pushed a commit that referenced this pull request Jul 7, 2025
…lly (#21713)

#### Why I did it
src/sonic-gnmi
```
* 450bcdd - (HEAD -> master, origin/master, origin/HEAD) GNOI Implementation of OS.Activate (#351) (3 hours ago) [Dawei Huang]
* 795f7ea - Merge pull request #172 from faraazbrcm/rpc_from_proto (5 hours ago) [anand-kumar-subramanian]
* 4b2144a - Merge branch 'master' into rpc_from_proto (2 days ago) [Mohammed Faraaz]
* 913c789 - Support for YANG RPCs (11 months ago) [Mohammed Faraaz]
```
#### How I did it
#### How to verify it
#### Description for the changelog
prabhataravind pushed a commit that referenced this pull request Jul 7, 2025
…atically (#22521)

#### Why I did it
src/sonic-snmpagent
```
* 13b975b - (HEAD -> master, origin/master, origin/HEAD) [rfc1213] Handle error seen when interface counter is not available in COUNTERS_DB (#351) (4 hours ago) [SuvarnaMeenakshi]
```
#### How I did it
#### How to verify it
#### Description for the changelog
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.

2 participants