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

Generic Hashing Algorithm HLD update, add IPV6_FLOW_LABEL attribute as hash field #1905

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 26 additions & 12 deletions doc/hash/hash-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,12 @@

## Revision

| Rev | Date | Author | Description |
|:---:|:----------:|:--------------:|:--------------------------------|
| 0.1 | 12/09/2022 | Nazarii Hnydyn | Initial version |
| 0.2 | 05/12/2022 | Nazarii Hnydyn | Capabilities validation |
| 0.3 | 25/09/2023 | Nazarii Hnydyn | Hashing algorithm configuration |
| Rev | Date | Author | Description |
|:---:|:----------:|:--------------:|:------------------------------------------------|
| 0.1 | 12/09/2022 | Nazarii Hnydyn | Initial version |
| 0.2 | 05/12/2022 | Nazarii Hnydyn | Capabilities validation |
| 0.3 | 25/09/2023 | Nazarii Hnydyn | Hashing algorithm configuration |
| 0.4 | 23/01/2025 | Andriy Yurkiv | Add 'IPv6 flow label' field for hashing packets |

## About this manual

Expand Down Expand Up @@ -223,6 +224,7 @@ i.e. configuration is tunnel-agnostic
| SAI_NATIVE_HASH_FIELD_INNER_SRC_IP | |
| SAI_NATIVE_HASH_FIELD_INNER_L4_DST_PORT | |
| SAI_NATIVE_HASH_FIELD_INNER_L4_SRC_PORT | |
| SAI_NATIVE_HASH_FIELD_IPV6_FLOW_LABEL | |

**SAI hash algorithms which shall be used for GH:**

Expand Down Expand Up @@ -360,6 +362,7 @@ hash-field = "IN_PORT"
/ "INNER_SRC_IP"
/ "INNER_L4_DST_PORT"
/ "INNER_L4_SRC_PORT"
/ "IPV6_FLOW_LABEL"
hash-field-list = hash-field [ 1*( "," hash-field ) ]
hash-algorithm = "CRC"
/ "XOR"
Expand Down Expand Up @@ -408,6 +411,7 @@ hash-field = ""
/ "INNER_SRC_IP"
/ "INNER_L4_DST_PORT"
/ "INNER_L4_SRC_PORT"
/ "IPV6_FLOW_LABEL"
hash-field-list = hash-field [ 1*( "," hash-field ) ]
hash-algorithm = ""
/ "N/A"
Expand All @@ -427,10 +431,10 @@ hash-algorithm = ""
redis-cli -n 4 HGETALL 'SWITCH_HASH|GLOBAL'
1) "ecmp_hash@"
2) "DST_MAC,SRC_MAC,ETHERTYPE,IP_PROTOCOL,DST_IP,SRC_IP,L4_DST_PORT,L4_SRC_PORT, \
INNER_DST_MAC,INNER_SRC_MAC,INNER_ETHERTYPE,INNER_IP_PROTOCOL,INNER_DST_IP,INNER_SRC_IP,INNER_L4_DST_PORT,INNER_L4_SRC_PORT"
INNER_DST_MAC,INNER_SRC_MAC,INNER_ETHERTYPE,INNER_IP_PROTOCOL,INNER_DST_IP,INNER_SRC_IP,INNER_L4_DST_PORT,INNER_L4_SRC_PORT,IPV6_FLOW_LABEL"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wondering if this is going to be the default hash or optional?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@prsunny all hash field configuration is optional. Here we do not change vendor SAI defaults but only add a new configuration capability. If you want to change SAI vendor defaults - please let us know

3) "lag_hash@"
4) "DST_MAC,SRC_MAC,ETHERTYPE,IP_PROTOCOL,DST_IP,SRC_IP,L4_DST_PORT,L4_SRC_PORT, \
INNER_DST_MAC,INNER_SRC_MAC,INNER_ETHERTYPE,INNER_IP_PROTOCOL,INNER_DST_IP,INNER_SRC_IP,INNER_L4_DST_PORT,INNER_L4_SRC_PORT"
INNER_DST_MAC,INNER_SRC_MAC,INNER_ETHERTYPE,INNER_IP_PROTOCOL,INNER_DST_IP,INNER_SRC_IP,INNER_L4_DST_PORT,INNER_L4_SRC_PORT,IPV6_FLOW_LABEL"
5) "ecmp_hash_algorithm"
6) "CRC"
7) "lag_hash_algorithm"
Expand All @@ -447,7 +451,7 @@ redis-cli -n 6 HGETALL 'SWITCH_CAPABILITY|switch'
5) "HASH|NATIVE_HASH_FIELD_LIST"
6) "IN_PORT,DST_MAC,SRC_MAC,ETHERTYPE,VLAN_ID,IP_PROTOCOL,DST_IP,SRC_IP,L4_DST_PORT,L4_SRC_PORT, \
INNER_DST_MAC,INNER_SRC_MAC,INNER_ETHERTYPE,INNER_IP_PROTOCOL,INNER_DST_IP,INNER_SRC_IP, \
INNER_L4_DST_PORT,INNER_L4_SRC_PORT"
INNER_L4_DST_PORT,INNER_L4_SRC_PORT,IPV6_FLOW_LABEL"
7) "ECMP_HASH_ALGORITHM_CAPABLE"
8) "true"
9) "LAG_HASH_ALGORITHM_CAPABLE"
Expand Down Expand Up @@ -481,7 +485,8 @@ INNER_L4_DST_PORT,INNER_L4_SRC_PORT"
"INNER_DST_IP",
"INNER_SRC_IP",
"INNER_L4_DST_PORT",
"INNER_L4_SRC_PORT"
"INNER_L4_SRC_PORT",
"IPV6_FLOW_LABEL"
],
"lag_hash": [
"DST_MAC",
Expand All @@ -499,7 +504,8 @@ INNER_L4_DST_PORT,INNER_L4_SRC_PORT"
"INNER_DST_IP",
"INNER_SRC_IP",
"INNER_L4_DST_PORT",
"INNER_L4_SRC_PORT"
"INNER_L4_SRC_PORT",
"IPV6_FLOW_LABEL"
],
"ecmp_hash_algorithm": "CRC",
"lag_hash_algorithm": "CRC"
Expand Down Expand Up @@ -580,7 +586,8 @@ config switch-hash global ecmp-hash \
'INNER_DST_IP' \
'INNER_SRC_IP' \
'INNER_L4_DST_PORT' \
'INNER_L4_SRC_PORT'
'INNER_L4_SRC_PORT' \
'IPV6_FLOW_LABEL'
config switch-hash global lag-hash \
'DST_MAC' \
'SRC_MAC' \
Expand All @@ -597,7 +604,8 @@ config switch-hash global lag-hash \
'INNER_DST_IP' \
'INNER_SRC_IP' \
'INNER_L4_DST_PORT' \
'INNER_L4_SRC_PORT'
'INNER_L4_SRC_PORT' \
'IPV6_FLOW_LABEL'
```

**The following command updates switch hash algorithm global:**
Expand Down Expand Up @@ -633,6 +641,7 @@ root@sonic:/home/admin# show switch-hash global
| | | INNER_SRC_IP | | |
| | | INNER_L4_DST_PORT | | |
| | | INNER_L4_SRC_PORT | | |
| | | IPV6_FLOW_LABEL | | |
| | +-------------------+-------------+ |
+--------+-------------------------------------+
| LAG | +-------------------+-------------+ |
Expand All @@ -654,6 +663,7 @@ root@sonic:/home/admin# show switch-hash global
| | | INNER_SRC_IP | | |
| | | INNER_L4_DST_PORT | | |
| | | INNER_L4_SRC_PORT | | |
| | | IPV6_FLOW_LABEL | | |
| | +-------------------+-------------+ |
+--------+-------------------------------------+
```
Expand Down Expand Up @@ -685,6 +695,7 @@ root@sonic:/home/admin# show switch-hash capabilities
| | | INNER_SRC_IP | | |
| | | INNER_L4_DST_PORT | | |
| | | INNER_L4_SRC_PORT | | |
| | | IPV6_FLOW_LABEL | | |
| | +-------------------+-------------+ |
+--------+-------------------------------------+
| LAG | +-------------------+-------------+ |
Expand All @@ -708,6 +719,7 @@ root@sonic:/home/admin# show switch-hash capabilities
| | | INNER_SRC_IP | | |
| | | INNER_L4_DST_PORT | | |
| | | INNER_L4_SRC_PORT | | |
| | | IPV6_FLOW_LABEL | | |
| | +-------------------+-------------+ |
+--------+-------------------------------------+
```
Expand Down Expand Up @@ -744,6 +756,7 @@ will be extended with a new common type.
enum INNER_SRC_IPV6;
enum INNER_L4_DST_PORT;
enum INNER_L4_SRC_PORT;
enum IPV6_FLOW_LABEL;
}
}

Expand Down Expand Up @@ -804,6 +817,7 @@ module sonic-hash {
enum INNER_SRC_IP;
enum INNER_L4_DST_PORT;
enum INNER_L4_SRC_PORT;
enum IPV6_FLOW_LABEL;
}
}

Expand Down