[DPB][YANG-models] extended regex pattern according to Mellanox systems speeds requirements (#6279)

[DPB][MLNX][YANG] fixed range of max speed

- Why I did it
All Mellanox platforms require DPB modes with a specific set of speeds example

- How I did it
Extended regex pattern inside YANG model.
Supported platforms: SN2010, SN2100, SN2410, SN2700, SN3420, SN3700, SN3700C, SN3800, SN4600C, SN4410, SN4700

- How to verify it
Manually tested DPB CLI on all platform with all modes

Signed-off-by: Vadym Hlushko <vadymh@nvidia.com>
This commit is contained in:
Vadym Hlushko 2021-01-17 10:39:40 +02:00 committed by GitHub
parent 063e11cce1
commit 1ea5fd7c70
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 67 additions and 3 deletions

View File

@ -221,6 +221,14 @@ class Test_yang_models:
'DEVICE_METADATA_TYPE_INCORRECT_PATTERN': {
'desc': 'DEVICE_METADATA_TYPE_INCORRECT_PATTERN pattern failure.',
'eStr': self.defaultYANGFailure['Pattern']
},
'BREAKOUT_CFG_CORRECT_MODES': {
'desc': 'BREAKOUT_CFG correct breakout modes',
'eStr': self.defaultYANGFailure['None']
},
'BREAKOUT_CFG_INCORRECT_MODES': {
'desc': 'BREAKOUT_CFG wrong breakout modes',
'eStr': self.defaultYANGFailure['Pattern']
}
}

View File

@ -1749,5 +1749,61 @@
"UNKNOWN_TABLE": {
"Error": "This Table is for testing, This Table does not have YANG models."
}
}
},
"BREAKOUT_CFG_CORRECT_MODES": {
"sonic-breakout_cfg:sonic-breakout_cfg": {
"sonic-breakout_cfg:BREAKOUT_CFG": {
"BREAKOUT_CFG_LIST": [
{
"brkout_mode": "1x200G[100G,50G,40G,25G,10G,1G]",
"port": "Ethernet0"
},
{
"brkout_mode": "2x100G[50G,40G,25G,10G,1G]",
"port": "Ethernet8"
},
{
"brkout_mode": "4x50G[40G,25G,10G,1G]",
"port": "Ethernet4"
},
{
"brkout_mode": "1x25G[10G]",
"port": "Ethernet12"
},
{
"brkout_mode": "1x100G[50G,40G,25G,10G]",
"port": "Ethernet16"
},
{
"brkout_mode": "2x50G[40G,25G,10G]",
"port": "Ethernet20"
},
{
"brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]",
"port": "Ethernet24"
}
]
}
}
},
"BREAKOUT_CFG_INCORRECT_MODES": {
"sonic-breakout_cfg:sonic-breakout_cfg": {
"sonic-breakout_cfg:BREAKOUT_CFG": {
"BREAKOUT_CFG_LIST": [
{
"brkout_mode": "1x500G[100G,50G,40G,25G,10G,1G]",
"port": "Ethernet0"
},
{
"brkout_mode": "2x300G[50G,40G,25G,1G]",
"port": "Ethernet8"
},
{
"brkout_mode": "5x50G[40G,25G]",
"port": "Ethernet4"
}
]
}
}
}
}

View File

@ -51,7 +51,7 @@ module sonic-breakout_cfg {
* Add any other breakout-mode to allow Dynamic Port
* Breakout to that breakout-mode.
*/
pattern '1x100G\[40G\]|2x50G|4x25G\[10G\]|2x25G\(2\)\+1x50G\(2\)|1x50G\(2\)\+2x25G\(2\)|1x400G|2x200G|4x100G|8x50G';
pattern '1x100G\[40G\]|2x50G|4x25G\[10G\]|2x25G\(2\)\+1x50G\(2\)|1x50G\(2\)\+2x25G\(2\)|1x400G|2x200G|4x100G|8x50G|1x200G\[100G,50G,40G,25G,10G,1G\]|2x100G\[50G,40G,25G,10G,1G\]|4x50G\[40G,25G,10G,1G\]|1x25G\[10G\]|1x100G\[50G,40G,25G,10G\]|2x50G\[40G,25G,10G\]|4x25G\[10G\]|1x25G\[10G,1G\]|1x100G\[50G,40G,25G,10G,1G\]|2x50G\[40G,25G,10G,1G\]|4x25G\[10G,1G\]|1x400G\[200G,100G,50G,40G,25G,10G,1G\]|2x200G\[100G,50G,40G,25G,10G,1G\]|4x100G\[50G,40G,25G,10G,1G\]';
}
}
}

View File

@ -63,7 +63,7 @@ module sonic-port{
leaf speed {
mandatory true;
type uint32 {
range 1..100000;
range 1..400000;
}
}