Skip to content

Commit 8295675

Browse files
authored
[YANG] Add missing field in port qos map (#21677)
[YANG] Add missing field in port qos map
1 parent b695290 commit 8295675

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
@@ -2341,6 +2341,7 @@
23412341
"Ethernet0": {
23422342
"dot1p_to_tc_map" : "Dot1p_to_tc_map1",
23432343
"dscp_to_tc_map": "Dscp_to_tc_map1",
2344+
"tc_to_dscp_map": "tc_to_dscp_map1",
23442345
"tc_to_queue_map": "tc_to_q_map1",
23452346
"tc_to_pg_map": "tc_to_pg_map1",
23462347
"pfc_to_queue_map": "pfc_prio_to_q_map1",
@@ -2352,12 +2353,13 @@
23522353
"Ethernet4": {
23532354
"dot1p_to_tc_map" : "Dot1p_to_tc_map2",
23542355
"dscp_to_tc_map": "Dscp_to_tc_map2",
2355-
"tc_to_queue_map": "tc_to_q_map2",
2356-
"tc_to_pg_map": "tc_to_pg_map2",
2357-
"pfc_to_queue_map": "pfc_prio_to_q_map2",
2358-
"pfc_to_pg_map" : "pfc_prio_to_pg_map2",
2359-
"pfc_enable" : "3,4",
2360-
"pfcwd_sw_enable" : "3,4"
2356+
"tc_to_dscp_map": "tc_to_dscp_map2",
2357+
"tc_to_queue_map": "tc_to_q_map2",
2358+
"tc_to_pg_map": "tc_to_pg_map2",
2359+
"pfc_to_queue_map": "pfc_prio_to_q_map2",
2360+
"pfc_to_pg_map" : "pfc_prio_to_pg_map2",
2361+
"pfc_enable" : "3,4",
2362+
"pfcwd_sw_enable" : "3,4"
23612363
}
23622364
},
23632365

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)