[yang]Update port yang model, change MTU range to [68,9216] (#12223)

What I did
Filter port invalid MTU configuration

How I did it
Adjust the MTU value to the range of [68,9216]

How to verify it
Use "config interface mtu Ethernet1 40" command to configure the port MTU. The following error will occur in SWSS.
This commit is contained in:
pettershao-ragilenetworks 2022-10-17 08:02:31 +08:00 committed by GitHub
parent e2ae965fdd
commit 094646c6bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 37 additions and 1 deletions

View File

@ -13,6 +13,12 @@
"eStrKey" : "Pattern",
"eStr": ["rc"]
},
"PORT_VALID_MTU_TEST_1": {
"desc": "PORT_VALID_MTU_TEST_1 no failure."
},
"PORT_VALID_MTU_TEST_2": {
"desc": "PORT_VALID_MTU_TEST_2 no failure."
},
"PORT_VALID_AUTONEG_TEST_1": {
"desc": "PORT_VALID_AUTONEG_TEST_1 no failure."
},

View File

@ -39,6 +39,36 @@
}
}
},
"PORT_VALID_MTU_TEST_1": {
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"name": "Ethernet8",
"alias": "eth8",
"lanes": "65",
"speed": 25000,
"mtu": 68
}
]
}
}
},
"PORT_VALID_MTU_TEST_2": {
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"name": "Ethernet8",
"alias": "eth8",
"lanes": "65",
"speed": 25000,
"mtu": 9216
}
]
}
}
},
"PORT_VALID_AUTONEG_TEST_1": {
"sonic-port:sonic-port": {
"sonic-port:PORT": {

View File

@ -117,7 +117,7 @@ module sonic-port{
leaf mtu {
type uint16 {
range 1..9216;
range 68..9216;
}
}