Support TC value above 7 in yang model (#11630)

This commit is contained in:
bingwang-ms 2022-08-09 09:34:13 +08:00 committed by Ying Xie
parent 6391b0a8ee
commit b389931262
6 changed files with 83 additions and 26 deletions

View File

@ -13,6 +13,10 @@
{ {
"dscp":"2", "dscp":"2",
"tc":"2" "tc":"2"
},
{
"dscp":"8",
"tc":"8"
} }
] ]
}, },
@ -26,6 +30,10 @@
{ {
"dscp":"2", "dscp":"2",
"tc":"2" "tc":"2"
},
{
"dscp":"8",
"tc":"8"
} }
] ]
} }
@ -65,7 +73,7 @@
"DSCP_TO_TC_MAP": [ "DSCP_TO_TC_MAP": [
{ {
"dscp": "1", "dscp": "1",
"tc": "8" "tc": "16"
}, },
{ {
"dscp":"2", "dscp":"2",
@ -92,6 +100,10 @@
{ {
"dot1p":"2", "dot1p":"2",
"tc":"2" "tc":"2"
},
{
"dot1p":"3",
"tc":"8"
} }
] ]
}, },
@ -105,6 +117,10 @@
{ {
"dot1p":"2", "dot1p":"2",
"tc":"2" "tc":"2"
},
{
"dot1p":"3",
"tc":"8"
} }
] ]
} }
@ -144,7 +160,7 @@
"DOT1P_TO_TC_MAP": [ "DOT1P_TO_TC_MAP": [
{ {
"dot1p": "1", "dot1p": "1",
"tc": "8" "tc": "16"
}, },
{ {
"dot1p":"2", "dot1p":"2",
@ -171,6 +187,10 @@
{ {
"tc":"2", "tc":"2",
"qindex":"2" "qindex":"2"
},
{
"tc":"8",
"qindex":"3"
} }
] ]
}, },
@ -184,6 +204,10 @@
{ {
"tc":"2", "tc":"2",
"qindex":"2" "qindex":"2"
},
{
"tc":"8",
"qindex":"3"
} }
] ]
} }
@ -250,6 +274,10 @@
{ {
"tc":"2", "tc":"2",
"pg":"2" "pg":"2"
},
{
"tc":"8",
"pg":"3"
} }
] ]
}, },
@ -263,6 +291,10 @@
{ {
"tc":"2", "tc":"2",
"pg":"2" "pg":"2"
},
{
"tc":"8",
"pg":"3"
} }
] ]
} }
@ -487,6 +519,10 @@
{ {
"dscp":"2", "dscp":"2",
"tc":"2" "tc":"2"
},
{
"dscp":"8",
"tc":"8"
} }
] ]
} }
@ -507,6 +543,10 @@
{ {
"dot1p":"2", "dot1p":"2",
"tc":"2" "tc":"2"
},
{
"dot1p":"3",
"tc":"8"
} }
] ]
} }
@ -527,6 +567,10 @@
{ {
"tc":"2", "tc":"2",
"qindex":"2" "qindex":"2"
},
{
"tc":"8",
"qindex":"3"
} }
] ]
} }
@ -546,6 +590,10 @@
{ {
"tc":"2", "tc":"2",
"pg":"2" "pg":"2"
},
{
"tc":"8",
"pg":"3"
} }
] ]
} }
@ -643,6 +691,10 @@
{ {
"dscp":"2", "dscp":"2",
"tc":"2" "tc":"2"
},
{
"dscp":"8",
"tc":"8"
} }
] ]
} }

View File

@ -6,6 +6,10 @@ module sonic-dot1p-tc-map {
prefix dot1ptm; prefix dot1ptm;
import sonic-types {
prefix stypes;
}
organization organization
"SONiC"; "SONiC";
@ -54,12 +58,7 @@ module sonic-dot1p-tc-map {
} }
leaf tc { leaf tc {
type string { type stypes:tc_type;
pattern "[0-7]?"{
error-message "Invalid Traffic Class";
error-app-tag tc-invalid;
}
}
} }
} }
} }

View File

@ -6,6 +6,10 @@ module sonic-dscp-tc-map {
prefix dtm; prefix dtm;
import sonic-types {
prefix stypes;
}
organization organization
"SONiC"; "SONiC";
@ -54,12 +58,7 @@ module sonic-dscp-tc-map {
} }
leaf tc { leaf tc {
type string { type stypes:tc_type;
pattern "[0-7]?" {
error-message "Invalid Traffic Class";
error-app-tag tc-invalid;
}
}
} }
} }
} }

View File

@ -6,6 +6,10 @@ module sonic-tc-priority-group-map {
prefix tpgm; prefix tpgm;
import sonic-types {
prefix stypes;
}
organization organization
"SONiC"; "SONiC";
@ -45,12 +49,7 @@ module sonic-tc-priority-group-map {
key "tc"; key "tc";
leaf tc { leaf tc {
type string { type stypes:tc_type;
pattern "[0-7]?" {
error-message "Invalid Traffic Class";
error-app-tag tc-invalid;
}
}
} }
leaf pg { leaf pg {

View File

@ -6,6 +6,10 @@ module sonic-tc-queue-map {
prefix tqm; prefix tqm;
import sonic-types {
prefix stypes;
}
organization organization
"SONiC"; "SONiC";
@ -45,12 +49,7 @@ module sonic-tc-queue-map {
key "tc"; key "tc";
leaf tc { leaf tc {
type string { type stypes:tc_type;
pattern "[0-7]?" {
error-message "Invalid Traffic Class";
error-app-tag tc-invalid;
}
}
} }
leaf qindex { leaf qindex {

View File

@ -262,6 +262,15 @@ module sonic-types {
} }
} }
typedef tc_type {
type uint8 {
range "0..15" {
error-message "Invalid Traffic Class";
error-app-tag tc-invalid;
}
}
}
{% if yang_model_type == "cvl" %} {% if yang_model_type == "cvl" %}
/* Required for CVL */ /* Required for CVL */
container operation { container operation {