Skip to content

[doc]: Add HLD for inner-aware flow hash on VPP dataplane#235

Open
yejianquan wants to merge 1 commit into
sonic-net:masterfrom
yejianquan:inner-aware-flow-hash-hld
Open

[doc]: Add HLD for inner-aware flow hash on VPP dataplane#235
yejianquan wants to merge 1 commit into
sonic-net:masterfrom
yejianquan:inner-aware-flow-hash-hld

Conversation

@yejianquan
Copy link
Copy Markdown

@yejianquan yejianquan commented May 19, 2026

Repo PR state
sinic-platform-vpp Add patch to support inner pick hashing GitHub issue/pull request detail
sonic-sairedis [vslib/vpp] Opt in to inner-aware flow hash GitHub issue/pull request detail
sonic-mgmt Enable test_fib inner_hash testing GitHub issue/pull request detail

This HLD covers the new IP_FLOW_HASH_PEEK_INNER flag on ip4/ip6_compute_flow_hash and the always-on inner peek inside hash-eth-l34 (LAG). Together they let SONiC-VPP load-balance transit tunnel traffic (IPinIP, 6in4, 4in6, 6in6, GRE-IP, NVGRE) on inner-flow entropy instead of collapsing onto a single ECMP path / bond member.

Document is structured into 9 numbered sections plus two appendices (File Change Summary, VPP Flow-Hash + Hash Function API Reference) and a Known Issues / Open Items section that tracks one follow-up (compile-time guard on flow-hash bit overflow) and three issues already corrected during review.

This HLD only adds the documentation file under
docs/HLD/. The corresponding code lives in:

  • sonic-platform-vpp PR (this repo): vppbld/patches/ 0010-sonic-inner-aware-flow-hash.patch
  • sonic-sairedis PR: libsaivs VPP_IP_API_FLOW_HASH_PEEK_INNER
    • AF_INET6 hash_set call in SwitchVppRif.cpp
  • sonic-buildimage: submodule bump for sonic-sairedis
    signed-off-by: jianquanye@microsoft.com

This HLD covers the new IP_FLOW_HASH_PEEK_INNER flag on
ip4/ip6_compute_flow_hash and the always-on inner peek inside
hash-eth-l34 (LAG).  Together they let SONiC-VPP load-balance
transit tunnel traffic (IPinIP, 6in4, 4in6, 6in6, GRE-IP, NVGRE)
on inner-flow entropy instead of collapsing onto a single
ECMP path / bond member.

Document is structured into 9 numbered sections plus two
appendices (File Change Summary, VPP Flow-Hash + Hash Function
API Reference) and a Known Issues / Open Items section that
tracks one follow-up (compile-time guard on flow-hash bit
overflow) and three issues already corrected during review.

This HLD only adds the documentation file under
docs/HLD/.  The corresponding code lives in:

  - sonic-platform-vpp PR (this repo): vppbld/patches/
      0010-sonic-inner-aware-flow-hash.patch
  - sonic-sairedis PR: libsaivs VPP_IP_API_FLOW_HASH_PEEK_INNER
      + AF_INET6 hash_set call in SwitchVppRif.cpp
  - sonic-buildimage: submodule bump for sonic-sairedis

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Jianquan Ye <jianquanye@microsoft.com>
@mssonicbld
Copy link
Copy Markdown

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@yejianquan
Copy link
Copy Markdown
Author

Hi @yue-fred-gao @lolyu , could you please help to review the HLD and related PRs?

This document describes the **inner-aware flow hash** feature for the SONiC VPP
dataplane. The feature lets VPP's IPv4 / IPv6 ECMP and LAG load-balancers
hash on the inner header of tunneled traffic (IPinIP, 6in4, 4in6, 6in6,
GRE-IP, NVGRE) instead of the outer 5-tuple, so transit tunnel flows
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is SRv6 in the scope? If not, please add it to the exclusion

existing `set ip flow-hash` CLI / API — no new SAI attribute is
required.

### 4.4 LAG Surface — Always-On with Safe Fallback
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I am not sure if we want to change existing behaviour. From sonic perspective, there is no option to toggle between outer and inner. I think we can introduce a new Algo that hash inner. And sonic also choose the the new algo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants