Skip to content

HW FRR switchover notification support for protection groups #2269

Open
chikkaiah-work wants to merge 2 commits intoopencomputeproject:masterfrom
chikkaiah-work:protection_grp_notification
Open

HW FRR switchover notification support for protection groups #2269
chikkaiah-work wants to merge 2 commits intoopencomputeproject:masterfrom
chikkaiah-work:protection_grp_notification

Conversation

@chikkaiah-work
Copy link
Copy Markdown
Contributor

Added HW FRR switchover notification support for protection groups with a switch-level callback. The new callback reports switchover results per monitored object, including: monitored_oid,
switchover_success_count, and list protection groups that failed switchover. The callback is registered
through SAI_SWITCH_ATTR_NEXT_HOP_GROUP_HW_PROTECTION_SWITCHOVER_NOTIFY.

…red-by: Manas Kumar Mandal (manamand) <manamand@cisco.com>Â

Signed-off-by: Chikkegowda Chikkaiah <cchikkai@cisco.com>
*
* @objects SAI_OBJECT_TYPE_NEXT_HOP_GROUP
*/
sai_object_list_t failed_next_hop_group_obj_list;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

just wondering if that suffix obj_list is needed, instead of "failed_next_hop_groups" ? we didnt had so far lists defined in any structs so it would be good to establish good convention for future

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.

agree with you. fixed it.

This hint is provided using a new NHG type
```c
/** Next hop hardware protection group. This is the group backing up the primary in the protection group type and is managed by hardware */
SAI_NEXT_HOP_GROUP_TYPE_HW_PROTECTION,
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.

How does SAI Knows which is primary across multiple NHGS created in the system. actually existing model already supports this i think. the only missing is H/w protection with callbacks when there is a state change.

Below is my understanding based on current model

  1. Protection between Next-Hop Groups (H-ECMP case)

NHG-1: Primary group (Endpoint-1)
NHG-2: Backup group (Endpoint-2)
NHG-3: Parent NHG with:
Member-1: Primary → NHG-1
Member-2: Backup → NHG-2

This models protection at the group level, which is particularly useful for hierarchical ECMP (H-ECMP) scenarios, where failover happens across endpoint groups.
Also, this use-case is already supported in the current model.

Example Flow:

Create NHG-1 with Tunnel endpoint-1
Create NHG-2 with Tunnel endpoint-2
Create NHG-3 and add:
NHG-1 as primary
NHG-2 as secondary (backup)

  1. Protection within a Next-Hop Group (Member-Level Protection)

In the current SAI model, this can be represented using smaller protected NHGs and composing them into a parent group:

Create NHG-2 with:
Primary → NH1
Backup → NH2
Create NHG-3 with:
Primary → NH2
Backup → NH1
NH3 and NH4 do not have backups
Create NHG-1 and add members:
Member-1: NHG-2
Member-2: NHG-3
Member-3: NH3
Member-4: NH4

This effectively models per-member protection, where some next-hops have protection while others do not.

For the current model, NHG-level notifications on switchover from primary to backup should be sufficient, in my view for H/w based protection. As the protection semantics are already captured through the existing NHG hierarchy/composition

Copy link
Copy Markdown
Contributor Author

@chikkaiah-work chikkaiah-work Apr 2, 2026

Choose a reason for hiding this comment

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

@sathk-marvell, You are right all these are already exists. I'm just adding notification callback. the way diffs are created is confusing. The new changes are in this file starts from line #162.
Please let me know if I have missed anything form your feedback.

Signed-off-by: Chikkegowda Chikkaiah <cchikkai@cisco.com>
@prsunny
Copy link
Copy Markdown
Collaborator

prsunny commented Apr 3, 2026

To be discussed in SAI community. @tjchadaga

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