Skip to content

Commit c8bf9ad

Browse files
committed
[YANG] Add missing field in port qos map
<!-- Please make sure you've read and understood our contributing guidelines: https://github.com/Azure/SONiC/blob/gh-pages/CONTRIBUTING.md ** Make sure all your commits include a signature generated with `git commit -s` ** If this is a bug fix, make sure your description includes "fixes #xxxx", or "closes #xxxx" or "resolves #xxxx" Please provide the following information: --> #### Why I did it Add missing field introduced from PR: sonic-net#21395 ##### Work item tracking - Microsoft ADO **(number only)**: 31313829 #### How I did it Add the missing field #### How to verify it UT in sample_config_db.json Also test in specific DUT after merge this change. before: ``` sonic_yang(3):All Keys are not parsed in PORT_QOS_MAP dict_keys(['Ethernet16']) sonic_yang(3):exceptionList:["'tc_to_dscp_map'"] ``` after: ``` sonic_yang(6):Note: Below table(s) have no YANG models: bgpraw ``` <!-- If PR needs to be backported, then the PR must be tested against the base branch and the earliest backport release branch and provide tested image version on these two branches. For example, if the PR is requested for master, 202211 and 202012, then the requester needs to provide test results on master and 202012. --> #### Which release branch to backport (provide reason below if selected) <!-- - Note we only backport fixes to a release branch, *not* features! - Please also provide a reason for the backporting below. - e.g. - [x] 202006 --> - [ ] 201811 - [ ] 201911 - [ ] 202006 - [ ] 202012 - [ ] 202106 - [ ] 202111 - [ ] 202205 - [ ] 202211 - [ ] 202305 #### Tested branch (Please provide the tested image version) <!-- - Please provide tested image version - e.g. - [x] 20201231.100 --> - [ ] <!-- image version 1 --> - [ ] <!-- image version 2 --> #### Description for the changelog <!-- Write a short (one line) summary that describes the changes in this pull request for inclusion in the changelog: --> <!-- Ensure to add label/tag for the feature raised. example - PR#2174 under sonic-utilities repo. where, Generic Config and Update feature has been labelled as GCU. --> #### Link to config_db schema for YANG module changes <!-- Provide a link to config_db schema for the table for which YANG model is defined Link should point to correct section on https://github.com/Azure/sonic-buildimage/blob/master/src/sonic-yang-models/doc/Configuration.md --> #### A picture of a cute animal (not mandatory but encouraged)
1 parent 645a40f commit c8bf9ad

File tree

3 files changed

+45
-7
lines changed

3 files changed

+45
-7
lines changed

src/sonic-yang-models/tests/files/sample_config_db.json

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2330,6 +2330,7 @@
23302330
"Ethernet0": {
23312331
"dot1p_to_tc_map" : "Dot1p_to_tc_map1",
23322332
"dscp_to_tc_map": "Dscp_to_tc_map1",
2333+
"tc_to_dscp_map": "tc_to_dscp_map1",
23332334
"tc_to_queue_map": "tc_to_q_map1",
23342335
"tc_to_pg_map": "tc_to_pg_map1",
23352336
"pfc_to_queue_map": "pfc_prio_to_q_map1",
@@ -2341,12 +2342,13 @@
23412342
"Ethernet4": {
23422343
"dot1p_to_tc_map" : "Dot1p_to_tc_map2",
23432344
"dscp_to_tc_map": "Dscp_to_tc_map2",
2344-
"tc_to_queue_map": "tc_to_q_map2",
2345-
"tc_to_pg_map": "tc_to_pg_map2",
2346-
"pfc_to_queue_map": "pfc_prio_to_q_map2",
2347-
"pfc_to_pg_map" : "pfc_prio_to_pg_map2",
2348-
"pfc_enable" : "3,4",
2349-
"pfcwd_sw_enable" : "3,4"
2345+
"tc_to_dscp_map": "tc_to_dscp_map2",
2346+
"tc_to_queue_map": "tc_to_q_map2",
2347+
"tc_to_pg_map": "tc_to_pg_map2",
2348+
"pfc_to_queue_map": "pfc_prio_to_q_map2",
2349+
"pfc_to_pg_map" : "pfc_prio_to_pg_map2",
2350+
"pfc_enable" : "3,4",
2351+
"pfcwd_sw_enable" : "3,4"
23502352
}
23512353
},
23522354

src/sonic-yang-models/tests/yang_model_tests/tests_config/qosmaps.json

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,30 @@
530530
}
531531
},
532532

533+
"sonic-tc-dscp-map:sonic-tc-dscp-map": {
534+
"sonic-tc-dscp-map:TC_TO_DSCP_MAP": {
535+
"TC_TO_DSCP_MAP_LIST": [
536+
{
537+
"name": "map1",
538+
"TC_TO_DSCP_MAP": [
539+
{
540+
"tc": "1",
541+
"dscp": "1"
542+
},
543+
{
544+
"tc":"2",
545+
"dscp":"2"
546+
},
547+
{
548+
"tc": "8",
549+
"dscp": "8"
550+
}
551+
]
552+
}
553+
]
554+
}
555+
},
556+
533557
"sonic-dot1p-tc-map:sonic-dot1p-tc-map": {
534558
"sonic-dot1p-tc-map:DOT1P_TO_TC_MAP": {
535559
"DOT1P_TO_TC_MAP_LIST": [
@@ -681,11 +705,11 @@
681705
{
682706
"ifname": "Ethernet0",
683707
"dscp_to_tc_map": "map1",
708+
"tc_to_dscp_map": "map1",
684709
"tc_to_pg_map": "map1",
685710
"tc_to_queue_map": "map1",
686711
"pfc_to_queue_map": "map1",
687712
"pfc_to_pg_map": "map1",
688-
"dscp_to_tc_map": "map1",
689713
"dot1p_to_tc_map": "map1",
690714
"pfc_enable": "2,3,4,6",
691715
"pfcwd_sw_enable" : "2,3,4,6",

src/sonic-yang-models/yang-models/sonic-port-qos-map.yang

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ module sonic-port-qos-map {
3838
prefix sch;
3939
}
4040

41+
import sonic-tc-dscp-map {
42+
prefix tdm;
43+
}
44+
45+
4146
organization
4247
"SONiC";
4348

@@ -116,6 +121,13 @@ module sonic-port-qos-map {
116121
}
117122
}
118123

124+
leaf tc_to_dscp_map {
125+
type leafref {
126+
path "/tdm:sonic-tc-dscp-map/tdm:TC_TO_DSCP_MAP/tdm:TC_TO_DSCP_MAP_LIST/tdm:name";
127+
}
128+
}
129+
130+
119131
leaf dot1p_to_tc_map {
120132
type leafref {
121133
path "/dot1ptm:sonic-dot1p-tc-map/dot1ptm:DOT1P_TO_TC_MAP/dot1ptm:DOT1P_TO_TC_MAP_LIST/dot1ptm:name";

0 commit comments

Comments
 (0)