Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
476 changes: 469 additions & 7 deletions doc/tunnel/SAI-Proposal-EVPN-Multihoming.md

Large diffs are not rendered by default.

Binary file added doc/tunnel/figures/sai_evpnmh_hw_frr_flow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/tunnel/figures/sai_evpnmh_hw_frr_model.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
203 changes: 203 additions & 0 deletions inc/saibridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,116 @@ typedef enum _sai_bridge_port_tagging_mode_t

} sai_bridge_port_tagging_mode_t;

/**
* @brief Attribute data for #SAI_BRIDGE_PORT_ATTR_BRIDGE_PORT_PROTECTION_MODE
*
* In hardware mode the switchover is triggered by a qualified failure of the
* bridge port, that is, the point at which the adapter determines the bridge
* port is unavailable for forwarding, and the switchover budget is measured
* from that point. Link event debounce and damping controls govern the delivery
* of operational status notifications to the NOS and do not gate the hardware
* selection, so hardware may select the protection path before the NOS observes
* the corresponding operational status change.
*
* Recovery behavior is controlled separately by
* #SAI_BRIDGE_PORT_ATTR_BRIDGE_PORT_PROTECTION_REVERTIVE.
*/
typedef enum _sai_bridge_port_protection_mode_t
{
/** Software switchover. Control plane determines the switchover behavior */
SAI_BRIDGE_PORT_PROTECTION_MODE_SOFTWARE,

/** Hardware switchover. Hardware selects the path autonomously */
SAI_BRIDGE_PORT_PROTECTION_MODE_HARDWARE,

} sai_bridge_port_protection_mode_t;

/**
* @brief Attribute data for #SAI_BRIDGE_PORT_ATTR_BRIDGE_PORT_PROTECTION_ADMIN_MODE
*/
typedef enum _sai_bridge_port_protection_admin_mode_t
{
/** No administrative override. Path is selected per the protection mode */
SAI_BRIDGE_PORT_PROTECTION_ADMIN_MODE_AUTO,

/** Force the traffic onto the bridge port. Protection is locked out */
SAI_BRIDGE_PORT_PROTECTION_ADMIN_MODE_PRIMARY,

/** Force the traffic onto the protection next hop group */
SAI_BRIDGE_PORT_PROTECTION_ADMIN_MODE_PROTECTION,

} sai_bridge_port_protection_admin_mode_t;

/**
* @brief Attribute data for #SAI_BRIDGE_PORT_ATTR_BRIDGE_PORT_PROTECTION_STATE
*/
typedef enum _sai_bridge_port_protection_state_t
{
/** Primary path is committed in hardware */
SAI_BRIDGE_PORT_PROTECTION_STATE_PRIMARY,

/** Protection path is committed in hardware */
SAI_BRIDGE_PORT_PROTECTION_STATE_PROTECTION,

/** Protection is not configured or not applicable for this bridge port */
SAI_BRIDGE_PORT_PROTECTION_STATE_NOT_APPLICABLE,

} sai_bridge_port_protection_state_t;

/**
* @brief Defines the reason for a bridge port HW protection switchover
*
* Reported only for hardware-initiated transitions. A switchover requested

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This docblock is where the pre-existing SAI_BRIDGE_PORT_ATTR_BRIDGE_PORT_SET_SWITCHOVER first acquires hardware-mode meaning, and two interactions look undefined to me.

Manual request vs. autonomous selection in MODE_HARDWARE. If the NOS writes SET_SWITCHOVER = true while the primary is still healthy, revertive hardware is documented to "switch back to the bridge port once it recovers" — but it never left. Does hardware immediately revert, making the request a no-op or a transient blip? Is a manual request sticky until explicitly cleared, or always subordinate to hardware's own selection? Section 5 says the resulting path is readable immediately from PROTECTION_STATE, which only holds if the answer is deterministic.

Re-arming in MODE_HARDWARE_NON_REVERTIVE. The walkthrough says traffic stays on the protection path "until the NOS explicitly reverts it (e.g. via SET_SWITCHOVER)". Two gaps: if the NOS writes false while the primary is still down, is that rejected, or committed and then immediately failed over again? And after a successful revert, is the latch re-armed so the next failure switches over autonomously? The "e.g." also leaves it ambiguous whether SET_SWITCHOVER is the defined mechanism or merely one option.

Header/proposal divergence. The proposal document is considerably more precise than the header here — that false reverts to primary, that the outcome is the return status of set_bridge_port_attribute(), and that PROTECTION_STATE is readable immediately are all stated in section 5 but not in the docblock. Since vendors implement from headers, it would help to pull those sentences into the Doxygen comment.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Added SAI_BRIDGE_PORT_ATTR_BRIDGE_PORT_PROTECTION_ADMIN_MODE and SAI_BRIDGE_PORT_ATTR_BRIDGE_PORT_PROTECTION_REVERTIVE to address these concerns. I have also deprecated the SAI_BRIDGE_PORT_ATTR_BRIDGE_PORT_SET_SWITCHOVER attribute.

* through #SAI_BRIDGE_PORT_ATTR_BRIDGE_PORT_SET_SWITCHOVER reports its
* outcome synchronously and raises no notification.
*/
typedef enum _sai_bridge_port_protection_event_t
{
/** Primary path failed */
SAI_BRIDGE_PORT_PROTECTION_EVENT_PRIMARY_FAILURE,

/** Primary path recovered */
SAI_BRIDGE_PORT_PROTECTION_EVENT_PRIMARY_RECOVERY,

/** Switchover attempt failed. Committed state is unchanged */
SAI_BRIDGE_PORT_PROTECTION_EVENT_SWITCHOVER_FAILED,

} sai_bridge_port_protection_event_t;

/**
* @brief Defines the bridge port HW protection switchover status
*
* A notification is emitted after the data plane selection is committed. A
* SAI_BRIDGE_PORT_PROTECTION_EVENT_SWITCHOVER_FAILED notification reports the
* unchanged authoritative current_state. Notifications are advisory; the NOS
* shall reconcile with #SAI_BRIDGE_PORT_ATTR_BRIDGE_PORT_PROTECTION_STATE.
*/
typedef struct _sai_bridge_port_hw_protection_switchover_notification_data_t
{
/**
* @brief Bridge port id
*
* @objects SAI_OBJECT_TYPE_BRIDGE_PORT
*/
sai_object_id_t bridge_port_id;

/**
* @brief Protection state before the switchover
*/
sai_bridge_port_protection_state_t previous_state;

/**
* @brief Protection state after the switchover
*/
sai_bridge_port_protection_state_t current_state;

/**
* @brief Reason for the switchover
*/
sai_bridge_port_protection_event_t reason;

} sai_bridge_port_hw_protection_switchover_notification_data_t;

/**
* @brief SAI attributes for Bridge Port
*/
Expand Down Expand Up @@ -347,13 +457,92 @@ typedef enum _sai_bridge_port_attr_t
/**
* @brief Trigger a switch-over to backup next hop group
*
* This attribute is deprecated, use
* #SAI_BRIDGE_PORT_ATTR_BRIDGE_PORT_PROTECTION_ADMIN_MODE instead. Setting
* true is equivalent to
* SAI_BRIDGE_PORT_PROTECTION_ADMIN_MODE_PROTECTION and setting false
* is equivalent to SAI_BRIDGE_PORT_PROTECTION_ADMIN_MODE_AUTO. A boolean
* cannot request SAI_BRIDGE_PORT_PROTECTION_ADMIN_MODE_PRIMARY, and
* cannot distinguish holding the bridge port from placing no override on
* it at all, which is why it is superseded.
*
* @type bool
* @flags CREATE_AND_SET
* @default false
* @validonly SAI_BRIDGE_PORT_ATTR_TYPE == SAI_BRIDGE_PORT_TYPE_PORT
* @deprecated true
*/
SAI_BRIDGE_PORT_ATTR_BRIDGE_PORT_SET_SWITCHOVER,

/**
* @brief Protection switchover mode
*
* Applies only when SAI_BRIDGE_PORT_ATTR_BRIDGE_PORT_PROTECTION_NEXT_HOP_GROUP_ID
* is set; otherwise the value is ignored.
*
* @type sai_bridge_port_protection_mode_t
* @flags CREATE_AND_SET
* @default SAI_BRIDGE_PORT_PROTECTION_MODE_SOFTWARE
* @validonly SAI_BRIDGE_PORT_ATTR_TYPE == SAI_BRIDGE_PORT_TYPE_PORT
*/
SAI_BRIDGE_PORT_ATTR_BRIDGE_PORT_PROTECTION_MODE,

/**
* @brief Protection switchover state
*
* Path currently committed in hardware. Returns
* SAI_BRIDGE_PORT_PROTECTION_STATE_NOT_APPLICABLE when the bridge port type
* is not SAI_BRIDGE_PORT_TYPE_PORT, or when no protection next hop group is
* associated.
*
* @type sai_bridge_port_protection_state_t
* @flags READ_ONLY
*/
SAI_BRIDGE_PORT_ATTR_BRIDGE_PORT_PROTECTION_STATE,
Comment thread
manamand2020 marked this conversation as resolved.

/**
* @brief Revert to the bridge port once it recovers
*
* When false, hardware keeps the traffic on the protection next hop group
* after the bridge port recovers, until the control plane moves it back
* through #SAI_BRIDGE_PORT_ATTR_BRIDGE_PORT_PROTECTION_ADMIN_MODE.
*
* @type bool
* @flags CREATE_AND_SET
* @default true
* @validonly SAI_BRIDGE_PORT_ATTR_BRIDGE_PORT_PROTECTION_MODE == SAI_BRIDGE_PORT_PROTECTION_MODE_HARDWARE
*/
SAI_BRIDGE_PORT_ATTR_BRIDGE_PORT_PROTECTION_REVERTIVE,

/**
* @brief Wait to restore time in milliseconds
*
* Delay between the bridge port recovering and hardware reverting to it.
* Value 0 reverts as soon as the bridge port is available again.
*
* @type sai_uint32_t
* @flags CREATE_AND_SET
* @default 0
* @validonly SAI_BRIDGE_PORT_ATTR_BRIDGE_PORT_PROTECTION_REVERTIVE == true
*/
SAI_BRIDGE_PORT_ATTR_BRIDGE_PORT_PROTECTION_WAIT_TO_RESTORE_TIME,

/**
* @brief Administrative override of the protection path
*
* Overrides the path selection of either protection mode. While an override
* is in effect the committed path does not follow bridge port failure or
* recovery and no switchover notification is raised. Returning to
* SAI_BRIDGE_PORT_PROTECTION_ADMIN_MODE_AUTO releases the override and
* resumes selection from the committed path.
*
* @type sai_bridge_port_protection_admin_mode_t
* @flags CREATE_AND_SET
* @default SAI_BRIDGE_PORT_PROTECTION_ADMIN_MODE_AUTO
* @validonly SAI_BRIDGE_PORT_ATTR_TYPE == SAI_BRIDGE_PORT_TYPE_PORT
*/
SAI_BRIDGE_PORT_ATTR_BRIDGE_PORT_PROTECTION_ADMIN_MODE,

/**
* @brief End of attributes
*/
Expand Down Expand Up @@ -486,6 +675,20 @@ typedef sai_status_t (*sai_clear_bridge_port_stats_fn)(
_In_ uint32_t number_of_counters,
_In_ const sai_stat_id_t *counter_ids);

/**
* @brief Bridge port HW protection switchover notification callback
*
* Passed as a parameter into sai_initialize_switch().
*
* @count events[count]
*
* @param[in] count Number of notifications
* @param[in] events Array of notification data
*/
typedef void (*sai_bridge_port_hw_protection_switchover_notification_fn)(
_In_ uint32_t count,
_In_ const sai_bridge_port_hw_protection_switchover_notification_data_t *events);

/**
* @brief Attribute data for #SAI_BRIDGE_ATTR_TYPE
*/
Expand Down
9 changes: 9 additions & 0 deletions inc/saiswitch.h
Original file line number Diff line number Diff line change
Expand Up @@ -3652,6 +3652,15 @@ typedef enum _sai_switch_attr_t
*/
SAI_SWITCH_ATTR_TAM_EVENT_LEARN_NOTIFY,

/**
* @brief Bridge port HW protection switchover notification callback function passed to the adapter.
*
* @type sai_pointer_t sai_bridge_port_hw_protection_switchover_notification_fn
* @flags CREATE_AND_SET
* @default NULL
*/
SAI_SWITCH_ATTR_BRIDGE_PORT_HW_PROTECTION_SWITCHOVER_NOTIFY,

/**
* @brief End of attributes
*/
Expand Down
13 changes: 13 additions & 0 deletions inc/saitunnel.h
Original file line number Diff line number Diff line change
Expand Up @@ -825,6 +825,19 @@ typedef enum _sai_tunnel_attr_t
*/
SAI_TUNNEL_ATTR_SELECTIVE_COUNTER_LIST,

/**
* @brief VXLAN tunnel MAC
*
* Inner destination MAC used for routed packets encapsulated by this
* P2P VXLAN tunnel.
*
* @type sai_mac_t
* @flags CREATE_AND_SET
* @default attrvalue SAI_SWITCH_ATTR_VXLAN_DEFAULT_ROUTER_MAC
* @validonly SAI_TUNNEL_ATTR_TYPE == SAI_TUNNEL_TYPE_VXLAN and SAI_TUNNEL_ATTR_PEER_MODE == SAI_TUNNEL_PEER_MODE_P2P
*/
SAI_TUNNEL_ATTR_VXLAN_TUNNEL_MAC,

/**
* @brief End of attributes
*/
Expand Down
Loading