diff --git a/doc/hash/hash-design.md b/doc/hash/hash-design.md index cabbbda0119..1cb1dd645cc 100644 --- a/doc/hash/hash-design.md +++ b/doc/hash/hash-design.md @@ -31,6 +31,8 @@ - [2.5 Flows](#25-flows) - [2.5.1 Config section](#251-config-section) - [2.5.1.1 GH update](#2511-gh-update) + - [2.5.1.2 Packet type hash create and update](#2512-packet-type-hash-create-and-update) + - [2.5.1.3 Packet type hash delete](#2513-packet-type-hash-delete) - [2.5.2 Show section](#252-show-section) - [2.5.2.1 GH show](#2521-gh-show) - [2.5.2.2 GH show capabilities](#2522-gh-show-capabilities) @@ -53,6 +55,7 @@ | 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 | +| 0.5 | 11/11/2025 | Anandhi Dhanabalan | Add support for RoCE hash fields and hashing based on packet types | ## About this manual @@ -65,6 +68,7 @@ This document describes the high level design of GH feature in SONiC **In scope:** 1. ECMP/LAG switch hash configuration 2. ECMP/LAG switch hash algorithm configuration +3. ECMP/LAG packet type based switch hash **Out of scope:** 1. ECMP/LAG switch hash seed configuration @@ -88,14 +92,17 @@ This document describes the high level design of GH feature in SONiC | YANG | Yet Another Next Generation | | VS | Virtual Switch | | PTF | Packet Test Framework | +| RoCE | Remote Direct Memory Access over Converged Ethernet | ## List of figures [Figure 1: GH design](#figure-1-gh-design) [Figure 2: GH OA design](#figure-2-gh-oa-design) [Figure 3: GH update flow](#figure-3-gh-update-flow) -[Figure 4: GH show flow](#figure-4-gh-show-flow) -[Figure 5: GH show capabilities flow](#figure-5-gh-show-capabilities-flow) +[Figure 4: Packet type hash create and update flow](#figure-4-Packet-type-hash-create-and-update-flow) +[Figure 5: Packet Type Hash delete flow](#figure-5-Packet-type-hash-delete-flow) +[Figure 6: GH show flow](#figure-6-gh-show-flow) +[Figure 7: GH show capabilities flow](#figure-7-gh-show-capabilities-flow) ## List of tables @@ -125,6 +132,8 @@ GH provides global switch hash configuration for ECMP and LAG. 1. Ethernet packet hashing configuration with inner/outer IP frames 2. Global switch hash configuration for ECMP and LAG 3. Warm/Fast reboot +4. Global switch hash packet-type based configuration for ECMP and LAG +5. RoCE hash fields configuration ### 1.2.2 Command interface @@ -199,6 +208,9 @@ Hashing policy can be set independently for ECMP and LAG. 2. SAI configuration of hash fields is applicable to original packet before any DECAP/ENCAP, i.e. configuration is tunnel-agnostic 3. If some configured hash field is not present in an incoming packet, then zero is assumed for hash calculation +4. When both a global hash and a corresponding packet-type hash (e.g., `lag_hash` and `lag_hash_ipv4`) are configured: + - The packet-type-specific hash should be applied to its respective packet type (for example, `lag_hash_ipv4` for IPv4 packets). + - The global hash (`lag_hash`) should be used for all other packet types. ## 2.2 SAI API @@ -225,6 +237,8 @@ i.e. configuration is tunnel-agnostic | SAI_NATIVE_HASH_FIELD_INNER_L4_DST_PORT | | | SAI_NATIVE_HASH_FIELD_INNER_L4_SRC_PORT | | | SAI_NATIVE_HASH_FIELD_IPV6_FLOW_LABEL | | +| SAI_NATIVE_HASH_FIELD_RDMA_BTH_OPCODE | | +| SAI_NATIVE_HASH_FIELD_RDMA_BTH_DEST_QP | | **SAI hash algorithms which shall be used for GH:** @@ -247,6 +261,16 @@ i.e. configuration is tunnel-agnostic | | | SAI_HASH_ATTR_NATIVE_HASH_FIELD_LIST | | | | SAI_SWITCH_ATTR_ECMP_DEFAULT_HASH_ALGORITHM | | | | SAI_SWITCH_ATTR_LAG_DEFAULT_HASH_ALGORITHM | +| | | SAI_SWITCH_ATTR_ECMP_HASH_IPV4 | +| | | SAI_SWITCH_ATTR_ECMP_HASH_IPV6 | +| | | SAI_SWITCH_ATTR_ECMP_HASH_IPV4_IN_IPV4 | +| | | SAI_SWITCH_ATTR_ECMP_HASH_IPV4_RDMA | +| | | SAI_SWITCH_ATTR_ECMP_HASH_IPV6_RDMA | +| | | SAI_SWITCH_ATTR_LAG_HASH_IPV4 | +| | | SAI_SWITCH_ATTR_LAG_HASH_IPV6 | +| | | SAI_SWITCH_ATTR_LAG_HASH_IPV4_IN_IPV4 | +| | | SAI_SWITCH_ATTR_LAG_HASH_IPV4_RDMA | +| | | SAI_SWITCH_ATTR_LAG_HASH_IPV6_RDMA | | | sai_query_attribute_enum_values_capability | SAI_HASH_ATTR_NATIVE_HASH_FIELD_LIST | | | | SAI_SWITCH_ATTR_ECMP_DEFAULT_HASH_ALGORITHM | | | | SAI_SWITCH_ATTR_LAG_DEFAULT_HASH_ALGORITHM | @@ -254,6 +278,16 @@ i.e. configuration is tunnel-agnostic | | | SAI_SWITCH_ATTR_LAG_HASH | | | set_switch_attribute | SAI_SWITCH_ATTR_ECMP_DEFAULT_HASH_ALGORITHM | | | | SAI_SWITCH_ATTR_LAG_DEFAULT_HASH_ALGORITHM | +| | | SAI_SWITCH_ATTR_ECMP_HASH_IPV4 | +| | | SAI_SWITCH_ATTR_ECMP_HASH_IPV6 | +| | | SAI_SWITCH_ATTR_ECMP_HASH_IPV4_IN_IPV4 | +| | | SAI_SWITCH_ATTR_ECMP_HASH_IPV4_RDMA | +| | | SAI_SWITCH_ATTR_ECMP_HASH_IPV6_RDMA | +| | | SAI_SWITCH_ATTR_LAG_HASH_IPV4 | +| | | SAI_SWITCH_ATTR_LAG_HASH_IPV6 | +| | | SAI_SWITCH_ATTR_LAG_HASH_IPV4_IN_IPV4 | +| | | SAI_SWITCH_ATTR_LAG_HASH_IPV4_RDMA | +| | | SAI_SWITCH_ATTR_LAG_HASH_IPV6_RDMA | | HASH | set_hash_attribute | SAI_HASH_ATTR_NATIVE_HASH_FIELD_LIST | ## 2.3 Orchestration agent @@ -292,6 +326,17 @@ Any further switch hash update is being validated using vendor specific hash cap **Skeleton code:** ```cpp + +enum class HashPktType +{ + INVALID, + IPV4, + IPV6, + IPV4_IN_IPV4, + IPV4_RDMA, + IPV6_RDMA +}; + class SwitchOrch : public Orch { ... @@ -311,6 +356,10 @@ private: void getSwitchHashLagOid(); void querySwitchHashDefaults(); + // Switch packet-type hash + bool applySwitchHashConfig(const SwitchHash &hash, HashPktType pktType, bool isEcmpHash); + bool removeSwitchHashConfig(const SwitchHash &hash, HashPktType pktType, bool isEcmpHash); + // Switch hash SAI defaults struct { struct { @@ -321,6 +370,12 @@ private: } lagHash; } m_switchHashDefaults; + // Switch packet-type hash for ECMP + std::map m_switchHashEcmp; + + // Switch packet-type hash for LAG + std::map m_switchHashLag; + // Switch OA helper SwitchHelper swHlpr; @@ -342,6 +397,16 @@ ecmp_hash = hash-field-list ; hash fields for hashing packets going th lag_hash = hash-field-list ; hash fields for hashing packets going through LAG ecmp_hash_algorithm = hash-algorithm ; hash algorithm for hashing packets going through ECMP lag_hash_algorithm = hash-algorithm ; hash algorithm for hashing packets going through LAG +ecmp_hash_ipv4 = hash-field-list ; hash fields for hashing ipv4 packets going through ECMP +ecmp_hash_ipv6 = hash-field-list ; hash fields for hashing ipv6 packets going through ECMP +ecmp_hash_ipnip = hash-field-list ; hash fields for hashing ipv4 in ipv4 packets going through ECMP +ecmp_hash_ipv4_rdma = hash-field-list ; hash fields for hashing ipv4 RDMA packets going through ECMP +ecmp_hash_ipv6_rdma = hash-field-list ; hash fields for hashing ipv6 RDMA packets going through ECMP +lag_hash_ipv4 = hash-field-list ; hash fields for hashing ipv4 packets going through LAG +lag_hash_ipv6 = hash-field-list ; hash fields for hashing ipv6 packets going through LAG +lag_hash_ipnip = hash-field-list ; hash fields for hashing ipv4 in ipv4 packets going through LAG +lag_hash_ipv4_rdma = hash-field-list ; hash fields for hashing ipv4 RDMA packets going through LAG +lag_hash_ipv6_rdma = hash-field-list ; hash fields for hashing ipv6 RDMA packets going through LAG ; value annotations hash-field = "IN_PORT" @@ -363,6 +428,8 @@ hash-field = "IN_PORT" / "INNER_L4_DST_PORT" / "INNER_L4_SRC_PORT" / "IPV6_FLOW_LABEL" + / "RDMA_BTH_OPCODE" + / "RDMA_BTH_DEST_QP" hash-field-list = hash-field [ 1*( "," hash-field ) ] hash-algorithm = "CRC" / "XOR" @@ -388,6 +455,12 @@ ECMP_HASH_ALGORITHM_CAPABLE = capability-knob ; specifies whether switch is ECMP LAG_HASH_ALGORITHM_CAPABLE = capability-knob ; specifies whether switch is LAG hash algorithm capable ECMP_HASH_ALGORITHM = hash-algorithm ; hash algorithm capabilities for hashing packets going through ECMP LAG_HASH_ALGORITHM = hash-algorithm ; hash algorithm capabilities for hashing packets going through LAG +ECMP_PKT_TYPE_HASH_CAPABLE = capability-knob ; specifies whether switch is ECMP packet type hash capable +LAG_PKT_TYPE_HASH_CAPABLE = capability-knob ; specifies whether switch is LAG packet type hash capable +HASH|ECMP_PKT_TYPE_LIST = pkt-type-list ; packet type capabilities for hashing packets going through ECMP +HASH|LAG_PKT_TYPE_LIST = pkt-type-list ; packet type capabilities for hashing packets going through LAG + + ; value annotations capability-knob = "true" / "false" @@ -412,6 +485,8 @@ hash-field = "" / "INNER_L4_DST_PORT" / "INNER_L4_SRC_PORT" / "IPV6_FLOW_LABEL" + / "RDMA_BTH_OPCODE" + / "RDMA_BTH_DEST_QP" hash-field-list = hash-field [ 1*( "," hash-field ) ] hash-algorithm = "" / "N/A" @@ -422,6 +497,14 @@ hash-algorithm = "" / "CRC_32HI" / "CRC_CCITT" / "CRC_XOR" +pkt-type = "" + / "N/A" + / "IPV4" + / "IPV6" + / "IPV4_IN_IPV4" + / "IPV4_RDMA" + / "IPV6_RDMA" +pkt-type-list = pkt-type [ 1*( "," pkt-type ) ] ``` ### 2.4.3 Data sample @@ -431,14 +514,44 @@ 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,IPV6_FLOW_LABEL" +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,RDMA_BTH_OPCODE,RDMA_BTH_DEST_QP" 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,IPV6_FLOW_LABEL" +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,RDMA_BTH_OPCODE,RDMA_BTH_DEST_QP" 5) "ecmp_hash_algorithm" 6) "CRC" 7) "lag_hash_algorithm" 8) "CRC" +9) "ecmp_hash@ipv4" +10) "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,IPV6_FLOW_LABEL,RDMA_BTH_OPCODE,RDMA_BTH_DEST_QP" +11) "ecmp_hash@ipv6" +12) "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,IPV6_FLOW_LABEL,RDMA_BTH_OPCODE,RDMA_BTH_DEST_QP" +13) "ecmp_hash@ipnip" +14) "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,IPV6_FLOW_LABEL,RDMA_BTH_OPCODE,RDMA_BTH_DEST_QP" +15) "ecmp_hash@ipv4_rdma" +16) "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,IPV6_FLOW_LABEL,RDMA_BTH_OPCODE,RDMA_BTH_DEST_QP" +17) "ecmp_hash@ipv6_rdma" +18) "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,IPV6_FLOW_LABEL,RDMA_BTH_OPCODE,RDMA_BTH_DEST_QP" +19) "lag_hash@ipv4" +20) "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,IPV6_FLOW_LABEL,RDMA_BTH_OPCODE,RDMA_BTH_DEST_QP" +21) "lag_hash@ipv6" +22) "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,IPV6_FLOW_LABEL,RDMA_BTH_OPCODE,RDMA_BTH_DEST_QP" +23) "lag_hash@ipnip" +24) "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,IPV6_FLOW_LABEL,RDMA_BTH_OPCODE,RDMA_BTH_DEST_QP" +25) "lag_hash@ipv4_rdma" +26) "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,IPV6_FLOW_LABEL,RDMA_BTH_OPCODE,RDMA_BTH_DEST_QP" +27) "lag_hash@ipv6_rdma" +28) "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,IPV6_FLOW_LABEL,RDMA_BTH_OPCODE,RDMA_BTH_DEST_QP" ``` **State DB:** @@ -451,7 +564,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,IPV6_FLOW_LABEL" +INNER_L4_DST_PORT,INNER_L4_SRC_PORT,IPV6_FLOW_LABEL,RDMA_BTH_OPCODE,RDMA_BTH_DEST_QP" 7) "ECMP_HASH_ALGORITHM_CAPABLE" 8) "true" 9) "LAG_HASH_ALGORITHM_CAPABLE" @@ -460,6 +573,15 @@ INNER_L4_DST_PORT,INNER_L4_SRC_PORT,IPV6_FLOW_LABEL" 12) "CRC,XOR,RANDOM,CRC_32LO,CRC_32HI,CRC_CCITT,CRC_XOR" 13) "LAG_HASH_ALGORITHM" 14) "CRC,XOR,RANDOM,CRC_32LO,CRC_32HI,CRC_CCITT,CRC_XOR" +15) "ECMP_PKT_TYPE_HASH_CAPABLE" +16) "true" +17) "LAG_PKT_TYPE_HASH_CAPABLE" +18) "true" +19) "HASH|ECMP_PKT_TYPE_LIST" +20) "IPV4","IPV4_IN_IPV4","IPV6","IPV4_RDMA","IPV6_RDMA" +19) "HASH|LAG_PKT_TYPE_LIST" +20) "IPV4","IPV4_IN_IPV4","IPV6","IPV4_RDMA","IPV6_RDMA" + ``` ### 2.4.4 Configuration sample @@ -486,7 +608,9 @@ INNER_L4_DST_PORT,INNER_L4_SRC_PORT,IPV6_FLOW_LABEL" "INNER_SRC_IP", "INNER_L4_DST_PORT", "INNER_L4_SRC_PORT", - "IPV6_FLOW_LABEL" + "IPV6_FLOW_LABEL", + "RDMA_BTH_OPCODE", + "RDMA_BTH_DEST_QP" ], "lag_hash": [ "DST_MAC", @@ -507,6 +631,128 @@ INNER_L4_DST_PORT,INNER_L4_SRC_PORT,IPV6_FLOW_LABEL" "INNER_L4_SRC_PORT", "IPV6_FLOW_LABEL" ], + "ecmp_hash_ipv4": [ + "DST_MAC", + "SRC_MAC", + "ETHERTYPE", + "IP_PROTOCOL", + "DST_IP", + "SRC_IP", + "L4_DST_PORT", + "L4_SRC_PORT" + ], + "ecmp_hash_ipv6": [ + "DST_MAC", + "SRC_MAC", + "ETHERTYPE", + "IP_PROTOCOL", + "DST_IP", + "SRC_IP", + "L4_DST_PORT", + "L4_SRC_PORT", + "IPV6_FLOW_LABEL" + ], + "ecmp_hash_ipnip": [ + "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" + ], + "ecmp_hash_ipv4_rdma": [ + "DST_MAC", + "SRC_MAC", + "ETHERTYPE", + "IP_PROTOCOL", + "DST_IP", + "SRC_IP", + "L4_DST_PORT", + "L4_SRC_PORT", + "RDMA_BTH_OPCODE", + "RDMA_BTH_DEST_QP" + ], + "ecmp_hash_ipv6_rdma": [ + "DST_MAC", + "SRC_MAC", + "ETHERTYPE", + "IP_PROTOCOL", + "DST_IP", + "SRC_IP", + "L4_DST_PORT", + "L4_SRC_PORT", + "IPV6_FLOW_LABEL", + "RDMA_BTH_OPCODE", + "RDMA_BTH_DEST_QP" + ], + "lag_hash_ipv4": [ + "DST_MAC", + "SRC_MAC", + "ETHERTYPE", + "IP_PROTOCOL", + "DST_IP", + "SRC_IP", + "L4_DST_PORT", + "L4_SRC_PORT" + ], + "lag_hash_ipv6": [ + "DST_MAC", + "SRC_MAC", + "ETHERTYPE", + "IP_PROTOCOL", + "DST_IP", + "SRC_IP", + "L4_DST_PORT", + "L4_SRC_PORT", + "IPV6_FLOW_LABEL" + ], + "lag_hash_ipnip": [ + "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" + ], + "lag_hash_ipv4_rdma": [ + "DST_MAC", + "SRC_MAC", + "ETHERTYPE", + "IP_PROTOCOL", + "DST_IP", + "SRC_IP", + "L4_DST_PORT", + "L4_SRC_PORT", + "RDMA_BTH_OPCODE", + "RDMA_BTH_DEST_QP" + ], + "lag_hash_ipv6_rdma": [ + "DST_MAC", + "SRC_MAC", + "ETHERTYPE", + "IP_PROTOCOL", + "DST_IP", + "SRC_IP", + "L4_DST_PORT", + "L4_SRC_PORT", + "IPV6_FLOW_LABEL", + "RDMA_BTH_OPCODE", + "RDMA_BTH_DEST_QP" + ], "ecmp_hash_algorithm": "CRC", "lag_hash_algorithm": "CRC" } @@ -519,8 +765,7 @@ INNER_L4_DST_PORT,INNER_L4_SRC_PORT,IPV6_FLOW_LABEL" ### 2.5.1 Config section ### 2.5.1.1 GH update - -![GH update flow](images/gh_update_flow.svg "Figure 3: GH update flow") +![GH update flow](images/gh_apply_flow.svg "Figure 3: GH update flow") ###### Figure 3: GH update flow @@ -529,46 +774,90 @@ INNER_L4_DST_PORT,INNER_L4_SRC_PORT,IPV6_FLOW_LABEL" The list of available hash fields will be queried by `sai_query_attribute_enum_values_capability` in two steps. The first attempt is used to accommodate the target list size after getting `SAI_STATUS_BUFFER_OVERFLOW` return code. And the second one is for getting the actual data. + + +### 2.5.1.2 Packet type hash create and update +![Packet type hash create and update flow](images/pkt_type_hash_update_flow.svg "Figure 4: Packet type hash create and update flow") + +###### Figure 4: Packet type hash create and update flow + +### 2.5.1.3 Packet type hash delete +![Packet type hash delete flow](images/pkt_type_hash_delete_flow.svg "Figure 5: Packet type hash delete flow") + +###### Figure 5: Packet type hash delete flow + +1. **Packet-type Option Workflow** + + - If user selects the `packet-type` option: + - CLI performs capability checks. + - Only if capabilities exist for the selected packet-type, hash config commands are written into CONFIG_DB +2. **Hash Configuration Handling in switchOrch** + - switchOrch that subscribes to CONFIG_DB consumes entries from SWITCH_HASH CONFIG_DB. + - When **switchOrch** receives the HSET configuration, it checks if the packet-type hash is already configured + - **If not configured:** _Treat as a create operation._ + - **If configured:** _Treat as an update operation._ + + - When **switchOrch** receives the HDEL configuration, it checks if the packet-type hash exists + - **If not configured:** _Ignores the operation._ + - **If configured:** _Deletes the packet-type hash._ + + ### 2.5.2 Show section #### 2.5.2.1 GH show -![GH show flow](images/gh_show_flow.svg "Figure 4: GH show flow") +![GH show flow](images/gh_show_flow.svg "Figure 6: GH show flow") -###### Figure 4: GH show flow +###### Figure 6: GH show flow #### 2.5.2.2 GH show capabilities -![GH show capabilities flow](images/gh_show_cap_flow.svg "Figure 5: GH show capabilities flow") +![GH show capabilities flow](images/gh_show_cap_flow.svg "Figure 7: GH show capabilities flow") -###### Figure 5: GH show capabilities flow +###### Figure 7: GH show capabilities flow ## 2.6 CLI ### 2.6.1 Command structure **User interface**: + ``` config |--- switch-hash |--- global - |--- ecmp-hash ARGS - |--- lag-hash ARGS + |--- ecmp-hash [packet-type ] ARGS + |--- lag-hash [packet-type ] ARGS |--- ecmp-hash-algorithm ARG - |--- lag-hash-algorithm ARG - + |--- lag-hash-algorithm ARG + show |--- switch-hash - |--- global + |--- global [packet-type ] |--- capabilities ``` +**Note:-** +- _pkt-type (Supported values):_ + - _all, ipv4, ipv6, ipnip, ipv4-rdma, ipv6-rdma_ +- _In config command:_ + - _`packet-type `: Optional parameter, if omitted updates global hash_ + - _`add`: Creates packet type hash if one doesn't exist, else overwrites the hash fields in existing hash_ + - _`del`: Deletes Packet type hash_ +- _In show command:_ + - _`packet-type ` is optional; `all` packet-type is valid only for show_ + - _If pkt-type omitted: Shows global hash configuration/capabilities_ + - _If pkt-type is all: Shows all packet type hash configuration/capabilities_ ### 2.6.2 Usage examples #### 2.6.2.1 Config command group -**The following command updates switch hash global:** +**The following command updates switch hash global defaults:** +**Note:-** +_RDMA_BTH_OPCODE and RDMA_BTH_DEST_QP are optional fields in the global hash configuration._ +_They are supported by the design but can be omitted from update commands if not required._ + ```bash config switch-hash global ecmp-hash \ 'DST_MAC' \ @@ -587,7 +876,10 @@ config switch-hash global ecmp-hash \ 'INNER_SRC_IP' \ 'INNER_L4_DST_PORT' \ 'INNER_L4_SRC_PORT' \ -'IPV6_FLOW_LABEL' +'IPV6_FLOW_LABEL', \ +"RDMA_BTH_OPCODE", \ +"RDMA_BTH_DEST_QP" + config switch-hash global lag-hash \ 'DST_MAC' \ 'SRC_MAC' \ @@ -605,13 +897,60 @@ config switch-hash global lag-hash \ 'INNER_SRC_IP' \ 'INNER_L4_DST_PORT' \ 'INNER_L4_SRC_PORT' \ -'IPV6_FLOW_LABEL' +'IPV6_FLOW_LABEL' ``` +**The following command creates switch packet-type hash:** +```bash +config switch-hash global ecmp-hash packet-type ipv4-rdma add \ +'DST_MAC' \ +'SRC_MAC' \ +'ETHERTYPE' \ +'IP_PROTOCOL' \ +'DST_IP' \ +'SRC_IP' \ +'L4_DST_PORT' \ +'L4_SRC_PORT' \ +'RDMA_BTH_OPCODE' \ +'RDMA_BTH_DEST_QP' + +config switch-hash global lag-hash packet-type ipnip add \ +'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' \ +``` + +**The following command updates switch packet-type hash:** +```bash +config switch-hash global ecmp-hash packet-type ipv4-rdma add \ +'DST_IP' \ +'SRC_IP' \ +'L4_DST_PORT' \ +'L4_SRC_PORT' \ +'RDMA_BTH_OPCODE' \ +'RDMA_BTH_DEST_QP' +``` +**The following command removes switch packet-type hash:** +```bash +config switch-hash global ecmp-hash packet-type ipv4-rdma del +config switch-hash global lag-hash packet-type ipnip del + +``` **The following command updates switch hash algorithm global:** ```bash config switch-hash global ecmp-hash-algorithm 'CRC' config switch-hash global lag-hash-algorithm 'CRC' + ``` #### 2.6.2.2 Show command group @@ -642,6 +981,8 @@ root@sonic:/home/admin# show switch-hash global | | | INNER_L4_DST_PORT | | | | | | INNER_L4_SRC_PORT | | | | | | IPV6_FLOW_LABEL | | | +| | | RDMA_BTH_OPCODE | | | +| | | RDMA_BTH_DEST_QP | | | | | +-------------------+-------------+ | +--------+-------------------------------------+ | LAG | +-------------------+-------------+ | @@ -664,64 +1005,211 @@ root@sonic:/home/admin# show switch-hash global | | | INNER_L4_DST_PORT | | | | | | INNER_L4_SRC_PORT | | | | | | IPV6_FLOW_LABEL | | | +| | | RDMA_BTH_OPCODE | | | +| | | RDMA_BTH_DEST_QP | | | | | +-------------------+-------------+ | +--------+-------------------------------------+ + +root@sonic:/home/admin# show switch-hash global packet-type ipv4-rdma ++--------+-----------+-----------------------------------+ +| Hash | Pkt-Type | Configuration | ++========+===========+===================================+ +| ECMP | ipv4-rdma | +------------------+------------+ | +| | | | Hash Field | Algorithm | | +| | | |------------------+------------| | +| | | | DST_MAC | CRC | | +| | | | SRC_MAC | | | +| | | | ETHERTYPE | | | +| | | | IP_PROTOCOL | | | +| | | | DST_IP | | | +| | | | SRC_IP | | | +| | | | L4_DST_PORT | | | +| | | | L4_SRC_PORT | | | +| | | | RDMA_BTH_OPCODE | | | +| | | | RDMA_BTH_DEST_QP | | | +| | | +------------------+------------+ | ++--------+-----------+-----------------------------------+ +| LAG | ipv4-rdma | +-----------------+-------------+ | +| | | | Hash Field | Algorithm | | +| | | |-----------------+-------------| | +| | | | N/A | N/A | | +| | | +------------------+------------+ | ++--------+-----------+-----------------------------------+ + +root@sonic:/home/admin# show switch-hash global packet-type ipnip ++--------+-----------+-----------------------------------+ +| Hash | Pkt-Type | Configuration | ++========+===========+===================================+ +| ECMP | ipnip | +-----------------+-------------+ | +| | | | Hash Field | Algorithm | | +| | | |-----------------+-------------| | +| | | | N/A | N/A | | +| | | +------------------+------------+ | ++--------+-----------+-----------------------------------+ +| LAG | ipnip | +-------------------------------+ | +| | | | Hash Field | Algorithm | | +| | | |-------------------+-----------| | +| | | | IP_PROTOCOL | CRC | | +| | | | 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 | | | +| | | +-------------------+-----------+ | ++--------+-----------+-----------------------------------+ + +root@sonic:/home/admin# show switch-hash global packet-type all ++--------+-----------+-----------------------------------+ +| Hash | Pkt-Type | Configuration | ++========+===========+===================================+ +| ECMP | ipv4 | +-----------------+-------------+ | +| | | | Hash Field | Algorithm | | +| | | |-----------------+-------------| | +| | | | N/A | N/A | | +| | | +------------------+------------+ | ++--------+-----------+-----------------------------------+ +| ECMP | ipv6 | +-----------------+-------------+ | +| | | | Hash Field | Algorithm | | +| | | |-----------------+-------------| | +| | | | N/A | N/A | | +| | | +------------------+------------+ | ++--------+-----------+-----------------------------------+ +| ECMP | ipnip | +-----------------+-------------+ | +| | | | Hash Field | Algorithm | | +| | | |-----------------+-------------| | +| | | | N/A | N/A | | +| | | +------------------+------------+ | ++--------+-----------+-----------------------------------+ +| ECMP | ipv4-rdma | +------------------+------------+ | +| | | | Hash Field | Algorithm | | +| | | |------------------+------------| | +| | | | DST_MAC | CRC | | +| | | | SRC_MAC | | | +| | | | ETHERTYPE | | | +| | | | IP_PROTOCOL | | | +| | | | DST_IP | | | +| | | | SRC_IP | | | +| | | | L4_DST_PORT | | | +| | | | L4_SRC_PORT | | | +| | | | RDMA_BTH_OPCODE | | | +| | | | RDMA_BTH_DEST_QP | | | +| | | +------------------+------------+ | ++--------+-----------+-----------------------------------+ +| ECMP | ipv6-rdma | +-----------------+-------------+ | +| | | | Hash Field | Algorithm | | +| | | |-----------------+-------------| | +| | | | N/A | N/A | | +| | | +------------------+------------+ | ++--------+-----------+-----------------------------------+ +| LAG | ipv4 | +-----------------+-------------+ | +| | | | Hash Field | Algorithm | | +| | | |-----------------+-------------| | +| | | | N/A | N/A | | +| | | +------------------+------------+ | ++--------+-----------+-----------------------------------+ +| LAG | ipv6 | +-----------------+-------------+ | +| | | | Hash Field | Algorithm | | +| | | |-----------------+-------------| | +| | | | N/A | N/A | | +| | | +------------------+------------+ | ++--------+-----------+-----------------------------------+ +| LAG | ipnip | +-------------------------------+ | +| | | | Hash Field | Algorithm | | +| | | |-------------------+-----------| | +| | | | IP_PROTOCOL | CRC | | +| | | | 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 | | | +| | | +-------------------+-----------+ | ++--------+-----------+-----------------------------------+ +| LAG | ipv4-rdma | +-----------------+-------------+ | +| | | | Hash Field | Algorithm | | +| | | |-----------------+-------------| | +| | | | N/A | N/A | | +| | | +------------------+------------+ | ++--------+-----------+-----------------------------------+ +| LAG | ipv6-rdma | +-----------------+-------------+ | +| | | | Hash Field | Algorithm | | +| | | |-----------------+-------------| | +| | | | N/A | N/A | | +| | | +------------------+------------+ | ++--------+-----------+-----------------------------------+ ``` **The following command shows switch hash capabilities:** ```bash root@sonic:/home/admin# show switch-hash capabilities -+--------+-------------------------------------+ -| Hash | Capabilities | -+========+=====================================+ -| ECMP | +-------------------+-------------+ | -| | | Hash Field | Algorithm | | -| | |-------------------+-------------| | -| | | IN_PORT | CRC | | -| | | DST_MAC | XOR | | -| | | SRC_MAC | RANDOM | | -| | | ETHERTYPE | CRC_32LO | | -| | | VLAN_ID | CRC_32HI | | -| | | IP_PROTOCOL | CRC_CCITT | | -| | | DST_IP | CRC_XOR | | -| | | 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 | | | -| | | IPV6_FLOW_LABEL | | | -| | +-------------------+-------------+ | -+--------+-------------------------------------+ -| LAG | +-------------------+-------------+ | -| | | Hash Field | Algorithm | | -| | |-------------------+-------------| | -| | | IN_PORT | CRC | | -| | | DST_MAC | XOR | | -| | | SRC_MAC | RANDOM | | -| | | ETHERTYPE | CRC_32LO | | -| | | VLAN_ID | CRC_32HI | | -| | | IP_PROTOCOL | CRC_CCITT | | -| | | DST_IP | CRC_XOR | | -| | | 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 | | | -| | | IPV6_FLOW_LABEL | | | -| | +-------------------+-------------+ | -+--------+-------------------------------------+ ++--------+-----------------------------------------------------------+ +| Hash | Capabilities | ++========+===========================================================+ +| ECMP | +-------------------+-------------+---------------------+ | +| | | Hash Field | Algorithm | Pkt-type | | +| | |-------------------+-------------+---------------------| | +| | | IN_PORT | CRC | IPV4 | | +| | | DST_MAC | XOR | IPV6 | | +| | | SRC_MAC | RANDOM | IPNIP | | +| | | ETHERTYPE | CRC_32LO | IPV4_RDMA | | +| | | VLAN_ID | CRC_32HI | IPV6_RDMA | | +| | | IP_PROTOCOL | CRC_CCITT | | | +| | | DST_IP | CRC_XOR | | | +| | | 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 | | | | +| | | IPV6_FLOW_LABEL | | | | +| | | RDMA_BTH_OPCODE | | | | +| | | RDMA_BTH_DEST_QP | | | | +| | +-------------------+-------------+---------------------+ | ++--------+-----------------------------------------------------------+ +| LAG | +-------------------+-------------+---------------------+ | +| | | Hash Field | Algorithm | Pkt-type | | +| | |-------------------+-------------+---------------------| | +| | | IN_PORT | CRC | IPV4 | | +| | | DST_MAC | XOR | IPV6 | | +| | | SRC_MAC | RANDOM | IPNIP | | +| | | ETHERTYPE | CRC_32LO | IPV4_RDMA | | +| | | VLAN_ID | CRC_32HI | IPV6_RDMA | | +| | | IP_PROTOCOL | CRC_CCITT | | | +| | | DST_IP | CRC_XOR | | | +| | | 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 | | | | +| | | IPV6_FLOW_LABEL | | | | +| | | RDMA_BTH_OPCODE | | | | +| | | RDMA_BTH_DEST_QP | | | | +| | +-------------------+-------------+---------------------+ | ++--------+-----------------------------------------------------------+ ``` ## 2.7 YANG model @@ -757,6 +1245,8 @@ will be extended with a new common type. enum INNER_L4_DST_PORT; enum INNER_L4_SRC_PORT; enum IPV6_FLOW_LABEL; + enum RDMA_BTH_OPCODE; + enum RDMA_BTH_DEST_QP; } } @@ -818,6 +1308,8 @@ module sonic-hash { enum INNER_L4_DST_PORT; enum INNER_L4_SRC_PORT; enum IPV6_FLOW_LABEL; + enum RDMA_BTH_OPCODE; + enum RDMA_BTH_DEST_QP; } } @@ -834,11 +1326,61 @@ module sonic-hash { type hash:hash-field; } + leaf-list ecmp_hash_ipv4 { + description "Hash fields for hashing ipv4 packets going through ECMP"; + type hash:hash-field; + } + + leaf-list ecmp_hash_ipv6 { + description "Hash fields for hashing ipv6 packets going through ECMP"; + type hash:hash-field; + } + + leaf-list ecmp_hash_ipnip { + description "Hash fields for hashing ipnip packets going through ECMP"; + type hash:hash-field; + } + + leaf-list ecmp_hash_ipv4_rdma { + description "Hash fields for hashing ipv4_rdma packets going through ECMP"; + type hash:hash-field; + } + + leaf-list ecmp_hash_ipv6_rdma { + description "Hash fields for hashing ipv6_rdma packets going through ECMP"; + type hash:hash-field; + } + leaf-list lag_hash { description "Hash fields for hashing packets going through LAG"; type hash:hash-field; } + leaf-list lag_hash_ipv4 { + description "Hash fields for hashing ipv4 packets going through LAG"; + type hash:hash-field; + } + + leaf-list lag_hash_ipv6 { + description "Hash fields for hashing ipv6 packets going through LAG"; + type hash:hash-field; + } + + leaf-list lag_hash_ipnip { + description "Hash fields for hashing ipnip packets going through LAG"; + type hash:hash-field; + } + + leaf-list lag_hash_ipv4_rdma { + description "Hash fields for hashing ipv4_rdma packets going through LAG"; + type hash:hash-field; + } + + leaf-list lag_hash_ipv6_rdma { + description "Hash fields for hashing ipv6_rdma packets going through LAG"; + type hash:hash-field; + } + leaf ecmp_hash_algorithm { description "Hash algorithm for hashing packets going through ECMP"; type stypes:hash-algorithm; @@ -867,12 +1409,21 @@ No special handling is required ## 3.1 Unit tests via VS -GH basic configuration test: +### 3.1.1 GH basic configuration test: 1. Verify ASIC DB object state after switch ECMP hash update 2. Verify ASIC DB object state after switch LAG hash update 3. Verify ASIC DB object state after switch ECMP hash algorithm update 4. Verify ASIC DB object state after switch LAG hash algorithm update +### 3.1.1 Packet type hash basic configuration test: +1. Verify ASIC DB object state after creating switch ECMP packet type hash +2. Verify ASIC DB object state after creating switch LAG packet type hash +3. Verify ASIC DB object state after updating switch ECMP packet type hash +4. Verify ASIC DB object state after updating switch LAG packet type hash +5. Verify ASIC DB object state after deleting switch ECMP packet type hash +6. Verify ASIC DB object state after deleting switch LAG packet type hash + ## 3.2 Data plane tests via PTF 1. [Generic Hash Test Plan](https://github.com/sonic-net/sonic-mgmt/pull/7524 "Test Plan") +1. [Generic Hash with Packet Type Test plan](https://github.com/sonic-net/sonic-mgmt/pull/21248 "Enhanced Test Plan") \ No newline at end of file diff --git a/doc/hash/images/gh_apply_flow.svg b/doc/hash/images/gh_apply_flow.svg new file mode 100644 index 00000000000..9f1ad68f546 --- /dev/null +++ b/doc/hash/images/gh_apply_flow.svg @@ -0,0 +1,4 @@ + + + +
SwitchOrch
SwitchOrch
SAI
SAI
CLI
CLI
ConfigDB
ConfigDB
StateDB
StateDB
query
query
sai_query_attribute_capability
sai_query_attribute_capability
return <status>
return <status>
SAI_SWITCH_ATTR_ECMP_HASHĀ 
SAI_SWITCH_ATTR_LAG_HASHĀ 
SAI_HASH_ATTR_NATIVE_HASH_FIELD_LISTĀ 
SAI_SWITCH_ATTR_ECMP_DEFAULT_HASH_ALGORITHMĀ 
SAI_SWITCH_ATTR_LAG_DEFAULT_HASH_ALGORITHM
SAI_SWITCH_ATTR_LAG_HASH_<pktType>
SAI_SWITCH_ATTR_ECMP_HASH_<pktType>
# <pktType> can be: ipv4, ipv6, ipnip, ipv4_rdma, ipv6_rdma
SAI_SWITCH_ATTR...
get switch ecmp/lag hash capabilities
get switch ecmp/lag hash capabilities
query
query
sai_query_attribute_capability
sai_query_attribute_capability
return <status>
return <status>
SAI_HASH_ATTR_NATIVE_HASH_FIELD_LISTĀ 
SAI_SWITCH_ATTR_ECMP_DEFAULT_HASH_ALGORITHMĀ 
SAI_SWITCH_ATTR_LAG_DEFAULT_HASH_ALGORITHM
SAI_HASH_ATTR_N...
push switch ecmp/lag hash capabilities to DB
push switch ecmp/lag hash capabilities to DB
HMSET SWITCH_CAPABILITY | switch
HMSET SWITCH_CAPABILITY | switch
return
return
get switch ecmp/lag hash oid
get switch ecmp/lag hash oid
get_switch_attribute
get_switch_attribute
return <status>
return <status>
opt
opt
capability is validated
capability is valida...
return <status>
return <status>
process data
process data
return
return
SWITCH_HASH | GLOBAL
SWITCH_HASH | GLOBAL
processĀ 
data
process...
set switch ecmp/lag hash field list
set switch ecmp/lag hash field list
HSET SWITCH_HASH | GLOBAL
HSET SWITCH_HASH | GLOBAL
return <status>
return <status>
set switch ecmp/lag hash algorithm
set switch ecmp/lag hash algorithm
set_hash_attribute
set_hash_attribute
set_hash_attribute
set_hash_attribute
Global Hash and Algorithm
Update Flow
Global Hash and Algorithm...
Text is not SVG - cannot display
\ No newline at end of file diff --git a/doc/hash/images/gh_update_flow.svg b/doc/hash/images/gh_update_flow.svg index 750dbf212e2..94fae9c563d 100644 --- a/doc/hash/images/gh_update_flow.svg +++ b/doc/hash/images/gh_update_flow.svg @@ -1,430 +1,1402 @@ - - - - - gh update flow - - - - - - - - - - - - - - - - - - - Page-1 - - Actor lifeline.1198 - ConfigDB - - Sheet.1001 - - - - Sheet.1002 - - - - Sheet.1003 - - - Sheet.1004 - - - - - ConfigDB - - - Object lifeline.1203 - SwitchOrch - - Sheet.1006 - - - - Sheet.1007 - - - - Sheet.1008 - - - Sheet.1009 - - - - - SwitchOrch - - - Object lifeline.1208 - SAI - - Sheet.1011 - - - - Sheet.1012 - - - - Sheet.1013 - - - Sheet.1014 - - - - - SAI - - - Actor lifeline.1213 - CLI - - Sheet.1016 - - - - Sheet.1017 - - - - Sheet.1018 - - - Sheet.1019 - - - - - CLI - - - Activation.1098 - - - - Self Message.1099 - process data - - - process data - - Activation.1102 - - - - Self Message.1103 - set switch hash - - - set switch hash - - Activation.1104 - - - - Message.1105 - HMSET SWITCH_HASH|GLOBAL - - - HMSET SWITCH_HASH|GLOBAL - - Activation.1106 - - - - Return Message.1107 - - - - Activation.1188 - - - - Self Message.1189 - set switch ecmp/lag hash field list - - - set switch ecmp/lag hash field list - - Activation.1190 - - - - Asynchronous Message.1240 - SWITCH_HASH|GLOBAL - - - SWITCH_HASH|GLOBAL - - Activation.1241 - - - - Self Message.1242 - process data - - - process data - - Message.1244 - set_hash_attribute - - - set_hash_attribute - - Activation.1245 - - - - Return Message.1246 - return <status> - - - return <status> - - Activation.1247 - - - - Self Message.1248 - get switch ecmp/lag hash oid - - - get switch ecmp/lag hash oid - - Activation.1249 - - - - Message.1250 - get_switch_attribute - - - get_switch_attribute - - Activation.1251 - - - - Return Message.1252 - return <status> - - - return <status> - - Activation.1044 - - - - Self Message.1045 - get switch ecmp/lag hash capabilities - - - get switch ecmp/lag hash capabilities - - Activation.1046 - - - - Message.1047 - sai_query_attribute_capability - - - sai_query_attribute_capability - - Activation.1048 - - - - Return Message.1049 - return <status> - - - return <status> - - Message.1050 - sai_query_attribute_enum_values_capability - - - sai_query_attribute_enum_values_capability - - Activation.1051 - - - - Return Message.1052 - return <status> - - - return <status> - - Optional fragment.1059 - - - - - Sheet.1054 - opt - - opt - - Sheet.1055 - capability is validated - capability is validated - - - Loop fragment.1063 - - - - - Sheet.1057 - query - - query - - - Loop fragment.1066 - - - - - Sheet.1060 - query - - query - - - Actor lifeline.1069 - StateDB - - Sheet.1063 - - - - Sheet.1064 - - - - Sheet.1065 - - - Sheet.1066 - - - - - StateDB - - - Activation.1074 - - - - Self Message.1075 - push switch ecmp/lag hash capabilities to DB - - - push switch ecmp/lag hash capabilities to DB - - Activation.1076 - - - - Message.1077 - HMSET SWITCH_CAPABILITY|switch - - - HMSET SWITCH_CAPABILITY|switch - - Activation.1078 - - - - Return Message.1079 - - - - Sheet.1073 - SAI_SWITCH_ATTR_ECMP_HASH SAI_SWITCH_ATTR_LAG_HASH SAI_HASH_A... - - SAI_SWITCH_ATTR_ECMP_HASH SAI_SWITCH_ATTR_LAG_HASH SAI_HASH_ATTR_NATIVE_HASH_FIELD_LIST SAI_SWITCH_ATTR_ECMP_DEFAULT_HASH_ALGORITHM SAI_SWITCH_ATTR_LAG_DEFAULT_HASH_ALGORITHM - - Sheet.1074 - SAI_HASH_ATTR_NATIVE_HASH_FIELD_LIST SAI_SWITCH_ATTR_ECMP_DEF... - - SAI_HASH_ATTR_NATIVE_HASH_FIELD_LIST SAI_SWITCH_ATTR_ECMP_DEFAULT_HASH_ALGORITHM SAI_SWITCH_ATTR_LAG_DEFAULT_HASH_ALGORITHM - - Activation.1084 - - - - Self Message.1085 - set switch ecmp/lag hash algorithm - - - set switch ecmp/lag hash algorithm - - Activation.1086 - - - - Message.1087 - set_switch_attribute - - - set_switch_attribute - - Activation.1088 - - - - Return Message.1089 - return <status> - - - return <status> - - + + + + + gh update flow + + + + + + + + + + + + + + + + + + + Page-1 + + Actor lifeline.1198 + ConfigDB + + Sheet.1001 + + + + Sheet.1002 + + + + Sheet.1003 + + + Sheet.1004 + + + + + ConfigDB + + + Object lifeline.1203 + SwitchOrch + + Sheet.1006 + + + + Sheet.1007 + + + + Sheet.1008 + + + Sheet.1009 + + + + + SwitchOrch + + + Object lifeline.1208 + SAI + + Sheet.1011 + + + + Sheet.1012 + + + + Sheet.1013 + + + Sheet.1014 + + + + + SAI + + + Actor lifeline.1213 + CLI + + Sheet.1016 + + + + Sheet.1017 + + + + Sheet.1018 + + + Sheet.1019 + + + + + CLI + + + Activation.1098 + + + + Self Message.1099 + process data + + + process data + + Activation.1102 + + + + Self Message.1103 + set switch hash + + + set switch hash + + Activation.1104 + + + + Message.1105 + HMSET SWITCH_HASH|GLOBAL + + + HMSET SWITCH_HASH|GLOBAL + + Activation.1106 + + + + Return Message.1107 + + + + Activation.1188 + + + + Self Message.1189 + set switch ecmp/lag hash field list + + + set switch ecmp/lag hash field list + + Activation.1190 + + + + Asynchronous Message.1240 + SWITCH_HASH|GLOBAL + + + SWITCH_HASH|GLOBAL + + Activation.1241 + + + + Self Message.1242 + process data + + + process data + + Message.1244 + set_hash_attribute + + + set_hash_attribute + + Activation.1245 + + + + Return Message.1246 + return <status> + + + return <status> + + Activation.1247 + + + + Self Message.1248 + get switch ecmp/lag hash oid + + + get switch ecmp/lag hash oid + + Activation.1249 + + + + Message.1250 + get_switch_attribute + + + get_switch_attribute + + Activation.1251 + + + + Return Message.1252 + return <status> + + + return <status> + + Activation.1044 + + + + Self Message.1045 + get switch ecmp/lag hash capabilities + + + get switch ecmp/lag hash capabilities + + Activation.1046 + + + + Message.1047 + sai_query_attribute_capability + + + sai_query_attribute_capability + + Activation.1048 + + + + Return Message.1049 + return <status> + + + return <status> + + Message.1050 + sai_query_attribute_enum_values_capability + + + sai_query_attribute_enum_values_capability + + Activation.1051 + + + + Return Message.1052 + return <status> + + + return <status> + + Optional fragment.1059 + + + + + Sheet.1054 + opt + + opt + + Sheet.1055 + capability is validated + capability is validated + + + Loop fragment.1063 + + + + + Sheet.1057 + query + + query + + + Loop fragment.1066 + + + + + Sheet.1060 + query + + query + + + Actor lifeline.1069 + StateDB + + Sheet.1063 + + + + Sheet.1064 + + + + Sheet.1065 + + + Sheet.1066 + + + + + StateDB + + + Activation.1074 + + + + Self Message.1075 + push switch ecmp/lag hash capabilities to DB + + + push switch ecmp/lag hash capabilities to DB + + Activation.1076 + + + + Message.1077 + HMSET SWITCH_CAPABILITY|switch + + + HMSET SWITCH_CAPABILITY|switch + + Activation.1078 + + + + Return Message.1079 + + + + Sheet.1073 + SAI_SWITCH_ATTR_ECMP_HASH SAI_SWITCH_ATTR_LAG_HASH SAI_HASH_A... + + SAI_SWITCH_ATTR_ECMP_HASH SAI_SWITCH_ATTR_LAG_HASH SAI_HASH_ATTR_NATIVE_HASH_FIELD_LIST SAI_SWITCH_ATTR_ECMP_DEFAULT_HASH_ALGORITHM SAI_SWITCH_ATTR_LAG_DEFAULT_HASH_ALGORITHM +SAI_SWITCH_ATTR_LAG_HASH_<pktType> +SAI_SWITCH_ATTR_ECMP_HASH_<pktType> +# <pktType> can be: ipv4, ipv6, ipnip, ipv4_rdma, ipv6_rdma_ + + Sheet.1074 + SAI_HASH_ATTR_NATIVE_HASH_FIELD_LIST SAI_SWITCH_ATTR_ECMP_DEF... + + SAI_HASH_ATTR_NATIVE_HASH_FIELD_LIST SAI_SWITCH_ATTR_ECMP_DEFAULT_HASH_ALGORITHM SAI_SWITCH_ATTR_LAG_DEFAULT_HASH_ALGORITHM + + Activation.1084 + + + + Self Message.1085 + set switch ecmp/lag hash algorithm + + + set switch ecmp/lag hash algorithm + + Activation.1086 + + + + Message.1087 + set_switch_attribute + + + set_switch_attribute + + Activation.1088 + + + + Return Message.1089 + return <status> + + + return <status> + + diff --git a/doc/hash/images/pkt_type_hash_delete_flow.svg b/doc/hash/images/pkt_type_hash_delete_flow.svg new file mode 100644 index 00000000000..e0b879c4606 --- /dev/null +++ b/doc/hash/images/pkt_type_hash_delete_flow.svg @@ -0,0 +1,4 @@ + + + +
SwitchOrch
SwitchOrch
SAI
SAI
CLI
CLI
ConfigDB
ConfigDB
StateDB
StateDB
SWITCH_HASH | GLOBAL
SWITCH_HASH | GLOBAL
processĀ 
data
process...
remove switch ecmp/lag hash
remove switch ecmp/lag hash
HDEL SWITCH_HASH | GLOBAL
HDEL SWITCH_HASH | GLOBAL
Opt
Opt
[packet-type
hash exists]
[packet-type...
set_switch_attribute
set_switch_attribute
return <status>
return <status>
return
return
remove_hash
remove_hash
return <status>
return <status>
query capability from DB
query capability fro...
Support config only if capabilities exists for packet-type hash
Support config only i...
Packet Type HashĀ 
Delete Flow
Packet Type Hash...
SAI_SWITCH_ATTR_<mod>_HASH_<pktTpe> = NULL
# <mod> can be ECMP, LAG
# <pktTpe> can be ipv4,ipv6,ipnip, ipv4_rdma,ipv6_rdma
SAI_SWITCH_ATTR_<mod>_HASH_<pktTpe> = NUL...
<mod>_hash_<pktType>
# <mod> can be ECMP, LAG
# <pktTpe> can be ipv4,ipv6,ipnip, ipv4_rdma,ipv6_rdma
<mod>_hash_<pktType>...
Text is not SVG - cannot display
\ No newline at end of file diff --git a/doc/hash/images/pkt_type_hash_update_flow.svg b/doc/hash/images/pkt_type_hash_update_flow.svg new file mode 100644 index 00000000000..09ed5bae964 --- /dev/null +++ b/doc/hash/images/pkt_type_hash_update_flow.svg @@ -0,0 +1,4 @@ + + + +
SwitchOrch
SwitchOrch
SAI
SAI
CLI
CLI
ConfigDB
ConfigDB
StateDB
StateDB
return <status>
return <status>
set_switch_attribute
set_switch_attribute
Packet Type Hash Create/Update Flow
Packet Type Hash Create/Up...
SAI_SWITCH_ATTR_<mod>_HASH_<pktTpe>
# <mod> can be ECMP, LAG
# <pktTpe> can be ipv4,ipv6,ipnip, ipv4_rdma,ipv6_rdma
SAI_SWITCH_ATTR_<mod>_HASH_<pktTpe...
<mod>_hash_<pktType>
# <mod> can be ECMP, LAG
# <pktTpe> can be ipv4,ipv6,ipnip, ipv4_rdma,ipv6_rdma
<mod>_hash_<pktType>...
alt
alt
[if packet-type hash]
[if packet-type h...
return <status>
return <status>
return
return
SWITCH_HASH | GLOBAL
SWITCH_HASH | GLOBAL
processĀ 
data
process...
create switch ecmp/lag packet-type hash field list
create switch ecmp/lag packet-type hash field list
[else]
[else]
set_hash_attribute
set_hash_attribute
return <status>
return <status>
HSET SWITCH_HASH | GLOBAL
HSET SWITCH_HASH | GLOBAL
set switch ecmp/lag packet-type hash field list
set switch ecmp/lag packet-type hash field list
create_hash
create_hash
Support config only if capabilities exists for packet-type hash
Support config only i...
query capability from DB
query capability fro...
Text is not SVG - cannot display
\ No newline at end of file