From c323037815b46912d8722a365c73bbff2ff5dd1b Mon Sep 17 00:00:00 2001 From: Neetha John Date: Tue, 29 Nov 2022 10:19:06 -0800 Subject: [PATCH] Update ECN settings for storage backend (#12855) Signed-off-by: Neetha John Why I did it ECN parameters need to be updated for storage backend How I did it Included the check for storage backend devices to update qos configs How to verify it Verified that the new ecn settings are applied on storage backend device. Verified that the old ecn settings are applied for storage frontend, non storage frontend/backend devices --- .../profiles/td2/gen/BALANCED/qos.json.j2 | 22 +++++++++++++++++++ .../profiles/td2/gen/RDMA-CENTRIC/qos.json.j2 | 22 +++++++++++++++++++ .../tests/sample-arista-7050-t0-minigraph.xml | 5 +++++ .../qos-arista7050-t0-storage-backend.json | 2 +- 4 files changed, 50 insertions(+), 1 deletion(-) diff --git a/device/common/profiles/td2/gen/BALANCED/qos.json.j2 b/device/common/profiles/td2/gen/BALANCED/qos.json.j2 index 3e548325ea30..853a6f812b1d 100644 --- a/device/common/profiles/td2/gen/BALANCED/qos.json.j2 +++ b/device/common/profiles/td2/gen/BALANCED/qos.json.j2 @@ -1 +1,23 @@ +{% if ('type' in DEVICE_METADATA['localhost'] and 'BackEnd' in DEVICE_METADATA['localhost']['type'] and 'storage_device' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['storage_device'] == 'true') %} +{%- macro generate_wred_profiles() %} + "WRED_PROFILE": { + "AZURE_LOSSLESS" : { + "wred_green_enable" : "true", + "wred_yellow_enable" : "true", + "wred_red_enable" : "true", + "ecn" : "ecn_all", + "green_max_threshold" : "12000144", + "green_min_threshold" : "1048576", + "yellow_max_threshold" : "2097152", + "yellow_min_threshold" : "1048576", + "red_max_threshold" : "2097152", + "red_min_threshold" : "1048576", + "green_drop_probability" : "5", + "yellow_drop_probability": "5", + "red_drop_probability" : "5" + } + }, +{%- endmacro %} +{% endif %} + {%- include 'qos_config.j2' %} diff --git a/device/common/profiles/td2/gen/RDMA-CENTRIC/qos.json.j2 b/device/common/profiles/td2/gen/RDMA-CENTRIC/qos.json.j2 index 3e548325ea30..853a6f812b1d 100644 --- a/device/common/profiles/td2/gen/RDMA-CENTRIC/qos.json.j2 +++ b/device/common/profiles/td2/gen/RDMA-CENTRIC/qos.json.j2 @@ -1 +1,23 @@ +{% if ('type' in DEVICE_METADATA['localhost'] and 'BackEnd' in DEVICE_METADATA['localhost']['type'] and 'storage_device' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['storage_device'] == 'true') %} +{%- macro generate_wred_profiles() %} + "WRED_PROFILE": { + "AZURE_LOSSLESS" : { + "wred_green_enable" : "true", + "wred_yellow_enable" : "true", + "wred_red_enable" : "true", + "ecn" : "ecn_all", + "green_max_threshold" : "12000144", + "green_min_threshold" : "1048576", + "yellow_max_threshold" : "2097152", + "yellow_min_threshold" : "1048576", + "red_max_threshold" : "2097152", + "red_min_threshold" : "1048576", + "green_drop_probability" : "5", + "yellow_drop_probability": "5", + "red_drop_probability" : "5" + } + }, +{%- endmacro %} +{% endif %} + {%- include 'qos_config.j2' %} diff --git a/src/sonic-config-engine/tests/sample-arista-7050-t0-minigraph.xml b/src/sonic-config-engine/tests/sample-arista-7050-t0-minigraph.xml index 4d79d6f2c457..2ee9fdac8c2c 100644 --- a/src/sonic-config-engine/tests/sample-arista-7050-t0-minigraph.xml +++ b/src/sonic-config-engine/tests/sample-arista-7050-t0-minigraph.xml @@ -924,6 +924,11 @@ 10.0.0.16 + + ResourceType + + Storage + diff --git a/src/sonic-config-engine/tests/sample_output/py3/qos-arista7050-t0-storage-backend.json b/src/sonic-config-engine/tests/sample_output/py3/qos-arista7050-t0-storage-backend.json index 94aa8d8a7d1d..8070e38a0c99 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/qos-arista7050-t0-storage-backend.json +++ b/src/sonic-config-engine/tests/sample_output/py3/qos-arista7050-t0-storage-backend.json @@ -65,7 +65,7 @@ "wred_yellow_enable" : "true", "wred_red_enable" : "true", "ecn" : "ecn_all", - "green_max_threshold" : "2097152", + "green_max_threshold" : "12000144", "green_min_threshold" : "1048576", "yellow_max_threshold" : "2097152", "yellow_min_threshold" : "1048576",