Skip to content

Commit

Permalink
[yang]: Modify yang model to handle subport in PORT table (sonic-net#…
Browse files Browse the repository at this point in the history
…14519)

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 <[email protected]>
  • Loading branch information
mihirpat1 authored and mssonicbld committed Apr 19, 2023
1 parent 59aac9a commit 30254fc
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 @@ -1282,7 +1282,7 @@ optional attributes.
"mtu": "9100",
"alias": "etp1a",
"speed": "100000",
"channel": 1
"subport": 1
},
"Ethernet4": {
"admin_status": "up",
Expand All @@ -1292,7 +1292,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 @@ -463,7 +463,7 @@
"autoneg": "on",
"adv_speeds": "all",
"adv_interface_types": "all",
"channel" : "0"
"subport" : "0"
},
"Ethernet3": {
"alias": "Eth1/4",
Expand All @@ -472,7 +472,7 @@
"speed": "11100",
"tpid": "0x88A8",
"admin_status": "up",
"channel": "1"
"subport": "1"
},
"Ethernet4": {
"alias": "Eth2/1",
Expand All @@ -481,7 +481,7 @@
"speed": "11100",
"tpid": "0x9100",
"admin_status": "up",
"channel": "2"
"subport": "2"
},
"Ethernet5": {
"alias": "Eth2/2",
Expand All @@ -490,7 +490,7 @@
"speed": "11100",
"tpid": "0x9200",
"admin_status": "up",
"channel": "3"
"subport": "3"
},
"Ethernet6": {
"alias": "Eth2/3",
Expand All @@ -499,7 +499,7 @@
"speed": "11100",
"tpid": "0x8100",
"admin_status": "up",
"channel": "4"
"subport": "4"
},
"Ethernet7": {
"alias": "Eth2/4",
Expand All @@ -508,7 +508,7 @@
"speed": "11100",
"tpid": "0x8100",
"admin_status": "up",
"channel": "5"
"subport": "5"
},
"Ethernet8": {
"alias": "Eth3/1",
Expand All @@ -517,7 +517,7 @@
"speed": "11100",
"tpid": "0x8100",
"admin_status": "up",
"channel": "6"
"subport": "6"
},
"Ethernet9": {
"alias": "Eth3/2",
Expand All @@ -526,7 +526,7 @@
"speed": "11100",
"tpid": "0x8100",
"admin_status": "up",
"channel": "7"
"subport": "7"
},
"Ethernet10": {
"alias": "Eth3/3",
Expand All @@ -535,7 +535,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 @@ -115,11 +115,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 @@ -486,7 +486,7 @@
}
},

"PORT_INVALID_CHANNEL_NUMBER": {
"PORT_INVALID_SUBPORT_NUMBER": {
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
Expand All @@ -495,14 +495,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 @@ -511,28 +511,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 30254fc

Please sign in to comment.