Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 18 additions & 8 deletions src/sonic-yang-models/tests/files/sample_config_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -1915,6 +1915,15 @@
"pbs": "2048",
"pir": "2560000",
"type": "STRICT"
},
"port_scheduler": {
"cbs": "256",
"cir": "1250000",
"meter_type": "bytes",
"pbs": "1024",
"pir": "25000000",
"type": "DWRR",
"weight": "10"
}
},

Expand Down Expand Up @@ -2079,14 +2088,15 @@
},
"PORT_QOS_MAP": {
"Ethernet0": {
"dot1p_to_tc_map" : "Dot1p_to_tc_map1",
"dscp_to_tc_map": "Dscp_to_tc_map1",
"tc_to_queue_map": "tc_to_q_map1",
"tc_to_pg_map": "tc_to_pg_map1",
"pfc_to_queue_map": "pfc_prio_to_q_map1",
"pfc_to_pg_map" : "pfc_prio_to_pg_map1",
"pfc_enable" : "3,4",
"pfcwd_sw_enable" : "3,4"
"dot1p_to_tc_map" : "Dot1p_to_tc_map1",
"dscp_to_tc_map": "Dscp_to_tc_map1",
"tc_to_queue_map": "tc_to_q_map1",
"tc_to_pg_map": "tc_to_pg_map1",
"pfc_to_queue_map": "pfc_prio_to_q_map1",
"pfc_to_pg_map" : "pfc_prio_to_pg_map1",
"pfc_enable" : "3,4",
"pfcwd_sw_enable" : "3,4",
"scheduler" : "port_scheduler"
},
"Ethernet4": {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason Ethernet0 and Ethernet4 does not have the same number of parameters as well as in one we have indentation and in the other one we dont.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@liat-grozovik
Usually, we do not have the same port configuration on different ports because we want to have different configurations on different ports to cover different scenarios.
Regarding the indentation, I fixed the indentation in port Ethernet0 because I modified it in my PR. IMO there are many indentation issues in this file, which should not be fixed in this PR because I'm focusing on missing scheduler in this PR.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK. @qiluo-msft FYI you might want to take it to the yang subgroup as a reference and to check if need to fix the file(s)

"dot1p_to_tc_map" : "Dot1p_to_tc_map2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@
"eStrKey": "LeafRef"
},

"PORT_QOS_MAP_APPLY_NON_EXISTS_SCHEDULER": {
"desc": "Configure non exists scheduler on port.",
"eStrKey": "LeafRef"
},

"PORT_QOS_MAP_APPLY_NON_EXISTS_PORT": {
"desc": "Configure port qos map entry on non exists port.",
"eStr": "Invalid value"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,24 @@
]
}
},

"sonic-scheduler:sonic-scheduler":{
"sonic-scheduler:SCHEDULER": {
"SCHEDULER_LIST": [
{
"name":"port_scheduler",
"cbs": "256",
"cir": "1250000",
"meter_type": "bytes",
"pbs": "1024",
"pir": "25000000",
"type": "DWRR",
"weight": "10"
}
]
}
},

"sonic-port-qos-map:sonic-port-qos-map": {
"sonic-port-qos-map:PORT_QOS_MAP": {
"PORT_QOS_MAP_LIST": [
Expand All @@ -670,7 +688,8 @@
"dscp_to_tc_map": "map1",
"dot1p_to_tc_map": "map1",
"pfc_enable": "2,3,4,6",
"pfcwd_sw_enable" : "2,3,4,6"
"pfcwd_sw_enable" : "2,3,4,6",
"scheduler" : "port_scheduler"
}
]
}
Expand Down Expand Up @@ -751,6 +770,35 @@
}
},

"PORT_QOS_MAP_APPLY_NON_EXISTS_SCHEDULER": {
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"admin_status": "up",
"alias": "eth0",
"description": "Ethernet0",
"lanes": "65",
"mtu": "9000",
"name": "Ethernet0",
"tpid": "0x8100",
"speed": "25000"
}
]
}
},
"sonic-port-qos-map:sonic-port-qos-map": {
"sonic-port-qos-map:PORT_QOS_MAP": {
"PORT_QOS_MAP_LIST": [
{
"ifname": "Ethernet0",
"scheduler": "scheduler1"
}
]
}
}
},

"PORT_QOS_MAP_APPLY_NON_EXISTS_PORT": {
"sonic-port:sonic-port": {
"sonic-port:PORT": {
Expand Down
11 changes: 11 additions & 0 deletions src/sonic-yang-models/yang-models/sonic-port-qos-map.yang
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ module sonic-port-qos-map {
prefix dot1ptm;
}

import sonic-scheduler {
prefix sch;
}

organization
"SONiC";

Expand Down Expand Up @@ -117,6 +121,13 @@ module sonic-port-qos-map {
path "/dot1ptm:sonic-dot1p-tc-map/dot1ptm:DOT1P_TO_TC_MAP/dot1ptm:DOT1P_TO_TC_MAP_LIST/dot1ptm:name";
}
}

leaf scheduler {
type leafref {
path "/sch:sonic-scheduler/sch:SCHEDULER/sch:SCHEDULER_LIST/sch:name"; //Reference to SCHEDULER table
}
description "Scheduler for port.";
}
}
}
}
Expand Down