Skip to content

Commit

Permalink
[yang]: Modify yang model to handle subport in PORT table (#14519)
Browse files Browse the repository at this point in the history
Based on the port breakout HLD, we are now using subport instead of channel in the CONFIG_DB PORT table to handle port breakout. The yang schema needs to be modified accordingly to handle the corresponding change.
The corresponding code changes have been merged through sonic-net/sonic-platform-daemons/pull/342 merged

Signed-off-by: Mihir Patel <patelmi@microsoft.com>
  • Loading branch information
mihirpat1 authored Apr 6, 2023
1 parent 990993e commit 63cee3f
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 24 deletions.
4 changes: 2 additions & 2 deletions src/sonic-yang-models/doc/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -1501,7 +1501,7 @@ optional attributes.
"mtu": "9100",
"alias": "etp1a",
"speed": "100000",
"channel": 1
"subport": 1
},
"Ethernet4": {
"admin_status": "up",
Expand All @@ -1511,7 +1511,7 @@ optional attributes.
"mtu": "9100",
"alias": "etp1b",
"speed": "100000",
"channel": 2
"subport": 2
},
}
}
Expand Down
18 changes: 9 additions & 9 deletions src/sonic-yang-models/tests/files/sample_config_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@
"autoneg": "on",
"adv_speeds": "all",
"adv_interface_types": "all",
"channel" : "0"
"subport" : "0"
},
"Ethernet3": {
"alias": "Eth1/4",
Expand All @@ -568,7 +568,7 @@
"speed": "11100",
"tpid": "0x88A8",
"admin_status": "up",
"channel": "1"
"subport": "1"
},
"Ethernet4": {
"alias": "Eth2/1",
Expand All @@ -577,7 +577,7 @@
"speed": "11100",
"tpid": "0x9100",
"admin_status": "up",
"channel": "2"
"subport": "2"
},
"Ethernet5": {
"alias": "Eth2/2",
Expand All @@ -586,7 +586,7 @@
"speed": "11100",
"tpid": "0x9200",
"admin_status": "up",
"channel": "3"
"subport": "3"
},
"Ethernet6": {
"alias": "Eth2/3",
Expand All @@ -595,7 +595,7 @@
"speed": "11100",
"tpid": "0x8100",
"admin_status": "up",
"channel": "4"
"subport": "4"
},
"Ethernet7": {
"alias": "Eth2/4",
Expand All @@ -604,7 +604,7 @@
"speed": "11100",
"tpid": "0x8100",
"admin_status": "up",
"channel": "5"
"subport": "5"
},
"Ethernet8": {
"alias": "Eth3/1",
Expand All @@ -613,7 +613,7 @@
"speed": "11100",
"tpid": "0x8100",
"admin_status": "up",
"channel": "6"
"subport": "6"
},
"Ethernet9": {
"alias": "Eth3/2",
Expand All @@ -622,7 +622,7 @@
"speed": "11100",
"tpid": "0x8100",
"admin_status": "up",
"channel": "7"
"subport": "7"
},
"Ethernet10": {
"alias": "Eth3/3",
Expand All @@ -631,7 +631,7 @@
"speed": "11100",
"tpid": "0x8100",
"admin_status": "up",
"channel": "8"
"subport": "8"
},
"Ethernet11": {
"alias": "Eth3/4",
Expand Down
8 changes: 4 additions & 4 deletions src/sonic-yang-models/tests/yang_model_tests/tests/port.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,11 @@
"desc": "PORT_INVALID_MULTIASIC_TEST invalid role pattern, expect fail",
"eStrKey": "Pattern"
},
"PORT_VALID_CHANNEL_NUMBER": {
"desc": "PORT_VALID_CHANNEL_NUMBER no failure."
"PORT_VALID_SUBPORT_NUMBER": {
"desc": "PORT_VALID_SUBPORT_NUMBER no failure."
},
"PORT_INVALID_CHANNEL_NUMBER": {
"desc": "Out of range channel number",
"PORT_INVALID_SUBPORT_NUMBER": {
"desc": "Out of range subport number",
"eStrKey": "Range",
"eStr": "0..8"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@
}
},

"PORT_INVALID_CHANNEL_NUMBER": {
"PORT_INVALID_SUBPORT_NUMBER": {
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
Expand All @@ -525,14 +525,14 @@
"alias": "etp1a",
"lanes": "60, 61",
"speed": 100000,
"channel": 9
"subport": 9
}
]
}
}
},

"PORT_VALID_CHANNEL_NUMBER": {
"PORT_VALID_SUBPORT_NUMBER": {
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
Expand All @@ -541,28 +541,28 @@
"alias": "etp1a",
"lanes": "60, 61",
"speed": 100000,
"channel": 1
"subport": 1
},
{
"name": "Ethernet2",
"alias": "etp1b",
"lanes": "62, 63",
"speed": 100000,
"channel": 2
"subport": 2
},
{
"name": "Ethernet4",
"alias": "etp1c",
"lanes": "64, 65",
"speed": 100000,
"channel": 3
"subport": 3
},
{
"name": "Ethernet6",
"alias": "etp1d",
"lanes": "66, 67",
"speed": 100000,
"channel": 4
"subport": 4
}
]
}
Expand Down
4 changes: 2 additions & 2 deletions src/sonic-yang-models/yang-models/sonic-port.yang
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ module sonic-port{
}
}

leaf channel {
description "Logical channel(s) for physical port breakout";
leaf subport {
description "Logical subport(s) for physical port breakout";
type uint8 {
range 0..8;
}
Expand Down

0 comments on commit 63cee3f

Please sign in to comment.