Skip to content

Commit

Permalink
[DPB][YANG-models] extended regex pattern according to Mellanox syste…
Browse files Browse the repository at this point in the history
…ms 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>
  • Loading branch information
vadymhlushko-mlnx authored Jan 17, 2021
1 parent 063e11c commit 1ea5fd7
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,14 @@ def initTest(self):
'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']
}
}

Expand Down
58 changes: 57 additions & 1 deletion src/sonic-yang-models/tests/yang_model_tests/yangTest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
]
}
}
}
}
2 changes: 1 addition & 1 deletion src/sonic-yang-models/yang-models/sonic-breakout_cfg.yang
Original file line number Diff line number Diff line change
Expand Up @@ -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\]';
}
}
}
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 @@ -63,7 +63,7 @@ module sonic-port{
leaf speed {
mandatory true;
type uint32 {
range 1..100000;
range 1..400000;
}
}

Expand Down

0 comments on commit 1ea5fd7

Please sign in to comment.