Skip to content

Commit a035b2c

Browse files
Update YANG for PORT_QOS_MAP to support switch level mapping (#11089)
Signed-off-by: bingwang <[email protected]> Co-authored-by: Neetha John <[email protected]>
1 parent e207862 commit a035b2c

File tree

3 files changed

+48
-6
lines changed

3 files changed

+48
-6
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@
8686
"PORT_QOS_MAP_APPLY_MAPS": {
8787
"desc": "Configure qos maps on port."
8888
},
89+
90+
"PORT_QOS_MAP_APPLY_MAP_TO_GLOBAL": {
91+
"desc": "Configure qos maps on switch level."
92+
},
8993

9094
"PORT_QOS_MAP_APPLY_NON_EXISTS_MAPS": {
9195
"desc": "Configure non exists qos maps on port.",
@@ -94,7 +98,7 @@
9498

9599
"PORT_QOS_MAP_APPLY_NON_EXISTS_PORT": {
96100
"desc": "Configure port qos map entry on non exists port.",
97-
"eStrKey": "LeafRef"
101+
"eStr": "Invalid value"
98102
},
99103

100104
"PORT_QOS_MAP_APPLY_INVALID_PFC": {

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

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,39 @@
629629
}
630630
},
631631

632+
"PORT_QOS_MAP_APPLY_MAP_TO_GLOBAL": {
633+
"sonic-dscp-tc-map:sonic-dscp-tc-map": {
634+
"sonic-dscp-tc-map:DSCP_TO_TC_MAP": {
635+
"DSCP_TO_TC_MAP_LIST": [
636+
{
637+
"name": "map1",
638+
"DSCP_TO_TC_MAP": [
639+
{
640+
"dscp": "1",
641+
"tc": "1"
642+
},
643+
{
644+
"dscp":"2",
645+
"tc":"2"
646+
}
647+
]
648+
}
649+
]
650+
}
651+
},
652+
653+
"sonic-port-qos-map:sonic-port-qos-map": {
654+
"sonic-port-qos-map:PORT_QOS_MAP": {
655+
"PORT_QOS_MAP_LIST": [
656+
{
657+
"ifname": "global",
658+
"dscp_to_tc_map": "map1"
659+
}
660+
]
661+
}
662+
}
663+
},
664+
632665
"PORT_QOS_MAP_APPLY_NON_EXISTS_MAPS": {
633666
"sonic-port:sonic-port": {
634667
"sonic-port:PORT": {

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

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,16 @@ module sonic-port-qos-map {
5656
key "ifname";
5757

5858
leaf ifname {
59-
type leafref {
60-
path "/prt:sonic-port/prt:PORT/prt:PORT_LIST/prt:name";
61-
}
62-
description
63-
"Reference of port on which QOS MAPS to be configured.";
59+
type union {
60+
type string {
61+
pattern "global";
62+
}
63+
type leafref {
64+
path "/prt:sonic-port/prt:PORT/prt:PORT_LIST/prt:name";
65+
}
66+
}
67+
description
68+
"Reference of port or global on which QOS MAPS to be configured.";
6469
}
6570

6671
leaf tc_to_pg_map {

0 commit comments

Comments
 (0)