Skip to content

Commit 9fe7d02

Browse files
Merge branch 'master' into amaitra_ptp
2 parents f37a6dc + 2c74f46 commit 9fe7d02

File tree

12 files changed

+244
-11
lines changed

12 files changed

+244
-11
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)

doc/SAI-Proposal-Packet-Trimming.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,3 +212,15 @@ typedef enum _sai_packet_trim_dscp_resolution_mode_t
212212
*/
213213
SAI_SWITCH_ATTR_PACKET_TRIM_DSCP_RESOLUTION_MODE,
214214
```
215+
216+
## Counter
217+
|Header file|SAI attribute|Description|
218+
|-----------|-------------|-----------|
219+
|saiswitch.h|SAI_SWITCH_STAT_DROPPED_TRIM_PACKETS|Global counter (aggregated value of all ports) of packets trimmed but dropped due to failed shared buffer admission on a trim queue|
220+
| |SAI_SWITCH_STAT_TX_TRIM_PACKETS|Global counter (aggregated value of all ports) of packets trimmed and successfully sent via a trim queue|
221+
|saiport.h |SAI_PORT_STAT_TRIM_PACKETS|Per-port counter of packets trimmed due to failed shared buffer admission|
222+
| |SAI_PORT_STAT_DROPPED_TRIM_PACKETS|Per-port counter of packets trimmed but dropped due to failed shared buffer admission on a trim queue|
223+
| |SAI_PORT_STAT_TX_TRIM_PACKETS|Per-port counter of packets trimmed and successfully sent via a trim queue|
224+
|saiqueue.h |SAI_QUEUE_STAT_TRIM_PACKETS|Per-queue counter of packets trimmed on trimming-eligible queue due to failed shared buffer admission|
225+
| |SAI_QUEUE_STAT_DROPPED_TRIM_PACKETS|Per-queue counter of packets trimmed on trimming-eligible queue but dropped due to failed shared buffer admission on a trim queue|
226+
| |SAI_QUEUE_STAT_TX_TRIM_PACKETS|Per-queue counter of packets trimmed on trimming-eligible queue and successfully sent via a trim queue|
80.8 KB
Loading

inc/saiport.h

Lines changed: 97 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2723,6 +2723,25 @@ typedef enum _sai_port_attr_t
27232723
* @default 0
27242724
*/
27252725
SAI_PORT_ATTR_PTP_PEER_MEAN_PATH_DELAY,
2726+
2727+
/**
2728+
* @brief Enables the fast link-up for a port on port/link recovery. Vendors can use to reduce linkup time on remote link failure
2729+
*
2730+
* @type bool
2731+
* @flags CREATE_AND_SET
2732+
* @default false
2733+
*/
2734+
SAI_PORT_ATTR_FAST_LINKUP_ENABLED,
2735+
2736+
/**
2737+
* @brief Get port SerDes firmware revision
2738+
*
2739+
* Standard attribute to collect port SerDes firmware rev.
2740+
*
2741+
* @type sai_s8_list_t
2742+
* @flags READ_ONLY
2743+
*/
2744+
SAI_PORT_ATTR_SERDES_FW_REVISION,
27262745

27272746
/**
27282747
* @brief End of attributes
@@ -3977,7 +3996,7 @@ typedef enum _sai_port_serdes_attr_t
39773996
/**
39783997
* @brief Port serdes control TX FIR PRE1 filter
39793998
*
3980-
* List of port serdes TX fir precursor1 tap-filter values.
3999+
* List of port serdes TX FIR precursor1 tap-filter values.
39814000
* The values are of type sai_s32_list_t where the count is number lanes in
39824001
* a port and the list specifies list of values to be applied to each lane.
39834002
*
@@ -3990,7 +4009,7 @@ typedef enum _sai_port_serdes_attr_t
39904009
/**
39914010
* @brief Port serdes control TX FIR PRE2 filter
39924011
*
3993-
* List of port serdes TX fir precursor2 tap-filter values.
4012+
* List of port serdes TX FIR precursor2 tap-filter values.
39944013
* The values are of type sai_s32_list_t where the count is number lanes in
39954014
* a port and the list specifies list of values to be applied to each lane.
39964015
*
@@ -4003,7 +4022,7 @@ typedef enum _sai_port_serdes_attr_t
40034022
/**
40044023
* @brief Port serdes control TX FIR PRE3 filter
40054024
*
4006-
* List of port serdes TX fir precursor3 tap-filter values.
4025+
* List of port serdes TX FIR precursor3 tap-filter values.
40074026
* The values are of type sai_s32_list_t where the count is number lanes in
40084027
* a port and the list specifies list of values to be applied to each lane.
40094028
*
@@ -4016,7 +4035,7 @@ typedef enum _sai_port_serdes_attr_t
40164035
/**
40174036
* @brief Port serdes control TX FIR MAIN filter
40184037
*
4019-
* List of port serdes TX fir maincursor tap-filter values.
4038+
* List of port serdes TX FIR maincursor tap-filter values.
40204039
* The values are of type sai_s32_list_t where the count is number lanes in
40214040
* a port and the list specifies list of values to be applied to each lane.
40224041
*
@@ -4029,7 +4048,7 @@ typedef enum _sai_port_serdes_attr_t
40294048
/**
40304049
* @brief Port serdes control TX FIR POST1 filter
40314050
*
4032-
* List of port serdes TX fir postcursor1 tap-filter values.
4051+
* List of port serdes TX FIR postcursor1 tap-filter values.
40334052
* The values are of type sai_s32_list_t where the count is number lanes in
40344053
* a port and the list specifies list of values to be applied to each lane.
40354054
*
@@ -4042,7 +4061,7 @@ typedef enum _sai_port_serdes_attr_t
40424061
/**
40434062
* @brief Port serdes control TX FIR POST2 filter
40444063
*
4045-
* List of port serdes TX fir postcursor2 tap-filter values.
4064+
* List of port serdes TX FIR postcursor2 tap-filter values.
40464065
* The values are of type sai_s32_list_t where the count is number lanes in
40474066
* a port and the list specifies list of values to be applied to each lane.
40484067
*
@@ -4055,7 +4074,7 @@ typedef enum _sai_port_serdes_attr_t
40554074
/**
40564075
* @brief Port serdes control TX FIR POST3 filter
40574076
*
4058-
* List of port serdes TX fir postcursor3 tap-filter values.
4077+
* List of port serdes TX FIR postcursor3 tap-filter values.
40594078
* The values are of type sai_s32_list_t where the count is number lanes in
40604079
* a port and the list specifies list of values to be applied to each lane.
40614080
*
@@ -4068,7 +4087,7 @@ typedef enum _sai_port_serdes_attr_t
40684087
/**
40694088
* @brief Port serdes control TX FIR attenuation
40704089
*
4071-
* List of port serdes TX fir attn values.
4090+
* List of port serdes TX FIR attn values.
40724091
* The values are of type sai_s32_list_t where the count is number lanes in
40734092
* a port and the list specifies list of values to be applied to each lane.
40744093
*
@@ -4289,6 +4308,76 @@ typedef enum _sai_port_serdes_attr_t
42894308
*/
42904309
SAI_PORT_SERDES_ATTR_RX_POLARITY,
42914310

4311+
/**
4312+
* @brief Total number of RX FFE taps supported
4313+
*
4314+
* @type sai_uint32_t
4315+
* @flags READ_ONLY
4316+
*/
4317+
SAI_PORT_SERDES_ATTR_RX_FFE_COUNT,
4318+
4319+
/**
4320+
* @brief Total number of TX FIR taps supported
4321+
*
4322+
* @type sai_uint32_t
4323+
* @flags READ_ONLY
4324+
*/
4325+
SAI_PORT_SERDES_ATTR_TX_FIR_COUNT,
4326+
4327+
/**
4328+
* @brief Total number of RX DFE taps supported
4329+
*
4330+
* @type sai_uint32_t
4331+
* @flags READ_ONLY
4332+
*/
4333+
SAI_PORT_SERDES_ATTR_RX_DFE_COUNT,
4334+
4335+
/**
4336+
* @brief Port serdes RX FFE taps
4337+
*
4338+
* List of port serdes RX FFE tap values
4339+
*
4340+
* @type sai_taps_list_t
4341+
* @flags CREATE_AND_SET
4342+
* @default internal
4343+
*/
4344+
SAI_PORT_SERDES_ATTR_RX_FFE_TAPS_LIST,
4345+
4346+
/**
4347+
* @brief Port serdes TX FIR taps
4348+
*
4349+
* List of port serdes TX FIR tap values
4350+
*
4351+
* @type sai_taps_list_t
4352+
* @flags CREATE_AND_SET
4353+
* @default internal
4354+
*/
4355+
SAI_PORT_SERDES_ATTR_TX_FIR_TAPS_LIST,
4356+
4357+
/**
4358+
* @brief Port serdes DFE taps
4359+
*
4360+
* List of port serdes RX DFE tap values
4361+
*
4362+
* @type sai_taps_list_t
4363+
* @flags CREATE_AND_SET
4364+
* @default internal
4365+
*/
4366+
SAI_PORT_SERDES_ATTR_RX_DFE_TAPS_LIST,
4367+
4368+
/**
4369+
* @brief Port serdes VGA settings
4370+
*
4371+
* List of port serdes VGA settings values
4372+
* The values are of type sai_u32_list_t where the count is number of lanes
4373+
* in a port and the list specifies list of VGA settings for each lane.
4374+
*
4375+
* @type sai_u32_list_t
4376+
* @flags CREATE_AND_SET
4377+
* @default internal
4378+
*/
4379+
SAI_PORT_SERDES_ATTR_RX_VGA,
4380+
42924381
/**
42934382
* @brief End of attributes
42944383
*/

inc/saiswitch.h

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3488,6 +3488,59 @@ typedef enum _sai_switch_attr_t
34883488
* @default 0
34893489
*/
34903490
SAI_SWITCH_ATTR_PTP_SYNTONIZE_ADJUST,
3491+
3492+
/**
3493+
* @brief Linkup polling time range (in secs)
3494+
*
3495+
* @type sai_u16_range_t
3496+
* @flags READ_ONLY
3497+
*/
3498+
SAI_SWITCH_ATTR_FAST_LINKUP_POLLING_TIMEOUT_RANGE,
3499+
3500+
/**
3501+
* @brief Time (in sec) during which the fast link-up is attempted.
3502+
*
3503+
* If this timer expires before the link is UP the regular link-up will be performed
3504+
* Supported range can be obtained using SAI_SWITCH_ATTR_FAST_LINKUP_POLLING_TIMEOUT_RANGE
3505+
*
3506+
* @type sai_uint16_t
3507+
* @flags CREATE_AND_SET
3508+
* @isvlan false
3509+
* @default 60
3510+
*/
3511+
SAI_SWITCH_ATTR_FAST_LINKUP_POLLING_TIMEOUT,
3512+
3513+
/**
3514+
* @brief Linkup guard time range (in secs)
3515+
*
3516+
* @type sai_u16_range_t
3517+
* @flags READ_ONLY
3518+
*/
3519+
SAI_SWITCH_ATTR_FAST_LINKUP_GUARD_TIMEOUT_RANGE,
3520+
3521+
/**
3522+
* @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.
3523+
*
3524+
* 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
3525+
* Supported range can be obtained using SAI_SWITCH_ATTR_FAST_LINKUP_GUARD_TIMEOUT_RANGE
3526+
*
3527+
* @type sai_uint8_t
3528+
* @flags CREATE_AND_SET
3529+
* @default 10
3530+
*/
3531+
SAI_SWITCH_ATTR_FAST_LINKUP_GUARD_TIMEOUT,
3532+
3533+
/**
3534+
* @brief Threshold to control regular link-up happened after fast linkup Time-out
3535+
*
3536+
* Configures the BER (negative exponent only, mantissa is always 1) which is if measured during
3537+
* SAI_SWITCH_ATTR_FAST_LINKUP_GUARD_TIMEOUT causes the full link-up flow. For example, value 12 configured here is 1e^-12
3538+
*
3539+
* @type sai_uint8_t
3540+
* @flags CREATE_AND_SET
3541+
* @default 12
3542+
*/
3543+
SAI_SWITCH_ATTR_FAST_LINKUP_BER_THRESHOLD,
34913544

34923545
/**
34933546
* @brief End of attributes

inc/saitam.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,9 @@ typedef enum _sai_tam_tel_math_func_type_t
180180
/** Packet Rate computation */
181181
SAI_TAM_TEL_MATH_FUNC_TYPE_RATE,
182182

183+
/** Custom range base value */
184+
SAI_TAM_TEL_MATH_FUNC_TYPE_CUSTOM_RANGE_BASE = 0x10000000
185+
183186
} sai_tam_tel_math_func_type_t;
184187

185188
/**

inc/saitypes.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,18 @@ typedef struct _sai_vlan_list_t
392392

393393
} sai_vlan_list_t;
394394

395+
/**
396+
* @brief Defines a list of FIR/FFE/DFE taps
397+
*/
398+
typedef struct _sai_taps_list_t
399+
{
400+
/** Number of taps */
401+
uint32_t count;
402+
403+
/** List of tap values */
404+
sai_s32_list_t *list;
405+
} sai_taps_list_t;
406+
395407
typedef enum _sai_ip_addr_family_t
396408
{
397409
SAI_IP_ADDR_FAMILY_IPV4,
@@ -1696,6 +1708,12 @@ typedef union _sai_attribute_value_t
16961708

16971709
/** @validonly meta->attrvaluetype == SAI_ATTR_VALUE_TYPE_PORT_PAM4_EYE_VALUES_LIST */
16981710
sai_port_pam4_eye_values_list_t portpam4eyevalues;
1711+
1712+
/** @validonly meta->attrvaluetype == SAI_ATTR_VALUE_TYPE_TAPS_LIST */
1713+
sai_taps_list_t portserdestaps;
1714+
1715+
/** @validonly meta->attrvaluetype == SAI_ATTR_VALUE_TYPE_UINT16_RANGE */
1716+
sai_u16_range_t u16range;
16991717
} sai_attribute_value_t;
17001718

17011719
/**

meta/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,12 @@ saiattrversion.h: $(DEPS) attrversion.sh
126126
saimetadatasize.h: $(DEPS)
127127
./size.sh
128128

129-
saimetadatatest.c saimetadata.c saimetadata.h: xml $(XMLDEPS) parse.pl $(CONSTHEADERS) $(EXTRA) saiattrversion.h
129+
saimetadatatest.c saimetadata.c saimetadata.h &: xml $(XMLDEPS) parse.pl $(CONSTHEADERS) $(EXTRA) saiattrversion.h
130130
perl -I. parse.pl
131131

132132
RPC_MODULES=$(shell find rpc -type f -name "*.pm")
133133

134-
sai.thrift sai_rpc_server.cpp sai_adapter.py: xml $(XMLDEPS) gensairpc.pl templates/*.tt $(RPC_MODULES)
134+
sai.thrift sai_rpc_server.cpp sai_adapter.py &: xml $(XMLDEPS) gensairpc.pl templates/*.tt $(RPC_MODULES)
135135
perl -Irpc gensairpc.pl $(GEN_SAIRPC_OPTS)
136136

137137
rpc: sai.thrift sai_rpc_server.cpp sai_adapter.py

meta/acronyms.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ CMIS - Common Management Interface Specification
2727
CPLD - Complex programmable logic device
2828
CPU - Central Processing Unit
2929
CRC - Cyclic Redundancy Code
30+
DFE - Decision Feedback Equalizer
3031
DHCP - Dynamic Host Configuration Protocol
3132
DHCPV6 - Dynamic Host Configuration Protocol for IPv6
3233
DLD - Dead Lock Detection
@@ -54,6 +55,8 @@ FCS - Frame Check Sequence
5455
FD - File Descriptor
5556
FDB - Forwarding Data Base
5657
FEC - Forward Error Correction
58+
FFE - Feedforward Equalizer
59+
FIR - Finite Impulse Response
5760
FPGA - Field Programmable Gate Array
5861
FW - Firmware
5962
GCM - Galois Counter Mode
@@ -173,6 +176,7 @@ UDP - User Datagram Protocol
173176
USD - Ultimate Segment Decapsulation
174177
USP - Ultimate Segment Pop
175178
USXGMII - Universal Serial 10 Gigabit Media Independent Interface
179+
VGA - Variable Gain Amplifier
176180
VNET - Virtual Network
177181
VNI - Virtual Network Interface
178182
VNID - Virtual Network Identifier

meta/saimetadatatypes.h

Lines changed: 10 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
*/
@@ -500,6 +505,11 @@ typedef enum _sai_attr_value_type_t
500505
* @brief Attribute value is port PAM4 eye values list.
501506
*/
502507
SAI_ATTR_VALUE_TYPE_PORT_PAM4_EYE_VALUES_LIST,
508+
509+
/**
510+
* @brief Attribute value is port SerDes tap values list.
511+
*/
512+
SAI_ATTR_VALUE_TYPE_TAPS_LIST
503513
} sai_attr_value_type_t;
504514

505515
/**

0 commit comments

Comments
 (0)