Skip to content

[doc]: Clarify HFT enterprise number layout - #2346

Merged
Pterosaur merged 1 commit into
opencomputeproject:masterfrom
Pterosaur:fix/hft-enterprise-number-layout
Sep 5, 2026
Merged

[doc]: Clarify HFT enterprise number layout#2346
Pterosaur merged 1 commit into
opencomputeproject:masterfrom
Pterosaur:fix/hft-enterprise-number-layout

Conversation

@Pterosaur

@Pterosaur Pterosaur commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

What I did

Clarified the HFT IPFIX enterprise-number wire layout and corrected the example value:

  • the first 16 bits on the wire encode the SAI object type;
  • the following 16 bits encode the SAI stats ID;
  • multi-byte values use network byte order.

For queue type 0x0015 and stat ID 0x0022, this gives 0x00150022, or wire bytes 00 15 00 22.

Why I did it

The previous formula placed the stat ID in the high 16 bits and contradicted both the adjacent bit diagram and the current SONiC countersyncd HFT IPFIX decoder.

How I verified it

This is a one-line documentation correction. git diff --check passes and the old example value no longer appears in the document.

The matching sonic-net/SONiC HLD change is submitted separately.

Matching SONiC HLD PR: sonic-net/SONiC#2537

Signed-off-by: Ze Gan <ganze718@gmail.com>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The updated bullet text conflicts with the adjacent EF bit diagram (which reserves the MSB of each 16-bit half for EF), so the description should be adjusted to avoid misleading readers when EF=1.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR clarifies the documentation for how the HFT IPFIX enterprise-number is encoded on the wire, correcting the example value to match the intended wire layout and decoder behavior.

Changes:

  • Corrected the enterprise-number composition to place SAI_OBJECT_TYPE in the high 16 bits and stats ID in the low 16 bits (network byte order).
  • Updated the worked example to 0x00150022 and added the corresponding wire bytes 00 15 00 22.
File summaries
File Description
doc/TAM/SAI-Proposal-TAM-stream-telemetry.md Updates the enterprise-number encoding explanation and example for HFT IPFIX stream telemetry.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

- For high-frequency counters, the native IPFIX timestamp unit of seconds is insufficient. Therefore, we introduce an additional element, `observationTimeNanoseconds`, for each record to meet our requirements.
- The element ID of IPFIX is derived from the object index. For example, for `Ethernet5`, the element ID will be `0x5 | 0x8000 = 0x8005`, where `0x8000` indicates that the enterprise bit is set to 1.
- The enterprise number is derived from the combination of the [SAI_OBJECT_TYPE](https://github.com/opencomputeproject/SAI/blob/master/inc/saitypes.h) and its corresponding stats ID. The high bits are used to indicate the SAI extension flag. For example, for `SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS=0x00000022` of `SAI_OBJECT_TYPE_QUEUE=0x00000015`, the enterprise number will be `0x00000022 << 16 | 0x00000015 = 0x00220015`.
- The first 16 bits of the enterprise number on the wire encode the [SAI_OBJECT_TYPE](https://github.com/opencomputeproject/SAI/blob/master/inc/saitypes.h), and the following 16 bits encode its stats ID. Multi-byte values use network byte order. Therefore, for `SAI_OBJECT_TYPE_QUEUE=0x00000015` and `SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS=0x00000022`, the enterprise number is `0x00000015 << 16 | 0x00000022 = 0x00150022` (wire bytes `00 15 00 22`).
@Pterosaur

Copy link
Copy Markdown
Collaborator Author

/azpw run

@Pterosaur

Copy link
Copy Markdown
Collaborator Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@Pterosaur
Pterosaur merged commit 8f11be4 into opencomputeproject:master Sep 5, 2026
3 checks passed
@Pterosaur
Pterosaur deleted the fix/hft-enterprise-number-layout branch September 5, 2026 08:36
Pterosaur added a commit to sonic-net/SONiC that referenced this pull request Sep 5, 2026
What I did
Clarified the HFT IPFIX enterprise-number wire layout and corrected the example value:

the first 16 bits on the wire encode the SAI object type;
the following 16 bits encode the SAI stats ID;
multi-byte values use network byte order.
For queue type 0x0015 and stat ID 0x0022, this gives 0x00150022, or wire bytes 00 15 00 22.

Why I did it
The previous formula placed the stat ID in the high 16 bits and contradicted both the adjacent bit diagram and the current countersyncd HFT IPFIX decoder.

How I verified it
This is a one-line documentation correction. git diff --check passes and the old example value no longer appears in the HLD.

The matching OCP SAI documentation change is submitted separately.

Matching OCP SAI PR: opencomputeproject/SAI#2346

Signed-off-by: Ze Gan <ganze718@gmail.com>
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.

4 participants