Skip to content

Optimized Forwarding Headers#2285

Closed
JaiOCP wants to merge 3 commits into
opencomputeproject:masterfrom
JaiOCP:esun
Closed

Optimized Forwarding Headers#2285
JaiOCP wants to merge 3 commits into
opencomputeproject:masterfrom
JaiOCP:esun

Conversation

@JaiOCP

@JaiOCP JaiOCP commented May 14, 2026

Copy link
Copy Markdown
Contributor

This PR brings a generic framework to support multiple activities going on for defining the Optimized Forwarding Header like IEEE compressed Header, OCP ESUN Header, UEC Unified Forwarding Header and more.

Comment thread inc/saidebugcounter.h
SAI_IN_DROP_REASON_LPM_MISS = 0x00000039,

/** OFH packet TTL expired */
SAI_IN_DROP_REASON_OFH_TTL,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Keep it consistent with IP or not ?

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.

If we assume that the switch will only accept a single type of Header for now, I think we should use the original TTL reason for OFH TTL=0.

Comment thread inc/saiswitch.h
SAI_SWITCH_ATTR_OFH,

/**
* @brief OFH header max size

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Improve comments to explian the use of max size supported by HW.

@kcudnik

kcudnik commented May 21, 2026

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

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

@kcudnik

kcudnik commented May 21, 2026

Copy link
Copy Markdown
Collaborator

@JaiOCP validator is not handling merges, you will need to rebase your change on master and force push

@JaiOCP

JaiOCP commented May 21, 2026 via email

Copy link
Copy Markdown
Contributor Author

@kcudnik

kcudnik commented May 21, 2026

Copy link
Copy Markdown
Collaborator

you dont need to recreate, you can jsut rebase and force push to your branch

Comment thread inc/saiofhroute.h Outdated
Comment thread inc/saitypes.h
@kcudnik

kcudnik commented May 27, 2026

Copy link
Copy Markdown
Collaborator

you need to squash and force push

Comment thread inc/saiofh.h
Comment thread inc/saiofh.h
Comment thread inc/saiofh.h
Comment thread inc/saiofh.h
@JaiOCP JaiOCP force-pushed the esun branch 2 times, most recently from afce008 to 525dc60 Compare June 1, 2026 21:38
author JaiOCP <jai.kumar@broadcom.com> 1778539406 -0700
committer JaiOCP <jai.kumar@broadcom.com> 1780349627 -0700

Optimized Forwarding Header

Signed-off-by: JaiOCP <jai.kumar@broadcom.com>

OFH Support

Signed-off-by: JaiOCP <jai.kumar@broadcom.com>

Fix gensairpc.pl crash on Doxygen 1.9.8+ by reusing NeedsTwoPassProcessing (opencomputeproject#2282)

Why:
To fix below build error

Uncaught exception from user code:
	 at gensairpc.pl line 480.
		main::assign_attr_types(HASH(0x55e190dc20c8), ARRAY(0x55e190d2d080)) called at gensairpc.pl line 434
		main::get_definitions() called at gensairpc.pl line 156
	main::assign_attr_types(HASH(0x55e190dc20c8), ARRAY(0x55e190d2d080)) called at gensairpc.pl line 434
	main::get_definitions() called at gensairpc.pl line 156

How:
gensairpc.pl crashed during SAI thrift build with an uncaught exception
at line 480 (assign_attr_types) because its inline Doxygen layout
detection was too weak - it only checked sai_8h.xml for any enumvalue
presence, missing cases where the new Doxygen 1.9.8+ XML structure
requires group__*.xml files to be processed for complete definitions.
This caused incomplete parsing, leading to missing types and a croak
in assign_attr_types when sai_attribute_value_t could not be found.

Changes:
- xmlutils.pm: Add NeedsTwoPassProcessing and export it.
- parse.pl: Remove local NeedsTwoPassProcessing; use imported version.
- gensairpc.pl: Replace inline detection with NeedsTwoPassProcessing()
  call, fixing the build failure and eliminating code duplication.

Signed-off-by: Pavan Naregundi <pnaregundi@marvell.com>

OFH Header

Signed-off-by: JaiOCP <jai.kumar@broadcom.com>

Count BFD session state changes from UP to DOWN (opencomputeproject#2268)

Signed-off-by: Chikkegowda Chikkaiah <cchikkai@cisco.com>

HW FRR switchover notification support for protection groups (opencomputeproject#2269)

Signed-off-by: Chikkegowda Chikkaiah <cchikkai@cisco.com>

Port storm control enhancemnets (opencomputeproject#2258) (opencomputeproject#2258)

Signed-off-by: rpmarvell <rperumal@marvell.com>

Fix gensairpc.pl crash on Doxygen 1.9.8+ by reusing NeedsTwoPassProcessing (opencomputeproject#2282)

Why:
To fix below build error

Uncaught exception from user code:
	 at gensairpc.pl line 480.
		main::assign_attr_types(HASH(0x55e190dc20c8), ARRAY(0x55e190d2d080)) called at gensairpc.pl line 434
		main::get_definitions() called at gensairpc.pl line 156
	main::assign_attr_types(HASH(0x55e190dc20c8), ARRAY(0x55e190d2d080)) called at gensairpc.pl line 434
	main::get_definitions() called at gensairpc.pl line 156

How:
gensairpc.pl crashed during SAI thrift build with an uncaught exception
at line 480 (assign_attr_types) because its inline Doxygen layout
detection was too weak - it only checked sai_8h.xml for any enumvalue
presence, missing cases where the new Doxygen 1.9.8+ XML structure
requires group__*.xml files to be processed for complete definitions.
This caused incomplete parsing, leading to missing types and a croak
in assign_attr_types when sai_attribute_value_t could not be found.

Changes:
- xmlutils.pm: Add NeedsTwoPassProcessing and export it.
- parse.pl: Remove local NeedsTwoPassProcessing; use imported version.
- gensairpc.pl: Replace inline detection with NeedsTwoPassProcessing()
  call, fixing the build failure and eliminating code duplication.

Signed-off-by: Pavan Naregundi <pnaregundi@marvell.com>

Count BFD session state changes from UP to DOWN (opencomputeproject#2268)

Signed-off-by: Chikkegowda Chikkaiah <cchikkai@cisco.com>

Merge Conflict

Signed-off-by: JaiOCP <jai.kumar@broadcom.com>

Optimized Forwarding Header

Signed-off-by: JaiOCP <jai.kumar@broadcom.com>

Optimized Forwarding Header

Signed-off-by: JaiOCP <jai.kumar@broadcom.com>
@BYGX-wcr

BYGX-wcr commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Hi @JaiOCP,

I have a few questions regarding the abstract forwarding behavior of OFH below:

  1. How do we specify if the switch should do L2 forwarding (exact match) or L3 forwarding (LPM) on the OFH packet? Looks like we assume that the switch uses a single OFH route table for every packet in the current model?
  2. If we want to define the switch to do L3 forwarding on OFH packets, is the SAI Router Interface Object still relevant here? If we still use SAI Router Interface Object, the router mac of the RIF object will be different than the MAC DA of a transit OFH packet. In this scenario, is the switch still able to do routing on the packet?

@kcudnik

kcudnik commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

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

Comment thread inc/saiofh.h
* @validonly SAI_OFH_ATTR_TYPE == SAI_OFH_TYPE_AFH or SAI_OFH_ATTR_TYPE == SAI_OFH_TYPE_ESUN
*/
SAI_OFH_ATTR_VER,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As discussed in the meeting, the version enum needs to be decoupled from the value in the version field. Version enum indicates to the SAI adapter which fields are present or absent for a given header version. The version number, however, represents the actual value  stored in the header's version field for that enum.
Example: if specifying IP, IPv4 and IPv6 could use version enum values 0 and 1, respectively, while the corresponding values in the header’s version field would be 4 and 6..

Comment thread inc/saiofhroute.h
* The next hop id can be a generic next hop object, such as next hop, next
* hop group. Directly reachable routes are the IP subnets that are
* directly attached to the router. For such routes, fill the router
* interface id to which the subnet is attached. IP2ME route adds a local

@BYGX-wcr BYGX-wcr Jun 11, 2026

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.

We still want the OFH route to support IP2ME route semantics because we are thinking of running routing protocols such as BGP across the SUE switches. Without the support of IP2ME route, the switches can't exchange OFH packets carrying routing protocol payload unless there is another handy alternative.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

updated the text

Comment thread inc/sairouterinterface.h
Comment thread inc/saiofhroute.h
author JaiOCP <jai.kumar@broadcom.com> 1780351110 -0700
committer JaiOCP <jai.kumar@broadcom.com> 1781547347 -0700

Optimized Forwarding Header

Signed-off-by: JaiOCP <jai.kumar@broadcom.com>

Optimized Forwarding Header

Signed-off-by: JaiOCP <jai.kumar@broadcom.com>

Fix gensairpc.pl crash on Doxygen 1.9.8+ by reusing NeedsTwoPassProcessing (opencomputeproject#2282)

Why:
To fix below build error

Uncaught exception from user code:
	 at gensairpc.pl line 480.
		main::assign_attr_types(HASH(0x55e190dc20c8), ARRAY(0x55e190d2d080)) called at gensairpc.pl line 434
		main::get_definitions() called at gensairpc.pl line 156
	main::assign_attr_types(HASH(0x55e190dc20c8), ARRAY(0x55e190d2d080)) called at gensairpc.pl line 434
	main::get_definitions() called at gensairpc.pl line 156

How:
gensairpc.pl crashed during SAI thrift build with an uncaught exception
at line 480 (assign_attr_types) because its inline Doxygen layout
detection was too weak - it only checked sai_8h.xml for any enumvalue
presence, missing cases where the new Doxygen 1.9.8+ XML structure
requires group__*.xml files to be processed for complete definitions.
This caused incomplete parsing, leading to missing types and a croak
in assign_attr_types when sai_attribute_value_t could not be found.

Changes:
- xmlutils.pm: Add NeedsTwoPassProcessing and export it.
- parse.pl: Remove local NeedsTwoPassProcessing; use imported version.
- gensairpc.pl: Replace inline detection with NeedsTwoPassProcessing()
  call, fixing the build failure and eliminating code duplication.

Signed-off-by: Pavan Naregundi <pnaregundi@marvell.com>

Count BFD session state changes from UP to DOWN (opencomputeproject#2268)

Signed-off-by: Chikkegowda Chikkaiah <cchikkai@cisco.com>

SAI API Performance Monitoring (opencomputeproject#2287)

Signed-off-by: JaiOCP <jai.kumar@broadcom.com>

Support OTN attenuator and amplifier (opencomputeproject#2217)

1. Add a new precision attribute flag for optical analog values (e.g., gain, tilt, power), instead of using double/float point type which would introduce NaN issue.
2. Add support for optical attenuator in experimental extensions, derived from openconfig-optical-attenuator.yang.
3. Add support for optical amplifier in experimental extensions, derived from openconfig-optical-amplifier.yang.
4. Add SAI extension for OTN proposal document.

Signed-off-by: Jimmy Jin <jjin62@yahoo.com>
Co-authored-by: Lu.Mao <lu.mao@molex.com>

OFH Admin State

Signed-off-by: JaiOCP <jai.kumar@broadcom.com>
@JaiOCP

JaiOCP commented Jun 17, 2026

Copy link
Copy Markdown
Contributor Author

Base branch has diverged too much with lot of baseline conflict resolution.
Opening a new PR and closing this one.
#2297

@JaiOCP JaiOCP closed this Jun 17, 2026
@JaiOCP JaiOCP deleted the esun branch June 17, 2026 21:24
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