Skip to content

Commit

Permalink
Add flag to control the generation of PORT_QOS_MAP|global entry (#1…
Browse files Browse the repository at this point in the history
…1448)

Why I did it
This PR is to add a flag to control whether to generate PORT_QOS_MAP|global entry or not.
It's because for some HWSKU, such as BackEndToRRouter and BackEndLeafRouter, there is no DSCP_TO_TC_MAP defined.
Hence, if the PORT_QOS_MAP|global entry is generated, OA will report some error because the DSCP_TO_TC_MAP map AZURE can not be found.

Jul 14 00:24:40.286767 str2-7050qx-32s-acs-03 ERR swss#orchagent: :- saiObjectTypeQuery: invalid object id oid:0x7fddb43605d0
Jul 14 00:24:40.286767 str2-7050qx-32s-acs-03 ERR swss#orchagent: :- meta_generic_validation_objlist: SAI_SWITCH_ATTR_QOS_DSCP_TO_TC_MAP:SAI_ATTR_VALUE_TYPE_OBJECT_ID object on list [0] oid 0x7fddb43605d0 is not valid, returned null object id
Jul 14 00:24:40.286767 str2-7050qx-32s-acs-03 ERR swss#orchagent: :- applyDscpToTcMapToSwitch: Failed to apply DSCP_TO_TC QoS map to switch rv:-5
Jul 14 00:24:40.286767 str2-7050qx-32s-acs-03 ERR swss#orchagent: :- doTask: Failed to process QOS task, drop it
This PR is to address the issue.

How I did it
Add a flag require_global_dscp_to_tc_map to control whether to generate the PORT_QOS_MAP|global entry. The default value for require_global_dscp_to_tc_map is true. If the device type is storage backend, the value is changed to false. Then the PORT_QOS_MAP|global entry is not generated.

How to verify it
Update the current test_qos_dscp_remapping_render_template to cover storage backend.
  • Loading branch information
bingwang-ms authored and yxieca committed Jul 17, 2022
1 parent aa63d31 commit f7cc66a
Show file tree
Hide file tree
Showing 4 changed files with 871 additions and 4 deletions.
4 changes: 3 additions & 1 deletion files/build_templates/qos_config.j2
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
{%- set backend_device_types = ['BackEndToRRouter', 'BackEndLeafRouter'] -%}
{%- set apollo_resource_types = ['DL-NPU-Apollo'] -%}

{%- set require_global_dscp_to_tc_map = true -%}

{
{% if (generate_tc_to_pg_map is defined) and tunnel_qos_remap_enable %}
Expand Down Expand Up @@ -94,6 +95,7 @@
},
{% endif %}
{% if 'type' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['type'] in backend_device_types and 'storage_device' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['storage_device'] == 'true' %}
{%- set require_global_dscp_to_tc_map = false %}
"DOT1P_TO_TC_MAP": {
"AZURE": {
"0": "1",
Expand Down Expand Up @@ -219,7 +221,7 @@
"PORT_QOS_MAP": {
{% if generate_global_dscp_to_tc_map is defined %}
{{- generate_global_dscp_to_tc_map() }}
{% else %}
{% elif require_global_dscp_to_tc_map %}
"global": {
"dscp_to_tc_map" : "AZURE"
}{% if PORT_ACTIVE %},{% endif %}
Expand Down
Loading

0 comments on commit f7cc66a

Please sign in to comment.