From 6c507329b73568988919870eb48bcc58391e2260 Mon Sep 17 00:00:00 2001 From: abdosi <58047199+abdosi@users.noreply.github.com> Date: Thu, 6 Jan 2022 16:40:50 -0800 Subject: [PATCH] Enable/Disable Order ECMP feature. (#9651) Updated Jinja2 Template in switch.json.j2 for enabling/disabling Order ECMP feature based on device role. Changes as per design: Azure/SONiC#896 --- dockers/docker-orchagent/switch.json.j2 | 7 ++++++- .../tests/sample_output/t0-switch-masic1.json | 3 ++- .../tests/sample_output/t0-switch-masic3.json | 3 ++- src/sonic-config-engine/tests/sample_output/t0-switch.json | 3 ++- src/sonic-config-engine/tests/sample_output/t1-switch.json | 3 ++- 5 files changed, 14 insertions(+), 5 deletions(-) diff --git a/dockers/docker-orchagent/switch.json.j2 b/dockers/docker-orchagent/switch.json.j2 index 4d2a0be1b0..fa0ef4b44e 100644 --- a/dockers/docker-orchagent/switch.json.j2 +++ b/dockers/docker-orchagent/switch.json.j2 @@ -20,7 +20,12 @@ "SWITCH_TABLE:switch": { "ecmp_hash_seed": "{{ hash_seed_value }}", "lag_hash_seed": "{{ hash_seed_value }}", - "fdb_aging_time": "600" + "fdb_aging_time": "600", +{% if DEVICE_METADATA.localhost.type and "LeafRouter" in DEVICE_METADATA.localhost.type %} + "ordered_ecmp": "true" +{% else %} + "ordered_ecmp": "false" +{% endif %} }, "OP": "SET" } diff --git a/src/sonic-config-engine/tests/sample_output/t0-switch-masic1.json b/src/sonic-config-engine/tests/sample_output/t0-switch-masic1.json index 34fd946da3..83ca9f50ae 100644 --- a/src/sonic-config-engine/tests/sample_output/t0-switch-masic1.json +++ b/src/sonic-config-engine/tests/sample_output/t0-switch-masic1.json @@ -3,7 +3,8 @@ "SWITCH_TABLE:switch": { "ecmp_hash_seed": "11", "lag_hash_seed": "11", - "fdb_aging_time": "600" + "fdb_aging_time": "600", + "ordered_ecmp": "true" }, "OP": "SET" } diff --git a/src/sonic-config-engine/tests/sample_output/t0-switch-masic3.json b/src/sonic-config-engine/tests/sample_output/t0-switch-masic3.json index d9f929679c..db5d1b6e4a 100644 --- a/src/sonic-config-engine/tests/sample_output/t0-switch-masic3.json +++ b/src/sonic-config-engine/tests/sample_output/t0-switch-masic3.json @@ -3,7 +3,8 @@ "SWITCH_TABLE:switch": { "ecmp_hash_seed": "13", "lag_hash_seed": "13", - "fdb_aging_time": "600" + "fdb_aging_time": "600", + "ordered_ecmp": "true" }, "OP": "SET" } diff --git a/src/sonic-config-engine/tests/sample_output/t0-switch.json b/src/sonic-config-engine/tests/sample_output/t0-switch.json index 414e53b8a3..d585ca2a52 100644 --- a/src/sonic-config-engine/tests/sample_output/t0-switch.json +++ b/src/sonic-config-engine/tests/sample_output/t0-switch.json @@ -3,7 +3,8 @@ "SWITCH_TABLE:switch": { "ecmp_hash_seed": "0", "lag_hash_seed": "0", - "fdb_aging_time": "600" + "fdb_aging_time": "600", + "ordered_ecmp": "false" }, "OP": "SET" } diff --git a/src/sonic-config-engine/tests/sample_output/t1-switch.json b/src/sonic-config-engine/tests/sample_output/t1-switch.json index fdae474251..3b3b795919 100644 --- a/src/sonic-config-engine/tests/sample_output/t1-switch.json +++ b/src/sonic-config-engine/tests/sample_output/t1-switch.json @@ -3,7 +3,8 @@ "SWITCH_TABLE:switch": { "ecmp_hash_seed": "10", "lag_hash_seed": "10", - "fdb_aging_time": "600" + "fdb_aging_time": "600", + "ordered_ecmp": "true" }, "OP": "SET" }