Skip to content

Commit

Permalink
qos template change for backend compute-ai deployment (sonic-net#16150)
Browse files Browse the repository at this point in the history
#### Why I did it

To enable qos config for a certain backend deployment mode, for resource-type "Compute-AI".
This deployment has the following requirement:

- Config below enabled if DEVICE_TYPE as one of backend_device_types
- Config below enabled if ResourceType is 'Compute-AI'
- 2 lossless TCs' (2, 3)
- 2 lossy TCs' (0,1)
- DSCP to TC map uses 4 DSCP code points and maps to the TCs' as follows:
   "DSCP_TO_TC_MAP": {
        "AZURE": {
             "48" : "0",
            "46" : "1",
            "3"  : "3",
            "4"  : "4"
        }
    }

- WRED profile has green {min/max/mark%} as {2M/10M/5%}

This required template change <as in the PR> in addition to the vendor qos.json.j2 file (not included here).

### How I did it

#### How to verify it
- with the above change and the vendor config change, generated the qos.json file and verified that the objective stated in "Why I did it" was met

- verified no error

### Description for the changelog
Update qos_config.j2 for Comptue-AI deployment on one of backend device type roles
  • Loading branch information
alpeshspatel authored and mssonicbld committed Sep 21, 2023
1 parent 996ce9b commit 4ee9565
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions files/build_templates/qos_config.j2
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@
{
{% if (generate_tc_to_pg_map is defined) and tunnel_qos_remap_enable %}
{{- generate_tc_to_pg_map() }}
{% elif (generate_tc_to_pg_map is defined) and
('type' in DEVICE_METADATA['localhost'] and
DEVICE_METADATA['localhost']['type'] in backend_device_types) and
('resource_type' in DEVICE_METADATA['localhost'] and
DEVICE_METADATA['localhost']['resource_type'] == 'Compute-AI') %}
{{- generate_tc_to_pg_map() }}
{% else %}
"TC_TO_PRIORITY_GROUP_MAP": {
"AZURE": {
Expand Down Expand Up @@ -137,6 +143,12 @@
},
{% elif (generate_dscp_to_tc_map is defined) and tunnel_qos_remap_enable %}
{{- generate_dscp_to_tc_map() }}
{% elif (generate_dscp_to_tc_map is defined) and
('type' in DEVICE_METADATA['localhost'] and
DEVICE_METADATA['localhost']['type'] in backend_device_types) and
('resource_type' in DEVICE_METADATA['localhost'] and
DEVICE_METADATA['localhost']['resource_type'] == 'Compute-AI') %}
{{- generate_dscp_to_tc_map() }}
{% else %}
"DSCP_TO_TC_MAP": {
"AZURE": {
Expand Down Expand Up @@ -225,6 +237,29 @@
"weight": "100"
}
},
{% elif (generate_tc_to_pg_map is defined) and
('type' in DEVICE_METADATA['localhost'] and
DEVICE_METADATA['localhost']['type'] in backend_device_types) and
('resource_type' in DEVICE_METADATA['localhost'] and
DEVICE_METADATA['localhost']['resource_type'] == 'Compute-AI') %}
"SCHEDULER": {
"scheduler.0": {
"type" : "DWRR",
"weight": "40"
},
"scheduler.1": {
"type" : "DWRR",
"weight": "30"
},
"scheduler.2": {
"type" : "DWRR",
"weight": "25"
},
"scheduler.3": {
"type" : "DWRR",
"weight": "5"
}
},
{% else %}
"SCHEDULER": {
"scheduler.0": {
Expand Down Expand Up @@ -368,6 +403,27 @@
}
{% else %}
"QUEUE": {
{% if 'type' in DEVICE_METADATA['localhost'] and
DEVICE_METADATA['localhost']['type'] in backend_device_types and
'resource_type' in DEVICE_METADATA['localhost'] and
DEVICE_METADATA['localhost']['resource_type'] == 'Compute-AI' %}
{% for port in PORT_ACTIVE %}
"{{ port }}|0": {
"scheduler": "scheduler.0"
},
"{{ port }}|1": {
"scheduler": "scheduler.1"
},
"{{ port }}|3": {
"scheduler" : "scheduler.2",
"wred_profile": "AZURE_LOSSLESS"
},
"{{ port }}|4": {
"scheduler" : "scheduler.3",
"wred_profile": "AZURE_LOSSLESS"
}{% if not loop.last %},{% endif %}
{% endfor %}
{% else %}
{% for port in PORT_ACTIVE %}
"{{ port }}|3": {
"scheduler" : "scheduler.1",
Expand Down Expand Up @@ -431,6 +487,7 @@
}{% if not loop.last %},{% endif %}

{% endfor %}
{% endif %}
}
{% endif %}
}

0 comments on commit 4ee9565

Please sign in to comment.