Skip to content

Commit

Permalink
[yang]Update port yang model, change MTU range to [68,9216] (#12223)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
pettershao-ragilenetworks authored Oct 17, 2022
1 parent e2ae965 commit 094646c
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/sonic-yang-models/tests/yang_model_tests/tests/port.json
Original file line number Diff line number Diff line change
Expand Up @@ -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."
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion src/sonic-yang-models/yang-models/sonic-port.yang
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ module sonic-port{

leaf mtu {
type uint16 {
range 1..9216;
range 68..9216;
}
}

Expand Down

0 comments on commit 094646c

Please sign in to comment.