Skip to content

Commit 9dbac63

Browse files
jimmyzhaiKishore Gummadidala
authored andcommitted
[DASH] Update dash flow and dash tunnel (#2093)
Update SAI of dash flow to align with its p4 table in dash-pipeline Update SAI of dash tunnel to align with its p4 table in dash-pipeline
1 parent 1cf05c5 commit 9dbac63

4 files changed

Lines changed: 290 additions & 9 deletions

File tree

experimental/saiexperimentaldashflow.h

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,33 @@ typedef enum _sai_flow_entry_attr_t
435435
*/
436436
SAI_FLOW_ENTRY_ATTR_IP_ADDR_FAMILY,
437437

438+
/**
439+
* @brief Action parameter DASH flow sync state
440+
*
441+
* @type sai_dash_flow_sync_state_t
442+
* @flags CREATE_AND_SET
443+
* @default SAI_DASH_FLOW_SYNC_STATE_FLOW_MISS
444+
*/
445+
SAI_FLOW_ENTRY_ATTR_DASH_FLOW_SYNC_STATE,
446+
447+
/**
448+
* @brief Action parameter underlay0 source MAC
449+
*
450+
* @type sai_mac_t
451+
* @flags CREATE_AND_SET
452+
* @default vendor
453+
*/
454+
SAI_FLOW_ENTRY_ATTR_UNDERLAY0_SMAC,
455+
456+
/**
457+
* @brief Action parameter underlay0 destination MAC
458+
*
459+
* @type sai_mac_t
460+
* @flags CREATE_AND_SET
461+
* @default vendor
462+
*/
463+
SAI_FLOW_ENTRY_ATTR_UNDERLAY0_DMAC,
464+
438465
/**
439466
* @brief End of attributes
440467
*/

experimental/saiexperimentaldashtunnel.h

Lines changed: 217 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ typedef enum _sai_dash_tunnel_attr_t
5858
* @brief Action parameter DASH encapsulation
5959
*
6060
* @type sai_dash_encapsulation_t
61-
* @flags CREATE_AND_SET
61+
* @flags CREATE_ONLY
6262
* @default SAI_DASH_ENCAPSULATION_VXLAN
6363
*/
6464
SAI_DASH_TUNNEL_ATTR_DASH_ENCAPSULATION,
@@ -67,11 +67,29 @@ typedef enum _sai_dash_tunnel_attr_t
6767
* @brief Action parameter tunnel key
6868
*
6969
* @type sai_uint32_t
70-
* @flags CREATE_AND_SET
70+
* @flags CREATE_ONLY
7171
* @default 0
7272
*/
7373
SAI_DASH_TUNNEL_ATTR_TUNNEL_KEY,
7474

75+
/**
76+
* @brief Action parameter max member size
77+
*
78+
* @type sai_uint32_t
79+
* @flags CREATE_ONLY
80+
* @default 1
81+
*/
82+
SAI_DASH_TUNNEL_ATTR_MAX_MEMBER_SIZE,
83+
84+
/**
85+
* @brief Action parameter sip
86+
*
87+
* @type sai_ip_address_t
88+
* @flags CREATE_AND_SET
89+
* @default 0.0.0.0
90+
*/
91+
SAI_DASH_TUNNEL_ATTR_SIP,
92+
7593
/**
7694
* @brief End of attributes
7795
*/
@@ -85,6 +103,79 @@ typedef enum _sai_dash_tunnel_attr_t
85103

86104
} sai_dash_tunnel_attr_t;
87105

106+
/**
107+
* @brief Attribute ID for DASH tunnel member
108+
*/
109+
typedef enum _sai_dash_tunnel_member_attr_t
110+
{
111+
/**
112+
* @brief Start of attributes
113+
*/
114+
SAI_DASH_TUNNEL_MEMBER_ATTR_START,
115+
116+
/**
117+
* @brief Action parameter DASH tunnel id
118+
*
119+
* @type sai_object_id_t
120+
* @flags MANDATORY_ON_CREATE | CREATE_ONLY
121+
* @objects SAI_OBJECT_TYPE_DASH_TUNNEL
122+
*/
123+
SAI_DASH_TUNNEL_MEMBER_ATTR_DASH_TUNNEL_ID = SAI_DASH_TUNNEL_MEMBER_ATTR_START,
124+
125+
/**
126+
* @brief Action parameter DASH tunnel next hop id
127+
*
128+
* @type sai_object_id_t
129+
* @flags MANDATORY_ON_CREATE | CREATE_AND_SET
130+
* @objects SAI_OBJECT_TYPE_DASH_TUNNEL_NEXT_HOP
131+
*/
132+
SAI_DASH_TUNNEL_MEMBER_ATTR_DASH_TUNNEL_NEXT_HOP_ID,
133+
134+
/**
135+
* @brief End of attributes
136+
*/
137+
SAI_DASH_TUNNEL_MEMBER_ATTR_END,
138+
139+
/** Custom range base value */
140+
SAI_DASH_TUNNEL_MEMBER_ATTR_CUSTOM_RANGE_START = 0x10000000,
141+
142+
/** End of custom range base */
143+
SAI_DASH_TUNNEL_MEMBER_ATTR_CUSTOM_RANGE_END,
144+
145+
} sai_dash_tunnel_member_attr_t;
146+
147+
/**
148+
* @brief Attribute ID for DASH tunnel next hop
149+
*/
150+
typedef enum _sai_dash_tunnel_next_hop_attr_t
151+
{
152+
/**
153+
* @brief Start of attributes
154+
*/
155+
SAI_DASH_TUNNEL_NEXT_HOP_ATTR_START,
156+
157+
/**
158+
* @brief Action parameter dip
159+
*
160+
* @type sai_ip_address_t
161+
* @flags CREATE_AND_SET
162+
* @default 0.0.0.0
163+
*/
164+
SAI_DASH_TUNNEL_NEXT_HOP_ATTR_DIP = SAI_DASH_TUNNEL_NEXT_HOP_ATTR_START,
165+
166+
/**
167+
* @brief End of attributes
168+
*/
169+
SAI_DASH_TUNNEL_NEXT_HOP_ATTR_END,
170+
171+
/** Custom range base value */
172+
SAI_DASH_TUNNEL_NEXT_HOP_ATTR_CUSTOM_RANGE_START = 0x10000000,
173+
174+
/** End of custom range base */
175+
SAI_DASH_TUNNEL_NEXT_HOP_ATTR_CUSTOM_RANGE_END,
176+
177+
} sai_dash_tunnel_next_hop_attr_t;
178+
88179
/**
89180
* @brief Create DASH tunnel
90181
*
@@ -137,14 +228,132 @@ typedef sai_status_t (*sai_get_dash_tunnel_attribute_fn)(
137228
_In_ uint32_t attr_count,
138229
_Inout_ sai_attribute_t *attr_list);
139230

231+
/**
232+
* @brief Create DASH tunnel member
233+
*
234+
* @param[out] dash_tunnel_member_id Entry id
235+
* @param[in] switch_id Switch id
236+
* @param[in] attr_count Number of attributes
237+
* @param[in] attr_list Array of attributes
238+
*
239+
* @return #SAI_STATUS_SUCCESS on success Failure status code on error
240+
*/
241+
typedef sai_status_t (*sai_create_dash_tunnel_member_fn)(
242+
_Out_ sai_object_id_t *dash_tunnel_member_id,
243+
_In_ sai_object_id_t switch_id,
244+
_In_ uint32_t attr_count,
245+
_In_ const sai_attribute_t *attr_list);
246+
247+
/**
248+
* @brief Remove DASH tunnel member
249+
*
250+
* @param[in] dash_tunnel_member_id Entry id
251+
*
252+
* @return #SAI_STATUS_SUCCESS on success Failure status code on error
253+
*/
254+
typedef sai_status_t (*sai_remove_dash_tunnel_member_fn)(
255+
_In_ sai_object_id_t dash_tunnel_member_id);
256+
257+
/**
258+
* @brief Set attribute for DASH tunnel member
259+
*
260+
* @param[in] dash_tunnel_member_id Entry id
261+
* @param[in] attr Attribute
262+
*
263+
* @return #SAI_STATUS_SUCCESS on success Failure status code on error
264+
*/
265+
typedef sai_status_t (*sai_set_dash_tunnel_member_attribute_fn)(
266+
_In_ sai_object_id_t dash_tunnel_member_id,
267+
_In_ const sai_attribute_t *attr);
268+
269+
/**
270+
* @brief Get attribute for DASH tunnel member
271+
*
272+
* @param[in] dash_tunnel_member_id Entry id
273+
* @param[in] attr_count Number of attributes
274+
* @param[inout] attr_list Array of attributes
275+
*
276+
* @return #SAI_STATUS_SUCCESS on success Failure status code on error
277+
*/
278+
typedef sai_status_t (*sai_get_dash_tunnel_member_attribute_fn)(
279+
_In_ sai_object_id_t dash_tunnel_member_id,
280+
_In_ uint32_t attr_count,
281+
_Inout_ sai_attribute_t *attr_list);
282+
283+
/**
284+
* @brief Create DASH tunnel next hop
285+
*
286+
* @param[out] dash_tunnel_next_hop_id Entry id
287+
* @param[in] switch_id Switch id
288+
* @param[in] attr_count Number of attributes
289+
* @param[in] attr_list Array of attributes
290+
*
291+
* @return #SAI_STATUS_SUCCESS on success Failure status code on error
292+
*/
293+
typedef sai_status_t (*sai_create_dash_tunnel_next_hop_fn)(
294+
_Out_ sai_object_id_t *dash_tunnel_next_hop_id,
295+
_In_ sai_object_id_t switch_id,
296+
_In_ uint32_t attr_count,
297+
_In_ const sai_attribute_t *attr_list);
298+
299+
/**
300+
* @brief Remove DASH tunnel next hop
301+
*
302+
* @param[in] dash_tunnel_next_hop_id Entry id
303+
*
304+
* @return #SAI_STATUS_SUCCESS on success Failure status code on error
305+
*/
306+
typedef sai_status_t (*sai_remove_dash_tunnel_next_hop_fn)(
307+
_In_ sai_object_id_t dash_tunnel_next_hop_id);
308+
309+
/**
310+
* @brief Set attribute for DASH tunnel next hop
311+
*
312+
* @param[in] dash_tunnel_next_hop_id Entry id
313+
* @param[in] attr Attribute
314+
*
315+
* @return #SAI_STATUS_SUCCESS on success Failure status code on error
316+
*/
317+
typedef sai_status_t (*sai_set_dash_tunnel_next_hop_attribute_fn)(
318+
_In_ sai_object_id_t dash_tunnel_next_hop_id,
319+
_In_ const sai_attribute_t *attr);
320+
321+
/**
322+
* @brief Get attribute for DASH tunnel next hop
323+
*
324+
* @param[in] dash_tunnel_next_hop_id Entry id
325+
* @param[in] attr_count Number of attributes
326+
* @param[inout] attr_list Array of attributes
327+
*
328+
* @return #SAI_STATUS_SUCCESS on success Failure status code on error
329+
*/
330+
typedef sai_status_t (*sai_get_dash_tunnel_next_hop_attribute_fn)(
331+
_In_ sai_object_id_t dash_tunnel_next_hop_id,
332+
_In_ uint32_t attr_count,
333+
_Inout_ sai_attribute_t *attr_list);
334+
140335
typedef struct _sai_dash_tunnel_api_t
141336
{
142-
sai_create_dash_tunnel_fn create_dash_tunnel;
143-
sai_remove_dash_tunnel_fn remove_dash_tunnel;
144-
sai_set_dash_tunnel_attribute_fn set_dash_tunnel_attribute;
145-
sai_get_dash_tunnel_attribute_fn get_dash_tunnel_attribute;
146-
sai_bulk_object_create_fn create_dash_tunnels;
147-
sai_bulk_object_remove_fn remove_dash_tunnels;
337+
sai_create_dash_tunnel_fn create_dash_tunnel;
338+
sai_remove_dash_tunnel_fn remove_dash_tunnel;
339+
sai_set_dash_tunnel_attribute_fn set_dash_tunnel_attribute;
340+
sai_get_dash_tunnel_attribute_fn get_dash_tunnel_attribute;
341+
sai_bulk_object_create_fn create_dash_tunnels;
342+
sai_bulk_object_remove_fn remove_dash_tunnels;
343+
344+
sai_create_dash_tunnel_member_fn create_dash_tunnel_member;
345+
sai_remove_dash_tunnel_member_fn remove_dash_tunnel_member;
346+
sai_set_dash_tunnel_member_attribute_fn set_dash_tunnel_member_attribute;
347+
sai_get_dash_tunnel_member_attribute_fn get_dash_tunnel_member_attribute;
348+
sai_bulk_object_create_fn create_dash_tunnel_members;
349+
sai_bulk_object_remove_fn remove_dash_tunnel_members;
350+
351+
sai_create_dash_tunnel_next_hop_fn create_dash_tunnel_next_hop;
352+
sai_remove_dash_tunnel_next_hop_fn remove_dash_tunnel_next_hop;
353+
sai_set_dash_tunnel_next_hop_attribute_fn set_dash_tunnel_next_hop_attribute;
354+
sai_get_dash_tunnel_next_hop_attribute_fn get_dash_tunnel_next_hop_attribute;
355+
sai_bulk_object_create_fn create_dash_tunnel_next_hops;
356+
sai_bulk_object_remove_fn remove_dash_tunnel_next_hops;
148357

149358
} sai_dash_tunnel_api_t;
150359

experimental/saitypesextensions.h

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ typedef enum _sai_object_type_extensions_t
8888

8989
SAI_OBJECT_TYPE_DASH_APPLIANCE,
9090

91+
SAI_OBJECT_TYPE_DASH_TUNNEL_MEMBER,
92+
93+
SAI_OBJECT_TYPE_DASH_TUNNEL_NEXT_HOP,
94+
9195
/* Add new experimental object types above this line */
9296

9397
SAI_OBJECT_TYPE_EXTENSIONS_RANGE_END
@@ -180,10 +184,32 @@ typedef enum _sai_dash_flow_enabled_key_t
180184

181185
/**
182186
* @brief Defines a list of enums for dash_flow_action
187+
*
188+
* @flags strict
183189
*/
184190
typedef enum _sai_dash_flow_action_t
185191
{
186-
SAI_DASH_FLOW_ACTION_NONE,
192+
SAI_DASH_FLOW_ACTION_NONE = 0,
193+
194+
SAI_DASH_FLOW_ACTION_ENCAP_U0 = 1 << 0,
195+
196+
SAI_DASH_FLOW_ACTION_ENCAP_U1 = 1 << 1,
197+
198+
SAI_DASH_FLOW_ACTION_SET_SMAC = 1 << 2,
199+
200+
SAI_DASH_FLOW_ACTION_SET_DMAC = 1 << 3,
201+
202+
SAI_DASH_FLOW_ACTION_SNAT = 1 << 4,
203+
204+
SAI_DASH_FLOW_ACTION_DNAT = 1 << 5,
205+
206+
SAI_DASH_FLOW_ACTION_NAT46 = 1 << 6,
207+
208+
SAI_DASH_FLOW_ACTION_NAT64 = 1 << 7,
209+
210+
SAI_DASH_FLOW_ACTION_SNAT_PORT = 1 << 8,
211+
212+
SAI_DASH_FLOW_ACTION_DNAT_PORT = 1 << 9,
187213

188214
} sai_dash_flow_action_t;
189215

@@ -292,5 +318,22 @@ typedef enum _sai_dash_eni_mac_override_type_t
292318

293319
} sai_dash_eni_mac_override_type_t;
294320

321+
/**
322+
* @brief Defines a list of enums for dash_flow_sync_state
323+
*/
324+
typedef enum _sai_dash_flow_sync_state_t
325+
{
326+
SAI_DASH_FLOW_SYNC_STATE_FLOW_MISS,
327+
328+
SAI_DASH_FLOW_SYNC_STATE_FLOW_CREATED,
329+
330+
SAI_DASH_FLOW_SYNC_STATE_FLOW_SYNCED,
331+
332+
SAI_DASH_FLOW_SYNC_STATE_FLOW_PENDING_DELETE,
333+
334+
SAI_DASH_FLOW_SYNC_STATE_FLOW_PENDING_RESIMULATION,
335+
336+
} sai_dash_flow_sync_state_t;
337+
295338
#endif /* __SAITYPESEXTENSIONS_H_ */
296339

inc/saiobject.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
#include <saisrv6.h>
3838

3939
/* new experimental object type includes */
40+
#include <saiexperimentaldashtunnel.h>
41+
#include <saiexperimentaldashha.h>
4042
#include <saiexperimentaldashappliance.h>
4143
#include <saiexperimentaldashflow.h>
4244
#include <saiexperimentaldashmeter.h>

0 commit comments

Comments
 (0)