[hash] Add ECMP/LAG Hash Algorithm YANG model (#17079)
- Why I did it Added YANG model as part of Generic Hash feature development - How I did it Added YANG model - How to verify it 1. Add UT 2. Verified manually with the feature qualification Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>
This commit is contained in:
parent
c43ea1c904
commit
c99ec1f80a
@ -1194,7 +1194,7 @@ The FG_NHG_PREFIX table provides the FG_NHG_PREFIX for which FG behavior is desi
|
|||||||
|
|
||||||
### Hash
|
### Hash
|
||||||
|
|
||||||
Generic hash allows user to configure which hash fields are suppose to be used by a hashing algorithm.
|
Generic hash allows user to configure various aspects of hashing algorithm.
|
||||||
The configuration is applied globally for each ECMP and LAG on a switch.
|
The configuration is applied globally for each ECMP and LAG on a switch.
|
||||||
|
|
||||||
***ECMP/LAG HASH***
|
***ECMP/LAG HASH***
|
||||||
@ -1238,7 +1238,9 @@ The configuration is applied globally for each ECMP and LAG on a switch.
|
|||||||
"INNER_SRC_IP",
|
"INNER_SRC_IP",
|
||||||
"INNER_L4_DST_PORT",
|
"INNER_L4_DST_PORT",
|
||||||
"INNER_L4_SRC_PORT"
|
"INNER_L4_SRC_PORT"
|
||||||
]
|
],
|
||||||
|
"ecmp_hash_algorithm": "CRC",
|
||||||
|
"lag_hash_algorithm": "CRC"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -339,7 +339,9 @@
|
|||||||
"L4_SRC_PORT",
|
"L4_SRC_PORT",
|
||||||
"INNER_DST_IP",
|
"INNER_DST_IP",
|
||||||
"INNER_SRC_IP"
|
"INNER_SRC_IP"
|
||||||
]
|
],
|
||||||
|
"ecmp_hash_algorithm": "CRC",
|
||||||
|
"lag_hash_algorithm": "XOR"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"DEVICE_METADATA": {
|
"DEVICE_METADATA": {
|
||||||
|
@ -9,5 +9,13 @@
|
|||||||
"SWITCH_HASH_INVALID_LAG_HASH": {
|
"SWITCH_HASH_INVALID_LAG_HASH": {
|
||||||
"desc": "Configure invalid LAG_HASH in SWITCH_HASH.",
|
"desc": "Configure invalid LAG_HASH in SWITCH_HASH.",
|
||||||
"eStrKey": "InvalidValue"
|
"eStrKey": "InvalidValue"
|
||||||
|
},
|
||||||
|
"SWITCH_HASH_INVALID_ECMP_HASH_ALGORITHM": {
|
||||||
|
"desc": "Configure invalid ECMP_HASH_ALGORITHM in SWITCH_HASH.",
|
||||||
|
"eStrKey": "InvalidValue"
|
||||||
|
},
|
||||||
|
"SWITCH_HASH_INVALID_LAG_HASH_ALGORITHM": {
|
||||||
|
"desc": "Configure invalid LAG_HASH_ALGORITHM in SWITCH_HASH.",
|
||||||
|
"eStrKey": "InvalidValue"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,9 @@
|
|||||||
"L4_SRC_PORT",
|
"L4_SRC_PORT",
|
||||||
"INNER_DST_IP",
|
"INNER_DST_IP",
|
||||||
"INNER_SRC_IP"
|
"INNER_SRC_IP"
|
||||||
]
|
],
|
||||||
|
"ecmp_hash_algorithm": "CRC",
|
||||||
|
"lag_hash_algorithm": "XOR"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -46,5 +48,23 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"SWITCH_HASH_INVALID_ECMP_HASH_ALGORITHM": {
|
||||||
|
"sonic-hash:sonic-hash": {
|
||||||
|
"sonic-hash:SWITCH_HASH": {
|
||||||
|
"sonic-hash:GLOBAL": {
|
||||||
|
"ecmp_hash_algorithm": "INVALID_VALUE"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"SWITCH_HASH_INVALID_LAG_HASH_ALGORITHM": {
|
||||||
|
"sonic-hash:sonic-hash": {
|
||||||
|
"sonic-hash:SWITCH_HASH": {
|
||||||
|
"sonic-hash:GLOBAL": {
|
||||||
|
"lag_hash_algorithm": "INVALID_VALUE"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,10 @@ module sonic-hash {
|
|||||||
|
|
||||||
description "HASH YANG Module for SONiC OS";
|
description "HASH YANG Module for SONiC OS";
|
||||||
|
|
||||||
|
revision 2023-09-25 {
|
||||||
|
description "Added hashing algorithm configuration";
|
||||||
|
}
|
||||||
|
|
||||||
revision 2022-09-05 {
|
revision 2022-09-05 {
|
||||||
description "First Revision";
|
description "First Revision";
|
||||||
}
|
}
|
||||||
@ -57,6 +61,16 @@ module sonic-hash {
|
|||||||
type hash:hash-field;
|
type hash:hash-field;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
leaf ecmp_hash_algorithm {
|
||||||
|
description "Hash algorithm for hashing packets going through ECMP";
|
||||||
|
type stypes:hash-algorithm;
|
||||||
|
}
|
||||||
|
|
||||||
|
leaf lag_hash_algorithm {
|
||||||
|
description "Hash algorithm for hashing packets going through LAG";
|
||||||
|
type stypes:hash-algorithm;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
/* end of container GLOBAL */
|
/* end of container GLOBAL */
|
||||||
}
|
}
|
||||||
|
@ -334,6 +334,19 @@ module sonic-types {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
typedef hash-algorithm {
|
||||||
|
description "Represents hash algorithm";
|
||||||
|
type enumeration {
|
||||||
|
enum CRC;
|
||||||
|
enum XOR;
|
||||||
|
enum RANDOM;
|
||||||
|
enum CRC_32LO;
|
||||||
|
enum CRC_32HI;
|
||||||
|
enum CRC_CCITT;
|
||||||
|
enum CRC_XOR;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
typedef timezone-name-type {
|
typedef timezone-name-type {
|
||||||
type string;
|
type string;
|
||||||
description
|
description
|
||||||
|
Loading…
Reference in New Issue
Block a user