Skip to content

Commit 30254fc

Browse files
mihirpat1mssonicbld
authored andcommitted
[yang]: Modify yang model to handle subport in PORT table (sonic-net#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]>
1 parent 59aac9a commit 30254fc

File tree

5 files changed

+24
-24
lines changed

5 files changed

+24
-24
lines changed

src/sonic-yang-models/doc/Configuration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1282,7 +1282,7 @@ optional attributes.
12821282
"mtu": "9100",
12831283
"alias": "etp1a",
12841284
"speed": "100000",
1285-
"channel": 1
1285+
"subport": 1
12861286
},
12871287
"Ethernet4": {
12881288
"admin_status": "up",
@@ -1292,7 +1292,7 @@ optional attributes.
12921292
"mtu": "9100",
12931293
"alias": "etp1b",
12941294
"speed": "100000",
1295-
"channel": 2
1295+
"subport": 2
12961296
},
12971297
}
12981298
}

src/sonic-yang-models/tests/files/sample_config_db.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@
463463
"autoneg": "on",
464464
"adv_speeds": "all",
465465
"adv_interface_types": "all",
466-
"channel" : "0"
466+
"subport" : "0"
467467
},
468468
"Ethernet3": {
469469
"alias": "Eth1/4",
@@ -472,7 +472,7 @@
472472
"speed": "11100",
473473
"tpid": "0x88A8",
474474
"admin_status": "up",
475-
"channel": "1"
475+
"subport": "1"
476476
},
477477
"Ethernet4": {
478478
"alias": "Eth2/1",
@@ -481,7 +481,7 @@
481481
"speed": "11100",
482482
"tpid": "0x9100",
483483
"admin_status": "up",
484-
"channel": "2"
484+
"subport": "2"
485485
},
486486
"Ethernet5": {
487487
"alias": "Eth2/2",
@@ -490,7 +490,7 @@
490490
"speed": "11100",
491491
"tpid": "0x9200",
492492
"admin_status": "up",
493-
"channel": "3"
493+
"subport": "3"
494494
},
495495
"Ethernet6": {
496496
"alias": "Eth2/3",
@@ -499,7 +499,7 @@
499499
"speed": "11100",
500500
"tpid": "0x8100",
501501
"admin_status": "up",
502-
"channel": "4"
502+
"subport": "4"
503503
},
504504
"Ethernet7": {
505505
"alias": "Eth2/4",
@@ -508,7 +508,7 @@
508508
"speed": "11100",
509509
"tpid": "0x8100",
510510
"admin_status": "up",
511-
"channel": "5"
511+
"subport": "5"
512512
},
513513
"Ethernet8": {
514514
"alias": "Eth3/1",
@@ -517,7 +517,7 @@
517517
"speed": "11100",
518518
"tpid": "0x8100",
519519
"admin_status": "up",
520-
"channel": "6"
520+
"subport": "6"
521521
},
522522
"Ethernet9": {
523523
"alias": "Eth3/2",
@@ -526,7 +526,7 @@
526526
"speed": "11100",
527527
"tpid": "0x8100",
528528
"admin_status": "up",
529-
"channel": "7"
529+
"subport": "7"
530530
},
531531
"Ethernet10": {
532532
"alias": "Eth3/3",
@@ -535,7 +535,7 @@
535535
"speed": "11100",
536536
"tpid": "0x8100",
537537
"admin_status": "up",
538-
"channel": "8"
538+
"subport": "8"
539539
},
540540
"Ethernet11": {
541541
"alias": "Eth3/4",

src/sonic-yang-models/tests/yang_model_tests/tests/port.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,11 @@
115115
"desc": "PORT_INVALID_MULTIASIC_TEST invalid role pattern, expect fail",
116116
"eStrKey": "Pattern"
117117
},
118-
"PORT_VALID_CHANNEL_NUMBER": {
119-
"desc": "PORT_VALID_CHANNEL_NUMBER no failure."
118+
"PORT_VALID_SUBPORT_NUMBER": {
119+
"desc": "PORT_VALID_SUBPORT_NUMBER no failure."
120120
},
121-
"PORT_INVALID_CHANNEL_NUMBER": {
122-
"desc": "Out of range channel number",
121+
"PORT_INVALID_SUBPORT_NUMBER": {
122+
"desc": "Out of range subport number",
123123
"eStrKey": "Range",
124124
"eStr": "0..8"
125125
}

src/sonic-yang-models/tests/yang_model_tests/tests_config/port.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@
486486
}
487487
},
488488

489-
"PORT_INVALID_CHANNEL_NUMBER": {
489+
"PORT_INVALID_SUBPORT_NUMBER": {
490490
"sonic-port:sonic-port": {
491491
"sonic-port:PORT": {
492492
"PORT_LIST": [
@@ -495,14 +495,14 @@
495495
"alias": "etp1a",
496496
"lanes": "60, 61",
497497
"speed": 100000,
498-
"channel": 9
498+
"subport": 9
499499
}
500500
]
501501
}
502502
}
503503
},
504504

505-
"PORT_VALID_CHANNEL_NUMBER": {
505+
"PORT_VALID_SUBPORT_NUMBER": {
506506
"sonic-port:sonic-port": {
507507
"sonic-port:PORT": {
508508
"PORT_LIST": [
@@ -511,28 +511,28 @@
511511
"alias": "etp1a",
512512
"lanes": "60, 61",
513513
"speed": 100000,
514-
"channel": 1
514+
"subport": 1
515515
},
516516
{
517517
"name": "Ethernet2",
518518
"alias": "etp1b",
519519
"lanes": "62, 63",
520520
"speed": 100000,
521-
"channel": 2
521+
"subport": 2
522522
},
523523
{
524524
"name": "Ethernet4",
525525
"alias": "etp1c",
526526
"lanes": "64, 65",
527527
"speed": 100000,
528-
"channel": 3
528+
"subport": 3
529529
},
530530
{
531531
"name": "Ethernet6",
532532
"alias": "etp1d",
533533
"lanes": "66, 67",
534534
"speed": 100000,
535-
"channel": 4
535+
"subport": 4
536536
}
537537
]
538538
}

src/sonic-yang-models/yang-models/sonic-port.yang

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ module sonic-port{
121121
}
122122
}
123123

124-
leaf channel {
125-
description "Logical channel(s) for physical port breakout";
124+
leaf subport {
125+
description "Logical subport(s) for physical port breakout";
126126
type uint8 {
127127
range 0..8;
128128
}

0 commit comments

Comments
 (0)