[yang]: sonic-yang-models updates for MPLS (#7881)

SONiC YANG model support in buildimage for MPLS:

sonic-yang-model support for MPLS enable/disable
sonic-yang-model support for MPLS CRM thresholds
This commit is contained in:
Ann Pokora 2021-09-02 13:32:27 -04:00 committed by GitHub
parent 2300a88756
commit 7c9be314e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 222 additions and 1 deletions

View File

@ -77,5 +77,43 @@
"desc": "IPMC_WITH_WRONG_THRESHOLD_TYPE pattern failure.",
"eStrKey": "Pattern",
"eStr": ["wrong" ]
},
"MPLS_INSEG_WITH_WRONG_THRESHOLD_TYPE": {
"desc": "MPLS_INSEG_WITH_WRONG_THRESHOLD_TYPE pattern failure.",
"eStrKey": "Pattern",
"eStr": ["wrong" ]
},
"MPLS_INSEG_WITH_WRONG_PERCENTAGE": {
"desc": "MPLS_INSEG_WITH_WRONG_PERCENTAGE must condition failure.",
"eStrKey": "Must"
},
"MPLS_INSEG_WITH_HIGH_THRESHOLD_ERR": {
"desc": "MPLS_INSEG_WITH_HIGH_THRESHOLD_ERR must condition failure about high threshold being lower than low threshold.",
"eStr": ["high_threshold should be more than low_threshold"]
},
"MPLS_INSEG_WITH_CORRECT_USED_VALUE": {
"desc": "MPLS_INSEG_WITH_CORRECT_USED_VALUE no failure."
},
"MPLS_INSEG_WITH_CORRECT_FREE_VALUE": {
"desc": "MPLS_INSEG_WITH_CORRECT_FREE_VALUE no failure."
},
"MPLS_NH_WITH_WRONG_THRESHOLD_TYPE": {
"desc": "MPLS_NH_WITH_WRONG_THRESHOLD_TYPE pattern failure.",
"eStrKey": "Pattern",
"eStr": ["wrong" ]
},
"MPLS_NH_WITH_WRONG_PERCENTAGE": {
"desc": "MPLS_NH_WITH_WRONG_PERCENTAGE must condition failure.",
"eStrKey": "Must"
},
"MPLS_NH_WITH_HIGH_THRESHOLD_ERR": {
"desc": "MPLS_NH_WITH_HIGH_THRESHOLD_ERR must condition failure about high threshold being lower than low threshold.",
"eStr": ["high_threshold should be more than low_threshold"]
},
"MPLS_NH_WITH_CORRECT_USED_VALUE": {
"desc": "MPLS_NH_WITH_CORRECT_USED_VALUE no failure."
},
"MPLS_NH_WITH_CORRECT_USED_VALUE": {
"desc": "MPLS_NH_WITH_CORRECT_USED_VALUE no failure."
}
}

View File

@ -218,5 +218,115 @@
}
}
}
},
"MPLS_INSEG_WITH_CORRECT_FREE_VALUE": {
"sonic-crm:sonic-crm": {
"sonic-crm:CRM": {
"Config": {
"mpls_inseg_high_threshold": 90,
"mpls_inseg_low_threshold": 70,
"mpls_inseg_threshold_type": "free"
}
}
}
},
"MPLS_INSEG_WITH_CORRECT_USED_VALUE": {
"sonic-crm:sonic-crm": {
"sonic-crm:CRM": {
"Config": {
"mpls_inseg_high_threshold": 85,
"mpls_inseg_low_threshold": 25,
"mpls_inseg_threshold_type": "used"
}
}
}
},
"MPLS_INSEG_WITH_HIGH_THRESHOLD_ERR": {
"sonic-crm:sonic-crm": {
"sonic-crm:CRM": {
"Config": {
"mpls_inseg_high_threshold": 80,
"mpls_inseg_low_threshold": 81,
"mpls_inseg_threshold_type": "PERCENTAGE"
}
}
}
},
"MPLS_INSEG_WITH_WRONG_PERCENTAGE": {
"sonic-crm:sonic-crm": {
"sonic-crm:CRM": {
"Config": {
"mpls_inseg_high_threshold": 110,
"mpls_inseg_low_threshold": 85,
"mpls_inseg_threshold_type": "PERCENTAGE"
}
}
}
},
"MPLS_INSEG_WITH_WRONG_THRESHOLD_TYPE": {
"sonic-crm:sonic-crm": {
"sonic-crm:CRM": {
"Config": {
"mpls_inseg_high_threshold": 90,
"mpls_inseg_low_threshold": 70,
"mpls_inseg_threshold_type": "wrong"
}
}
}
},
"MPLS_NH_WITH_CORRECT_FREE_VALUE": {
"sonic-crm:sonic-crm": {
"sonic-crm:CRM": {
"Config": {
"mpls_nexthop_high_threshold": 90,
"mpls_nexthop_low_threshold": 70,
"mpls_nexthop_threshold_type": "free"
}
}
}
},
"MPLS_NH_WITH_CORRECT_USED_VALUE": {
"sonic-crm:sonic-crm": {
"sonic-crm:CRM": {
"Config": {
"mpls_nexthop_high_threshold": 85,
"mpls_nexthop_low_threshold": 25,
"mpls_nexthop_threshold_type": "used"
}
}
}
},
"MPLS_NH_WITH_HIGH_THRESHOLD_ERR": {
"sonic-crm:sonic-crm": {
"sonic-crm:CRM": {
"Config": {
"mpls_nexthop_high_threshold": 80,
"mpls_nexthop_low_threshold": 81,
"mpls_nexthop_threshold_type": "PERCENTAGE"
}
}
}
},
"MPLS_NH_WITH_WRONG_PERCENTAGE": {
"sonic-crm:sonic-crm": {
"sonic-crm:CRM": {
"Config": {
"mpls_nexthop_high_threshold": 110,
"mpls_nexthop_low_threshold": 85,
"mpls_nexthop_threshold_type": "PERCENTAGE"
}
}
}
},
"MPLS_NH_WITH_WRONG_THRESHOLD_TYPE": {
"sonic-crm:sonic-crm": {
"sonic-crm:CRM": {
"Config": {
"mpls_nexthop_high_threshold": 90,
"mpls_nexthop_low_threshold": 70,
"mpls_nexthop_threshold_type": "wrong"
}
}
}
}
}
}

View File

@ -353,6 +353,58 @@ module sonic-crm {
type threshold;
}
leaf mpls_inseg_threshold_type {
description "CRM threshold support for MPLS in-segment entries";
must "(((current()='PERCENTAGE' or current()='percentage') and
../mpls_inseg_high_threshold<100 and
../mpls_inseg_low_threshold<100) or
(current()!='PERCENTAGE' and current()!='percentage'))";
type stypes:crm_threshold_type;
}
leaf mpls_inseg_high_threshold {
description "CRM threshold support for MPLS in-segment entries";
must "(current() > ../mpls_inseg_low_threshold)"
{
error-message "high_threshold should be more than low_threshold";
}
type threshold;
}
leaf mpls_inseg_low_threshold {
description "CRM threshold support for MPLS in-segment entries";
type threshold;
}
leaf mpls_nexthop_threshold_type {
description "CRM threshold support for MPLS next-hops";
must "(((current()='PERCENTAGE' or current()='percentage') and
../mpls_nexthop_high_threshold<100 and
../mpls_nexthop_low_threshold<100) or
(current()!='PERCENTAGE' and current()!='percentage'))";
type stypes:crm_threshold_type;
}
leaf mpls_nexthop_high_threshold {
description "CRM threshold support for MPLS next-hops";
must "(current() > ../mpls_nexthop_low_threshold)"
{
error-message "high_threshold should be more than low_threshold";
}
type threshold;
}
leaf mpls_nexthop_low_threshold {
description "CRM threshold support for MPLS next-hops";
type threshold;
}
}
/* end of Config */
}

View File

@ -68,6 +68,13 @@ module sonic-interface {
}
default "0";
}
leaf mpls {
description "Enable/disable MPLS routing for the interface";
type enumeration {
enum enable;
enum disable;
}
}
}
/* end of INTERFACE_LIST */

View File

@ -179,6 +179,13 @@ module sonic-portchannel {
}
default "0";
}
leaf mpls {
description "Enable/disable MPLS routing for the portchannel interface";
type enumeration {
enum enable;
enum disable;
}
}
} /* end of list PORTCHANNEL_INTERFACE_LIST */
list PORTCHANNEL_INTERFACE_IPPREFIX_LIST {

View File

@ -80,6 +80,13 @@ module sonic-vlan {
}
default "0";
}
leaf mpls {
description "Enable/disable MPLS routing for the vlan interface";
type enumeration {
enum enable;
enum disable;
}
}
}
/* end of VLAN_INTERFACE_LIST */