[sonic-utilities] Add CLI support for generic hash (per-packet-type ECMP/LAG hashing)#4539
Open
jithenderkondam wants to merge 3 commits into
Open
[sonic-utilities] Add CLI support for generic hash (per-packet-type ECMP/LAG hashing)#4539jithenderkondam wants to merge 3 commits into
jithenderkondam wants to merge 3 commits into
Conversation
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
…CMP/LAG hashing) Why I did it: SONiC HLD sonic-net/SONiC#2100 introduces a "Generic Hash" feature that adds per-packet-type ECMP/LAG hashing (IPv4, IPv6, IPNIP, IPV4_RDMA, IPV6_RDMA) and two new RDMA hash fields (RDMA_BTH_OPCODE, RDMA_BTH_DEST_QP). The existing CLI only supported a single switch-wide ECMP/LAG hash list and had no awareness of the new per-packet-type capabilities advertised in STATE_DB. This change adds the user-facing configure/show commands, validation and tests needed to use the feature. How I did it: - Added new per-packet-type capability keys and the two new RDMA hash fields in utilities_common/switch_hash.py. - Extended `config switch-hash global ecmp-hash/lag-hash` with `--packet-type` and `--action {add|del}` options (overwrite/merge/ delete semantics) and updated the validators to check the new capabilities. - Extended `show switch-hash global` with `--packet-type` and updated `show switch-hash capabilities` to display the new "Packet Type" column (text and JSON). - Updated doc/Command-Reference.md with the new options and examples. - Added new mock STATE_DB files, refreshed existing ones, updated expected outputs, and added pytest cases for add/del/merge, idempotency and negative scenarios. Signed-off-by: Jithender Kondam <jreddy@marvell.com>
jithenderkondam
force-pushed
the
feature/pkt-type-hash
branch
from
May 13, 2026 07:43
e9cb976 to
1f6e74b
Compare
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Jithender Kondam <jreddy@marvell.com>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Jithender Kondam <jreddy@marvell.com>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why I did it:
SONiC HLD sonic-net/SONiC#2100 introduces a "Generic
Hash" feature that adds per-packet-type ECMP/LAG hashing (IPv4, IPv6, IPNIP,
IPV4_RDMA, IPV6_RDMA) and two new RDMA hash fields (RDMA_BTH_OPCODE,
RDMA_BTH_DEST_QP). The existing CLI only supported a single switch-wide
ECMP/LAG hash list and had no awareness of the new per-packet-type
capabilities advertised in STATE_DB. This change adds the user-facing
configure/show commands, validation and tests needed to use the feature.
How I did it:
fields in utilities_common/switch_hash.py.
config switch-hash global ecmp-hash/lag-hashwith--packet-typeand--action {add|del}options (overwrite/merge/delete semantics) and updated the validators to check the new
capabilities.
show switch-hash globalwith--packet-typeand updatedshow switch-hash capabilitiesto display the new "Packet Type"column (text and JSON).
expected outputs, and added pytest cases for add/del/merge,
idempotency and negative scenarios.
How to verify it:
Run the sonic-utilities unit tests.
Which release branch to backport (provide reason below if selected):
Tested branch (Please provide the tested image version):