Skip to content

Commit

Permalink
[swss] ecmp hash seed configurable from config_db
Browse files Browse the repository at this point in the history
Before this commit, the ECMP hash seed could only be changed through to
indirect parameters in DEVICE_METADATA:
- type (10 for LeafRouter, 25 for SpineRouter, etc...)
- namespace_id: the value is used as an offset

This commit brings the possibility to enforce the ECMP hash seed from
config_db.json via the new 'ecmp_hash_seed' field. If defined:
- the value deduced from the 'type' is ignored
- the namespace_id is still used as an offset

It is particularly useful to fix ECMP polarization issue, especially
when having more than 3 layers in a clos matrix.
  • Loading branch information
kpetremann committed Nov 27, 2024
1 parent 8dbd012 commit ecfaa71
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dockers/docker-orchagent/switch.json.j2
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
{# set default hash seed to 0 #}
{% set hash_seed = 0 %}
{% set hash_seed_offset = 0 %}
{% if DEVICE_METADATA.localhost.type %}
{% if DEVICE_METADATA.localhost.ecmp_hash_seed %}
{% set hash_seed = DEVICE_METADATA.localhost.ecmp_hash_seed | int %}
{% elif DEVICE_METADATA.localhost.type %}
{% if "ToRRouter" in DEVICE_METADATA.localhost.type or DEVICE_METADATA.localhost.type in ["EPMS", "MgmtTsToR"] %}
{% set hash_seed = 0 %}
{% elif "LeafRouter" in DEVICE_METADATA.localhost.type %}
Expand Down

0 comments on commit ecfaa71

Please sign in to comment.