Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ECMP][Multi-ASIC] Have different ECMP seed value on each ASIC #5357

Merged
merged 4 commits into from
Oct 8, 2020

Conversation

smaheshm
Copy link
Contributor

@smaheshm smaheshm commented Sep 10, 2020

- Why I did it

Create different ECMP seed value on each ASIC to reduce probability of traffic hot spots within the multi ASIC switch.

- How I did it

Create ECMP seed value based on the name space ID.

- How to verify it

Unit tests and manual verification on multi ASIC switch.

admin@str-n3164-acs-2:~$ docker exec  swss0 cat /etc/swss/config.d/switch.json
[
    {
        "SWITCH_TABLE:switch": {
            "ecmp_hash_seed": "10",
            "lag_hash_seed": "10",
            "fdb_aging_time": "600"
        },
        "OP": "SET"
    }
]

admin@str-n3164-acs-2:~$ docker exec  swss1 cat /etc/swss/config.d/switch.json                                                                                                       
[
    {
        "SWITCH_TABLE:switch": {
            "ecmp_hash_seed": "11",
            "lag_hash_seed": "11",
            "fdb_aging_time": "600"
        },
        "OP": "SET"
    }
]

admin@str-n3164-acs-2:~$ docker exec  swss2 cat /etc/swss/config.d/switch.json                                                                                                       
[
    {
        "SWITCH_TABLE:switch": {
            "ecmp_hash_seed": "12",
            "lag_hash_seed": "12",
            "fdb_aging_time": "600"
        },
        "OP": "SET"
    }
]

admin@str-n3164-acs-2:~$ docker exec  swss3 cat /etc/swss/config.d/switch.json                                                                                                       
[
    {
        "SWITCH_TABLE:switch": {
            "ecmp_hash_seed": "13",
            "lag_hash_seed": "13",
            "fdb_aging_time": "600"
        },
        "OP": "SET"
    }
]

admin@str-n3164-acs-2:~$ docker exec  swss4 cat /etc/swss/config.d/switch.json                                                                                                       
[
    {
        "SWITCH_TABLE:switch": {
            "ecmp_hash_seed": "14",
            "lag_hash_seed": "14",
            "fdb_aging_time": "600"
        },
        "OP": "SET"
    }
]

admin@str-n3164-acs-2:~$ docker exec  swss5 cat /etc/swss/config.d/switch.json                                                                                                       
[
    {
        "SWITCH_TABLE:switch": {
            "ecmp_hash_seed": "15",
            "lag_hash_seed": "15",
            "fdb_aging_time": "600"
        },
        "OP": "SET"
    }
]

- Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006

- Description for the changelog

sonic-cfggen:

  • Added "namespace_id" in device metadata:

"DEVICE_METADATA': { 'localhost': {'namespace_id': ""}}"

switch.json.j2:

  • Update ECMP seed value based on the "namespace_id" value.

- A picture of a cute animal (not mandatory but encouraged)

@smaheshm
Copy link
Contributor Author

@lguohan @prsunny This PR generates different values of ECMP seed for each ASIC. After discussion within our team it was suggested to use same hash seed for all front end ASICs and another value for backend ASICs, but same value on all backend ASICs.
Following the current tier model it would make sense to have ECMP seed values based on the tier the ASIC is connected to.

  • Front end ASICs - tier0
  • Front end ASICs - tier2
  • Back ASICs.

comments?

@prsunny
Copy link
Contributor

prsunny commented Sep 18, 2020

@lguohan @prsunny This PR generates different values of ECMP seed for each ASIC. After discussion within our team it was suggested to use same hash seed for all front end ASICs and another value for backend ASICs, but same value on all backend ASICs.
Following the current tier model it would make sense to have ECMP seed values based on the tier the ASIC is connected to.

  • Front end ASICs - tier0
  • Front end ASICs - tier2
  • Back ASICs.

comments?

lgtm, @lguohan , could you comment?

@smaheshm
Copy link
Contributor Author

@lguohan @prsunny This PR generates different values of ECMP seed for each ASIC. After discussion within our team it was suggested to use same hash seed for all front end ASICs and another value for backend ASICs, but same value on all backend ASICs.
Following the current tier model it would make sense to have ECMP seed values based on the tier the ASIC is connected to.

  • Front end ASICs - tier0
  • Front end ASICs - tier2
  • Back ASICs.

comments?

lgtm, @lguohan , could you comment?

Challenge is to determine if ASIC has ports connected to tier0 or tier2. It's possible ASIC has ports connected to both tiers. If we use same seed for front end ASICs and a different seed for backend ASICs, is there an issue with this approach.

@lguohan
Copy link
Collaborator

lguohan commented Oct 7, 2020

i think the potential issues is that the hash seed should be decided by the layer and namespace id.

@smaheshm
Copy link
Contributor Author

smaheshm commented Oct 8, 2020

i think the potential issues is that the hash seed should be decided by the layer and namespace id.

That's how it is in this PR. ECMP seed generated is different in each namespace. The concern raised was:

  • a flow entering different ASICs will have different outgoing ports.

If this is not a concern then this PR is ready for review.

@smaheshm smaheshm merged commit 744612d into sonic-net:master Oct 8, 2020
abdosi pushed a commit that referenced this pull request Oct 13, 2020
* Calculate ECMP hash seed based on ASIC ID on multi ASIC platform. Each ASIC will have a unique ECMP hash seed value.

Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
@smaheshm smaheshm deleted the ecmp-hash-seed branch December 15, 2020 22:28
santhosh-kt pushed a commit to santhosh-kt/sonic-buildimage that referenced this pull request Feb 25, 2021
…-net#5357)

* Calculate ECMP hash seed based on ASIC ID on multi ASIC platform. Each ASIC will have a unique ECMP hash seed value.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants