[switchorch]: Add support of ECMP and LAG hash seed attribute#324
[switchorch]: Add support of ECMP and LAG hash seed attribute#324stcheng merged 1 commit intosonic-net:masterfrom volodymyrsamotiy:hash_seed
Conversation
stcheng
left a comment
There was a problem hiding this comment.
Looks good to me. Left some comments to discuss.
orchagent/switchorch.cpp
Outdated
| vector<string> attributes; | ||
|
|
||
| if (switch_attribute_map.find(attribute) == switch_attribute_map.end()) | ||
| if (fvField(i) == "hash_seed") |
There was a problem hiding this comment.
i wonder if we don't need such logics here. if we would like to set the two values with the same value, it is okay that we feed the swssconfig with the JSON file that contains both attributes with the same value. Thus the for loop below is not necessary.
There was a problem hiding this comment.
I agree that it would be better and logical to set hash seed attributes separately. I will update the pull request with appropriate changes.
Since changes were done according to requirements document, I believe it should be updated as well. (https://github.com/Azure/SONiC/wiki/ECMP-and-LAG-Hash-Seed)
orchagent/switchorch.cpp
Outdated
| {"fdb_broadcast_miss_packet_action", SAI_SWITCH_ATTR_FDB_BROADCAST_MISS_PACKET_ACTION}, | ||
| {"fdb_multicast_miss_packet_action", SAI_SWITCH_ATTR_FDB_MULTICAST_MISS_PACKET_ACTION} | ||
| {"fdb_multicast_miss_packet_action", SAI_SWITCH_ATTR_FDB_MULTICAST_MISS_PACKET_ACTION}, | ||
| {"ecmp_default_hash_seed", SAI_SWITCH_ATTR_ECMP_DEFAULT_HASH_SEED}, |
There was a problem hiding this comment.
agree. default shall not be in the attribute name. default is a value not an attribute. the SAI attribute name is not perfect.
orchagent/switchorch.cpp
Outdated
| {"fdb_multicast_miss_packet_action", SAI_SWITCH_ATTR_FDB_MULTICAST_MISS_PACKET_ACTION} | ||
| {"fdb_multicast_miss_packet_action", SAI_SWITCH_ATTR_FDB_MULTICAST_MISS_PACKET_ACTION}, | ||
| {"ecmp_default_hash_seed", SAI_SWITCH_ATTR_ECMP_DEFAULT_HASH_SEED}, | ||
| {"lag_default_hash_seed", SAI_SWITCH_ATTR_LAG_DEFAULT_HASH_SEED} |
|
|
||
| case SAI_SWITCH_ATTR_ECMP_DEFAULT_HASH_SEED: | ||
| case SAI_SWITCH_ATTR_LAG_DEFAULT_HASH_SEED: | ||
| attr.value.u32 = to_uint<uint32_t>(value); |
There was a problem hiding this comment.
do we have test cases for different hash seeds?
There was a problem hiding this comment.
No, as far as I know, we don't have.
Signed-off-by: Volodymyr Samotiy <volodymyrs@mellanox.com>
* msft_github/master: [portsorch]: Use sai_serialize api to write to DB (sonic-net#331) [portsorch]: Update comments (sonic-net#333) [switchorch]: Add support of ECMP and LAG hash seed attribute (sonic-net#324) [portsorch]: Add support of cable breakout feature (sonic-net#320)
…tem info on device (sonic-net#324) The information includes: -- platform string -- system mac -- port configuration: alias, lanes, speed, index This is useful when we first load the configuration from config_db.json generated outside which does not have the information on the device. The default behaviour is not changed, so it won't impact the system unless you use this option. This can be used for ZTP to config the box the first time and avoid any addtional work which could cause inconsistency.
…onic-net#324) (sonic-net#329) - Description Add media assignment options to Application Advertisement - Motivation and Context Add media assignment options to Application Advertisement - How Has This Been Tested? Manual test
…onic-net#324) * [MultiDB]:swsscommon replace old API with new APIs including tests * update code format * move db setup into global setup
Signed-off-by: Volodymyr Samotiy volodymyrs@mellanox.com