Skip to content

Commit 401bd1f

Browse files
iamjustaddMartin Liao
andauthored
Create API for fast linkup configuration. (#2203)
Signed-off-by: Martin Liao <[email protected]> Co-authored-by: Martin Liao <[email protected]>
1 parent 9658eeb commit 401bd1f

File tree

7 files changed

+110
-0
lines changed

7 files changed

+110
-0
lines changed

doc/SAI-Proposal-Fast-Linkup.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Fast Link-Up
2+
-------------------------------------------------------------------------------
3+
Title | Fast Link-Up
4+
-------------|-----------------------------------------------------------------
5+
Authors | Eddy Kvetny, Nvidia
6+
Status | In review
7+
Type | Standards track
8+
Created | 2025-09-09
9+
SAI-Version | 1.17
10+
-------------------------------------------------------------------------------
11+
12+
# 1. Overview
13+
In some cases the equalization parameters from the previous session can be used for a new link-up process. It can significantly reduce time of the Link-Up process
14+
15+
# 2. Scope
16+
This approach is applicable to devices (switch-to-switch or switch-to-NIC) supporting this process, usually from the same vendor or from different vendors aligned on the process.
17+
18+
Can be applied to cold/fast boot or link recovery flows (vendor decision)
19+
20+
# 3. Architecture
21+
This feature shall be enabled per-port using a new SAI attribute - SAI_PORT_ATTR_FAST_LINKUP_ENABLED (default status - disabled/false)
22+
23+
On ports with the enabled feature the ASIC FW shall try first to bring a link up using the equalization parameter stored from the previous successul session. The time given to ASIC to try to bring a link up with the old EQ parameters is limited by the Fast Link-Up Polling Timer. The time value is configured using a new SAI attribute - SAI_SWITCH_ATTR_FAST_LINKUP_POLLING_TIMEOUT. The supported range for this value (in secs) can be read by NOS using a new SAI attribute SAI_SWITCH_ATTR_FAST_LINKUP_POLLING_TIMEOUT_RANGE
24+
25+
If the process of brining a link up with the previosly used EQ parameters doesn't succeed the regular link-up process is triggered
26+
27+
If the link succeeds moving to the Operation UP state then the BER level shall be checked to make sure that the establish link has a good quality. To do that another timer called Guard Timer is used. Its value is also configurable using a new SAI attribute (SAI_SWITCH_ATTR_FAST_LINKUP_GUARD_TIMEOUT)
28+
29+
30+
When the Guard Timer expires the BER is measured and compared with the "good" BER value configured using a new SAI attribure SAI_SWITCH_ATTR_FAST_LINKUP_BER_THRESHOLD. Only if the measured BER is equal or better than the configured BER threshold the process is considered completed. Otherwise, the fallback to the regular link-up process is done and link's Oper status changes to DOWN
31+
32+
If the remote side doesn't support the Fast Link-up then the fallback to regular process will happen
33+
34+
Note that the State Machine is implemented by ASIC FW and can vary between vendors. The proposal just defines just high level flow and SAI configuration for this flow
35+
36+
The following State Machine is proposed for the Fast Link-UP process described above
37+
38+
![](figures/sai_fast_linkup_state_machine.png)
80.8 KB
Loading

inc/saiport.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2712,6 +2712,15 @@ typedef enum _sai_port_attr_t
27122712
*/
27132713
SAI_PORT_ATTR_PAM4_EYE_VALUES,
27142714

2715+
/**
2716+
* @brief Enables the fast link-up for a port on port/link recovery. Vendors can use to reduce linkup time on remote link failure
2717+
*
2718+
* @type bool
2719+
* @flags CREATE_AND_SET
2720+
* @default false
2721+
*/
2722+
SAI_PORT_ATTR_FAST_LINKUP_ENABLED,
2723+
27152724
/**
27162725
* @brief End of attributes
27172726
*/

inc/saiswitch.h

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3468,6 +3468,59 @@ typedef enum _sai_switch_attr_t
34683468
*/
34693469
SAI_SWITCH_ATTR_NEXT_HOP_USER_META_DATA_RANGE,
34703470

3471+
/**
3472+
* @brief Linkup polling time range (in secs)
3473+
*
3474+
* @type sai_u16_range_t
3475+
* @flags READ_ONLY
3476+
*/
3477+
SAI_SWITCH_ATTR_FAST_LINKUP_POLLING_TIMEOUT_RANGE,
3478+
3479+
/**
3480+
* @brief Time (in sec) during which the fast link-up is attempted.
3481+
*
3482+
* If this timer expires before the link is UP the regular link-up will be performed
3483+
* Supported range can be obtained using SAI_SWITCH_ATTR_FAST_LINKUP_POLLING_TIMEOUT_RANGE
3484+
*
3485+
* @type sai_uint16_t
3486+
* @flags CREATE_AND_SET
3487+
* @isvlan false
3488+
* @default 60
3489+
*/
3490+
SAI_SWITCH_ATTR_FAST_LINKUP_POLLING_TIMEOUT,
3491+
3492+
/**
3493+
* @brief Linkup guard time range (in secs)
3494+
*
3495+
* @type sai_u16_range_t
3496+
* @flags READ_ONLY
3497+
*/
3498+
SAI_SWITCH_ATTR_FAST_LINKUP_GUARD_TIMEOUT_RANGE,
3499+
3500+
/**
3501+
* @brief Time (in secs) during which the link must be UP with the BER below the level configured with SAI_SWITCH_ATTR_FAST_LINKUP_BER_THRESHOLD to keep the fast link-up configuration.
3502+
*
3503+
* If either link failures happens within this time or high BER is measured at the end of this period of time the link should undergo regular link up process
3504+
* Supported range can be obtained using SAI_SWITCH_ATTR_FAST_LINKUP_GUARD_TIMEOUT_RANGE
3505+
*
3506+
* @type sai_uint8_t
3507+
* @flags CREATE_AND_SET
3508+
* @default 10
3509+
*/
3510+
SAI_SWITCH_ATTR_FAST_LINKUP_GUARD_TIMEOUT,
3511+
3512+
/**
3513+
* @brief Threshold to control regular link-up happened after fast linkup Time-out
3514+
*
3515+
* Configures the BER (negative exponent only, mantissa is always 1) which is if measured during
3516+
* SAI_SWITCH_ATTR_FAST_LINKUP_GUARD_TIMEOUT causes the full link-up flow. For example, value 12 configured here is 1e^-12
3517+
*
3518+
* @type sai_uint8_t
3519+
* @flags CREATE_AND_SET
3520+
* @default 12
3521+
*/
3522+
SAI_SWITCH_ATTR_FAST_LINKUP_BER_THRESHOLD,
3523+
34713524
/**
34723525
* @brief End of attributes
34733526
*/

inc/saitypes.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1711,6 +1711,9 @@ typedef union _sai_attribute_value_t
17111711

17121712
/** @validonly meta->attrvaluetype == SAI_ATTR_VALUE_TYPE_TAPS_LIST */
17131713
sai_taps_list_t portserdestaps;
1714+
1715+
/** @validonly meta->attrvaluetype == SAI_ATTR_VALUE_TYPE_UINT16_RANGE */
1716+
sai_u16_range_t u16range;
17141717
} sai_attribute_value_t;
17151718

17161719
/**

meta/saimetadatatypes.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,11 @@ typedef enum _sai_attr_value_type_t
191191
*/
192192
SAI_ATTR_VALUE_TYPE_UINT32_RANGE,
193193

194+
/**
195+
* @brief Attribute value is 16bit unsigned integer range.
196+
*/
197+
SAI_ATTR_VALUE_TYPE_UINT16_RANGE,
198+
194199
/**
195200
* @brief Attribute value is 16 bit unsigned integer range list.
196201
*/

meta/saisanitycheck.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -789,6 +789,7 @@ void check_attr_object_type_provided(
789789
case SAI_ATTR_VALUE_TYPE_PRBS_RX_STATE:
790790
case SAI_ATTR_VALUE_TYPE_CHARDATA:
791791
case SAI_ATTR_VALUE_TYPE_UINT32_RANGE:
792+
case SAI_ATTR_VALUE_TYPE_UINT16_RANGE:
792793
case SAI_ATTR_VALUE_TYPE_UINT16_RANGE_LIST:
793794
case SAI_ATTR_VALUE_TYPE_UINT32_LIST:
794795
case SAI_ATTR_VALUE_TYPE_QOS_MAP_LIST:
@@ -3026,6 +3027,7 @@ void check_attr_is_primitive(
30263027
case SAI_ATTR_VALUE_TYPE_UINT16:
30273028
case SAI_ATTR_VALUE_TYPE_INT16:
30283029
case SAI_ATTR_VALUE_TYPE_UINT32:
3030+
case SAI_ATTR_VALUE_TYPE_UINT16_RANGE:
30293031
case SAI_ATTR_VALUE_TYPE_UINT32_RANGE:
30303032
case SAI_ATTR_VALUE_TYPE_UINT64:
30313033
case SAI_ATTR_VALUE_TYPE_INT64:

0 commit comments

Comments
 (0)