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

Add support for ECMP and LAG hash offset #3138

Merged
merged 4 commits into from
May 14, 2024

Conversation

kperumalbfn
Copy link
Contributor

@kperumalbfn kperumalbfn commented May 8, 2024

What I did
Add support to update ECMP and LAG hash offset. Orchagent checks for SAI attribute capability and configure the offset values.

Why I did it
To avoid ECMP hash imbalance across T0 and T1s, different hash offsets can be configured.

How I verified it
sonic-mgmt tests ipfwd/test_nhop_group.py

sonic-mgmt PR to update the existing test with the nexthop rewrites after default hash_offset changes: sonic-net/sonic-mgmt#12765

orchagent/switchorch.cpp Outdated Show resolved Hide resolved
orchagent/switchorch.cpp Outdated Show resolved Hide resolved
orchagent/switchorch.cpp Outdated Show resolved Hide resolved
tests/test_switch.py Show resolved Hide resolved
@prsunny prsunny merged commit 2f8bd9c into sonic-net:master May 14, 2024
17 checks passed
@kperumalbfn kperumalbfn deleted the kperumal/ecmp_lag_hash branch May 15, 2024 00:24
lguohan pushed a commit to sonic-net/sonic-buildimage that referenced this pull request May 21, 2024
To avoid ECMP polarization, hash offset values are set from orchagent.

Earlier, vendor SDK sets the hash_offset value internally with the same value as hash_seed. After introduction of SAI attributes(SAI_SWITCH_ATTR_ECMP_DEFAULT_HASH_OFFSET/SAI_SWITCH_ATTR_LAG_DEFAULT_HASH_OFFSET), those changes in SDK were removed causing imbalance of traffic in T1s.

This change will pass the ECMP/LAG HASH_OFFSET values from orchagent to SAI and set them in ASIC.

Different ECMP/LAG hash_offset values are set for T0 and T1 in swss switch.json(ecmp_hash_offset and lag_hash_offset). Values are different for T0 and T1 to avoid ECMP/LAG hash polarization.
As part of switch initialization, these values are passed to switch orchagent.
Switch orchagent process these values and call SAI switch API to set these values.

Will be merged after swss changes: sonic-net/sonic-swss#3138

sonic-mgmt - sonic-net/sonic-mgmt#12765

Microsoft ADO (number only): 25873808
@kperumalbfn
Copy link
Contributor Author

@prsunny Request for 202311 Branch

mssonicbld pushed a commit to mssonicbld/sonic-swss that referenced this pull request Jun 26, 2024
* Add support for ECMP and LAG hash offset
What I did
Add support to update ECMP and LAG hash offset. Orchagent checks for SAI attribute capability and configure the offset values.

Why I did it
To avoid ECMP hash imbalance across T0 and T1s, different hash offsets can be configured.

How I verified it
sonic-mgmt tests ipfwd/test_nhop_group.py
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202311: #3204

mssonicbld pushed a commit to mssonicbld/sonic-buildimage that referenced this pull request Jun 26, 2024
…net#18912)

To avoid ECMP polarization, hash offset values are set from orchagent.

Earlier, vendor SDK sets the hash_offset value internally with the same value as hash_seed. After introduction of SAI attributes(SAI_SWITCH_ATTR_ECMP_DEFAULT_HASH_OFFSET/SAI_SWITCH_ATTR_LAG_DEFAULT_HASH_OFFSET), those changes in SDK were removed causing imbalance of traffic in T1s.

This change will pass the ECMP/LAG HASH_OFFSET values from orchagent to SAI and set them in ASIC.

Different ECMP/LAG hash_offset values are set for T0 and T1 in swss switch.json(ecmp_hash_offset and lag_hash_offset). Values are different for T0 and T1 to avoid ECMP/LAG hash polarization.
As part of switch initialization, these values are passed to switch orchagent.
Switch orchagent process these values and call SAI switch API to set these values.

Will be merged after swss changes: sonic-net/sonic-swss#3138

sonic-mgmt - sonic-net/sonic-mgmt#12765

Microsoft ADO (number only): 25873808
yxieca pushed a commit to sonic-net/sonic-buildimage that referenced this pull request Jun 26, 2024
#19397)

To avoid ECMP polarization, hash offset values are set from orchagent.

Earlier, vendor SDK sets the hash_offset value internally with the same value as hash_seed. After introduction of SAI attributes(SAI_SWITCH_ATTR_ECMP_DEFAULT_HASH_OFFSET/SAI_SWITCH_ATTR_LAG_DEFAULT_HASH_OFFSET), those changes in SDK were removed causing imbalance of traffic in T1s.

This change will pass the ECMP/LAG HASH_OFFSET values from orchagent to SAI and set them in ASIC.

Different ECMP/LAG hash_offset values are set for T0 and T1 in swss switch.json(ecmp_hash_offset and lag_hash_offset). Values are different for T0 and T1 to avoid ECMP/LAG hash polarization.
As part of switch initialization, these values are passed to switch orchagent.
Switch orchagent process these values and call SAI switch API to set these values.

Will be merged after swss changes: sonic-net/sonic-swss#3138

sonic-mgmt - sonic-net/sonic-mgmt#12765

Microsoft ADO (number only): 25873808

Co-authored-by: Kumaresh Perumal <kperumal@microsoft.com>
@mssonicbld
Copy link
Collaborator

@kperumalbfn cherry pick PR didn't pass PR checker. Please check!!!
#3204

2 similar comments
@mssonicbld
Copy link
Collaborator

@kperumalbfn cherry pick PR didn't pass PR checker. Please check!!!
#3204

@mssonicbld
Copy link
Collaborator

@kperumalbfn cherry pick PR didn't pass PR checker. Please check!!!
#3204

@mssonicbld
Copy link
Collaborator

@kperumalbfn cherry pick PR didn't pass PR checker. Please check!!!
#3204

mssonicbld pushed a commit that referenced this pull request Jul 3, 2024
* Add support for ECMP and LAG hash offset
What I did
Add support to update ECMP and LAG hash offset. Orchagent checks for SAI attribute capability and configure the offset values.

Why I did it
To avoid ECMP hash imbalance across T0 and T1s, different hash offsets can be configured.

How I verified it
sonic-mgmt tests ipfwd/test_nhop_group.py
wangxin pushed a commit to sonic-net/sonic-mgmt that referenced this pull request Jul 9, 2024
What is the motivation for this PR?
After sonic-net/sonic-swss#3138, configure hash_offset along with hash_seed attribute is enabled on 202311 onwards on Broadcom T1 platfrom.

How did you do it?
Remove the xfail marker of ecmp/test_ecmp_sai_value.py

How did you verify/test it?
Run ecmp/test_ecmp_sai_values.py on 7260 T1 DUT and passed.
https://dev.azure.com/mssonic/internal/_build/results?buildId=586225&view=results

Signed-off-by: zitingguo-ms <zitingguo@microsoft.com>
mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Jul 9, 2024
What is the motivation for this PR?
After sonic-net/sonic-swss#3138, configure hash_offset along with hash_seed attribute is enabled on 202311 onwards on Broadcom T1 platfrom.

How did you do it?
Remove the xfail marker of ecmp/test_ecmp_sai_value.py

How did you verify/test it?
Run ecmp/test_ecmp_sai_values.py on 7260 T1 DUT and passed.
https://dev.azure.com/mssonic/internal/_build/results?buildId=586225&view=results

Signed-off-by: zitingguo-ms <zitingguo@microsoft.com>
mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Jul 9, 2024
What is the motivation for this PR?
After sonic-net/sonic-swss#3138, configure hash_offset along with hash_seed attribute is enabled on 202311 onwards on Broadcom T1 platfrom.

How did you do it?
Remove the xfail marker of ecmp/test_ecmp_sai_value.py

How did you verify/test it?
Run ecmp/test_ecmp_sai_values.py on 7260 T1 DUT and passed.
https://dev.azure.com/mssonic/internal/_build/results?buildId=586225&view=results

Signed-off-by: zitingguo-ms <zitingguo@microsoft.com>
mssonicbld pushed a commit to sonic-net/sonic-mgmt that referenced this pull request Jul 10, 2024
What is the motivation for this PR?
After sonic-net/sonic-swss#3138, configure hash_offset along with hash_seed attribute is enabled on 202311 onwards on Broadcom T1 platfrom.

How did you do it?
Remove the xfail marker of ecmp/test_ecmp_sai_value.py

How did you verify/test it?
Run ecmp/test_ecmp_sai_values.py on 7260 T1 DUT and passed.
https://dev.azure.com/mssonic/internal/_build/results?buildId=586225&view=results

Signed-off-by: zitingguo-ms <zitingguo@microsoft.com>
mssonicbld pushed a commit to sonic-net/sonic-mgmt that referenced this pull request Jul 10, 2024
What is the motivation for this PR?
After sonic-net/sonic-swss#3138, configure hash_offset along with hash_seed attribute is enabled on 202311 onwards on Broadcom T1 platfrom.

How did you do it?
Remove the xfail marker of ecmp/test_ecmp_sai_value.py

How did you verify/test it?
Run ecmp/test_ecmp_sai_values.py on 7260 T1 DUT and passed.
https://dev.azure.com/mssonic/internal/_build/results?buildId=586225&view=results

Signed-off-by: zitingguo-ms <zitingguo@microsoft.com>
link19430 pushed a commit to link19430/sonic-buildimage-ec that referenced this pull request Sep 19, 2024
To avoid ECMP polarization, hash offset values are set from orchagent.

Earlier, vendor SDK sets the hash_offset value internally with the same value as hash_seed. After introduction of SAI attributes(SAI_SWITCH_ATTR_ECMP_DEFAULT_HASH_OFFSET/SAI_SWITCH_ATTR_LAG_DEFAULT_HASH_OFFSET), those changes in SDK were removed causing imbalance of traffic in T1s.

This change will pass the ECMP/LAG HASH_OFFSET values from orchagent to SAI and set them in ASIC.

Different ECMP/LAG hash_offset values are set for T0 and T1 in swss switch.json(ecmp_hash_offset and lag_hash_offset). Values are different for T0 and T1 to avoid ECMP/LAG hash polarization.
As part of switch initialization, these values are passed to switch orchagent.
Switch orchagent process these values and call SAI switch API to set these values.

Will be merged after swss changes: sonic-net/sonic-swss#3138

sonic-mgmt - sonic-net/sonic-mgmt#12765

Microsoft ADO (number only): 25873808
gord1306 pushed a commit to edge-core/sonic-buildimage that referenced this pull request Sep 19, 2024
To avoid ECMP polarization, hash offset values are set from orchagent.

Earlier, vendor SDK sets the hash_offset value internally with the same value as hash_seed. After introduction of SAI attributes(SAI_SWITCH_ATTR_ECMP_DEFAULT_HASH_OFFSET/SAI_SWITCH_ATTR_LAG_DEFAULT_HASH_OFFSET), those changes in SDK were removed causing imbalance of traffic in T1s.

This change will pass the ECMP/LAG HASH_OFFSET values from orchagent to SAI and set them in ASIC.

Different ECMP/LAG hash_offset values are set for T0 and T1 in swss switch.json(ecmp_hash_offset and lag_hash_offset). Values are different for T0 and T1 to avoid ECMP/LAG hash polarization.
As part of switch initialization, these values are passed to switch orchagent.
Switch orchagent process these values and call SAI switch API to set these values.

Will be merged after swss changes: sonic-net/sonic-swss#3138

sonic-mgmt - sonic-net/sonic-mgmt#12765

Microsoft ADO (number only): 25873808
arista-hpandya pushed a commit to arista-hpandya/sonic-mgmt that referenced this pull request Oct 2, 2024
What is the motivation for this PR?
After sonic-net/sonic-swss#3138, configure hash_offset along with hash_seed attribute is enabled on 202311 onwards on Broadcom T1 platfrom.

How did you do it?
Remove the xfail marker of ecmp/test_ecmp_sai_value.py

How did you verify/test it?
Run ecmp/test_ecmp_sai_values.py on 7260 T1 DUT and passed.
https://dev.azure.com/mssonic/internal/_build/results?buildId=586225&view=results

Signed-off-by: zitingguo-ms <zitingguo@microsoft.com>
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.

5 participants