Skip to content

Commit 7e24aa8

Browse files
authored
Merge branch 'opencomputeproject:master' into telemetry
2 parents b0199c2 + 39b7fe0 commit 7e24aa8

18 files changed

+1096
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ meta/saimetadatatest.c
1717
meta/saisanitycheck
1818
meta/saiserializetest
1919
meta/saiswig.i
20+
meta/saimetadatasize.h
2021

2122
# temporary files
2223
**/*~
Lines changed: 215 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,215 @@
1+
# CMIS Module Management
2+
-------------------------------------------------------------------------------
3+
Title | SAI support for CMIS Module Management
4+
-------------|-----------------------------------------------------------------
5+
Authors | Nvidia
6+
Status | In review
7+
Type | Standards track
8+
Created | 07/25/2024
9+
SAI-Version | 1.13
10+
-------------------------------------------------------------------------------
11+
12+
# 1. Introduction
13+
14+
Move to the software (SONIC)-based management of optical modules supporting the CMIS management on more vendor platforms requires some additions in SAI API
15+
16+
The current proposal introduces 2 additions:
17+
18+
- New Port SERDES attributes
19+
- Enhancement of synchronization between ASIC port and module configuration
20+
21+
# 2. Addition of new Port SERDES attributes
22+
23+
Port SERDES attributes are used with SAI\_OBJECT\_TYPE\_PORT\_SERDES SAI object to set the Signal Integrity configuration. Few attributes are already defined and used today on some vendor platforms. Few more attributes shall be added to support additional vendor platforms
24+
25+
```
26+
/**
27+
* @brief Port serdes control TX PAM4 ratio
28+
*
29+
* Ratio between the central eye to the upper and lower eyes (for PAM4 only)
30+
* The values are of type sai_s32_list_t where the count is number lanes in
31+
* a port and the list specifies list of values to be applied to each lane.
32+
*
33+
* @type sai_s32_list_t
34+
* @flags CREATE_ONLY
35+
* @default internal
36+
*/
37+
SAI_PORT_SERDES_ATTR_TX_PAM4_RATIO,
38+
39+
/**
40+
* @brief Port serdes control TX OUT common mode
41+
*
42+
* Output common mode
43+
* The values are of type sai_s32_list_t where the count is number lanes in
44+
* a port and the list specifies list of values to be applied to each lane.
45+
*
46+
* @type sai_s32_list_t
47+
* @flags CREATE_ONLY
48+
* @default internal
49+
*/
50+
SAI_PORT_SERDES_ATTR_TX_OUT_COMMON_MODE,
51+
52+
/**
53+
* @brief Port serdes control TX PMOS common mode
54+
*
55+
* Output buffers input to Common mode PMOS side
56+
* The values are of type sai_s32_list_t where the count is number lanes in
57+
* a port and the list specifies list of values to be applied to each lane.
58+
*
59+
* @type sai_s32_list_t
60+
* @flags CREATE_ONLY
61+
* @default internal
62+
*/
63+
SAI_PORT_SERDES_ATTR_TX_PMOS_COMMON_MODE,
64+
65+
/**
66+
* @brief Port serdes control TX NMOS common mode
67+
*
68+
* Output buffers input to Common mode NMOS side
69+
* The values are of type sai_s32_list_t where the count is number lanes in
70+
* a port and the list specifies list of values to be applied to each lane.
71+
*
72+
* @type sai_s32_list_t
73+
* @flags CREATE_ONLY
74+
* @default internal
75+
*/
76+
SAI_PORT_SERDES_ATTR_TX_NMOS_COMMON_MODE,
77+
78+
/**
79+
* @brief Port serdes control TX PMOS voltage regulator
80+
*
81+
* Voltage regulator to pre output buffer PMOS side
82+
* The values are of type sai_s32_list_t where the count is number lanes in
83+
* a port and the list specifies list of values to be applied to each lane.
84+
*
85+
* @type sai_s32_list_t
86+
* @flags CREATE_ONLY
87+
* @default internal
88+
*/
89+
SAI_PORT_SERDES_ATTR_TX_PMOS_VLTG_REG,
90+
91+
/**
92+
* @brief Port serdes control TX NMOS voltage regulator
93+
*
94+
* Voltage regulator to pre output buffer NMOS side
95+
* The values are of type sai_s32_list_t where the count is number lanes in
96+
* a port and the list specifies list of values to be applied to each lane.
97+
*
98+
* @type sai_s32_list_t
99+
* @flags CREATE_ONLY
100+
* @default internal
101+
*/
102+
SAI_PORT_SERDES_ATTR_TX_NMOS_VLTG_REG,
103+
```
104+
105+
# 3. Enhancement of synchronization between ASIC and module configuration
106+
Configuration of the ASIC side (port SERDES) is handled by the SWSS docker (Ports Orch Agent) interacting with the vendor SAI via SAI calls whereas the modules supporting the CMIS protocol are configured by PMON docker (Xcvrd daemon). These initialization processes should be synchronized and the configuration of CMIS module should start only after the ASIC is initialized and per CMIS 5.2 it started sending the high-speed signal toward a module.
107+
108+
Currently, SONIC uses the *"host\_tx\_ready"*  flag in the PORT table in STATE DB for synchronization. This flag is set by Ports OA right after the SAI API for setting the Admin status to UP returns with OK/Success status. PMON registers for changes of this flag in Redis DB and starts the CMIS initialization for a particular module when this flag is set
109+
110+
See the current flow below:
111+
112+
![The Current Flow](./figures/The-Current-Flow.png)
113+
114+
## 3.1. Problem statement
115+
With move to SW-based management of CMIS modules when the ASIC side is configured by vendor SDK and module side - by SONIC, some problems have been identified with the current approach
116+
### 3.1.1. Host TX Ready signal
117+
As mentioned earlier, currently SONIC assumes that as soon as the Admin Status is set to UP and the corresponding SAI call returns with OK/SUCCESS status, the "host\_tx\_ready" flag can be set in the STATE DB to trigger the CMIS State Machine for specific port. But it is not always a truth as the process of ASIC port initialization takes some time and this time can increase with move to new transceiver technologies (e.g. BiDi). So, in some cases the module initialization can be triggered too early, before the high-speed signal started to be transmitted by ASIC to a module 
118+
### 3.1.2. Unterminated transmission
119+
With move to the SW-based module  management the module presence is handled by SONIC. The FW might be unaware of the module presence status. In this case, when the Admin status of a port is set to UP the FW can start transmitting the high-speed signal even without a plugged-in module. Such unterminated transmission can cause cross-talks to adjacent ports, high EMI, high BER and eventually shorten the transceiver lifetime so it is recommended that ASIC will not start send the high-speed signal before a module is plugged
120+
## 3.2. New approach
121+
To provide the response to the described problem statements SONIC should do the following:
122+
123+
1. Control transmitting of the high-speed signal based on module presence (allow this signal only when a module is plugged-in)
124+
2. Trigger the module initialization (using the CMIS state machine) only when the high-speed signal is transmitted by ASIC towards a module
125+
126+
SWSS shall allow transmitting of the high-speed signal on receiving the INSERTION indication from PMON. Then on setting the Admin Status to UP the vendor SDK/FW shall start transmitting this signal to a module and shall report about that to SONIC.
127+
128+
ASIC FW shall start transmitting the high-speed TX signal only when **both** conditions are met:
129+
130+
1. It is allowed (by SWSS) to transmit this signal 
131+
2. Port mapped to the module is set to Admin UP
132+
133+
See the high-level flow below (details will be provided in the following sub-sections):
134+
135+
![The High Level Flow](./figures/The-High-Level-Flow.png)
136+
137+
## 3.2. Changes in SAI AP
138+
139+
### 3.2.1. host_tx_signal
140+
141+
SONIC shall  inform the Vendor SDK of allowance to transmit the high-speed signal via setting of a new SAI attribute *SAI\_PORT\_ATTR\_HOST\_TX\_SIGNAL\_ENABLE.* 2 values shall be set – enabled (1 - on insertion event) and disabled (0 – on removal event)
142+
143+
```
144+
/**
145+
* @brief Enable host_tx_signal (high-speed signal from ASIC to module) required
146+
* to start the CMIS module initialization
147+
*
148+
* @type bool
149+
* @flags CREATE_AND_SET
150+
* @default false
151+
*/
152+
SAI_PORT_ATTR_HOST_TX_SIGNAL_ENABLE,
153+
```
154+
155+
This flow shall be used only on platforms supporting it. For that the capability query for new SAI attribute (*SAI\_PORT\_ATTR\_HOST\_TX\_SIGNAL\_ENABLE*) shall be done on SWSS (Ports Orch Agent) init.
156+
157+
The module's INSERTION/REMOVAL events shall trigger the calling of SAI API on a Port object with *SAI\_PORT\_ATTR\_HOST\_TX\_SIGNAL\_ENABLE* to enable or disable data signal from ASIC to module
158+
159+
![Host Tx Signal Enable Flow](./figures/Host-Tx-Signal-Enable-Flow.png)
160+
161+
It should be noted that the setting of *SAI\_PORT\_ATTR\_HOST\_TX\_SIGNAL\_ENABLE* to TRUE (when a module is plugged) is not sufficient to start the transmission of the high-speed signal towards a module. The SDK should wait until the Admin status of the port mapped to this module is set to UP to start transmitting the high-speed signal.
162+
163+
### 3.2.2. host_tx_ready
164+
When the ASIC starts transmitting the high-speed signal toward a plugged module the vendor SAI should notify the SONIC (SWSS) of that via a new notification
165+
166+
```
167+
/**
168+
* @brief Host tx ready status
169+
*
170+
* It will be used for query and capability query of "host_tx_ready" signal
171+
*
172+
* @type sai_port_host_tx_ready_status_t
173+
* @flags READ_ONLY
174+
*/
175+
SAI_PORT_ATTR_HOST_TX_READY_STATUS,
176+
```
177+
178+
```
179+
/**
180+
* @brief Port host tx ready notification
181+
*
182+
* Passed as a parameter into sai_initialize_switch()
183+
*
184+
* @objects switch_id SAI_OBJECT_TYPE_SWITCH
185+
* @objects port_id SAI_OBJECT_TYPE_PORT
186+
*
187+
* @param[in] switch_id Switch Id
188+
* @param[in] port_id Port Id
189+
* @param[in] host_tx_ready_status New tx ready status
190+
*/
191+
typedef void (*sai_port_host_tx_ready_notification_fn)(
192+
_In_ sai_object_id_t switch_id,
193+
_In_ sai_object_id_t port_id,
194+
_In_ sai_port_host_tx_ready_status_t host_tx_ready_status);
195+
```
196+
197+
```
198+
/**
199+
* @brief Port host tx ready notification callback
200+
* function passed to the adapter.
201+
*
202+
* Use sai_port_host_tx_ready_notification_fn as notification function.
203+
*
204+
* @type sai_pointer_t sai_port_host_tx_ready_notification_fn
205+
* @flags CREATE_AND_SET
206+
* @default NULL
207+
*/
208+
SAI_SWITCH_ATTR_PORT_HOST_TX_READY_NOTIFY,
209+
```
210+
The SWSS shall use this notification to set "*host\_tx\_ready*" flag in STATE DB which will trigger the CMIS initialization of the module. It will ensure that the module initialization doesn't start before the high-speed signal is transmitted by ASIC to a module
211+
212+
The platform capabilities for supporting of this feature should be quired on Port OA init. The notification shall be expected and consumed only on platforms supporting it. On platforms not supporting this functionality the “*host\_tx\_ready*” flag shall be set in STATE DB upon return of Port Admin status UP with SUCCESS return code (backward-compatible behavior)
213+
214+
![Host Tx Ready Flow](./figures/Host-Tx-Ready-Flow.png)
215+

doc/figures/Host-Tx-Ready-Flow.png

199 KB
Loading
275 KB
Loading

doc/figures/The-Current-Flow.png

37.5 KB
Loading
53 KB
Loading

inc/saiacl.h

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1496,10 +1496,28 @@ typedef enum _sai_acl_table_attr_t
14961496
*/
14971497
SAI_ACL_TABLE_ATTR_FIELD_TAM_INT_TYPE = SAI_ACL_TABLE_ATTR_FIELD_START + 0x152,
14981498

1499+
/**
1500+
* @brief Inner Src MAC
1501+
*
1502+
* @type bool
1503+
* @flags CREATE_ONLY
1504+
* @default false
1505+
*/
1506+
SAI_ACL_TABLE_ATTR_FIELD_INNER_SRC_MAC = SAI_ACL_TABLE_ATTR_FIELD_START + 0x15b,
1507+
1508+
/**
1509+
* @brief Inner Dst MAC
1510+
*
1511+
* @type bool
1512+
* @flags CREATE_ONLY
1513+
* @default false
1514+
*/
1515+
SAI_ACL_TABLE_ATTR_FIELD_INNER_DST_MAC = SAI_ACL_TABLE_ATTR_FIELD_START + 0x15c,
1516+
14991517
/**
15001518
* @brief End of ACL Table Match Field
15011519
*/
1502-
SAI_ACL_TABLE_ATTR_FIELD_END = SAI_ACL_TABLE_ATTR_FIELD_DST_IPV6_WORD0,
1520+
SAI_ACL_TABLE_ATTR_FIELD_END = SAI_ACL_TABLE_ATTR_FIELD_INNER_DST_MAC,
15031521

15041522
/**
15051523
* @brief ACL table entries associated with this table.
@@ -2532,10 +2550,28 @@ typedef enum _sai_acl_entry_attr_t
25322550
*/
25332551
SAI_ACL_ENTRY_ATTR_FIELD_TAM_INT_TYPE = SAI_ACL_ENTRY_ATTR_FIELD_START + 0x152,
25342552

2553+
/**
2554+
* @brief Inner Src MAC Address
2555+
*
2556+
* @type sai_acl_field_data_t sai_mac_t
2557+
* @flags CREATE_AND_SET
2558+
* @default disabled
2559+
*/
2560+
SAI_ACL_ENTRY_ATTR_FIELD_INNER_SRC_MAC = SAI_ACL_ENTRY_ATTR_FIELD_START + 0x15b,
2561+
2562+
/**
2563+
* @brief Inner Dst MAC Address
2564+
*
2565+
* @type sai_acl_field_data_t sai_mac_t
2566+
* @flags CREATE_AND_SET
2567+
* @default disabled
2568+
*/
2569+
SAI_ACL_ENTRY_ATTR_FIELD_INNER_DST_MAC = SAI_ACL_ENTRY_ATTR_FIELD_START + 0x15c,
2570+
25352571
/**
25362572
* @brief End of Rule Match Fields
25372573
*/
2538-
SAI_ACL_ENTRY_ATTR_FIELD_END = SAI_ACL_ENTRY_ATTR_FIELD_DST_IPV6_WORD0,
2574+
SAI_ACL_ENTRY_ATTR_FIELD_END = SAI_ACL_ENTRY_ATTR_FIELD_INNER_DST_MAC,
25392575

25402576
/*
25412577
* Actions [sai_acl_action_data_t]

0 commit comments

Comments
 (0)