[YANG]: Add Yang model support for Multi ASIC port and device_metadata #351
Merged
gechiang merged 2 commits intoAzure:202205from Apr 27, 2024
Merged
Conversation
…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.
gechiang
approved these changes
Apr 27, 2024
Contributor
gechiang
left a comment
There was a problem hiding this comment.
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 .
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why I did it
Cherry pick from public repo: sonic-buildiamge:
In Multi ASIC scenario,
core_id,core_port_idandnum_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" } } }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
How I did it
core_id,core_port_idandnum_voqfield to CONFIG_DB PORT table.asic_idfield to CONFIG_DB DEVICE_METADATA table.How to verify it
Which release branch to backport (provide reason below if selected)
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)