Skip to content

Commit 18ba20f

Browse files
[DASH] Add Routing Group API (#2026)
Add intermediate container object for outbound routing entries to attach them in all together to ENI.
1 parent abc8f02 commit 18ba20f

File tree

3 files changed

+112
-8
lines changed

3 files changed

+112
-8
lines changed

experimental/saiexperimentaldasheni.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,17 @@ typedef enum _sai_eni_attr_t
507507
*/
508508
SAI_ENI_ATTR_MAX_RESIMULATED_FLOW_PER_SECOND,
509509

510+
/**
511+
* @brief Action parameter outbound routing group id
512+
*
513+
* @type sai_object_id_t
514+
* @flags CREATE_AND_SET
515+
* @objects SAI_OBJECT_TYPE_OUTBOUND_ROUTING_GROUP
516+
* @allownull true
517+
* @default SAI_NULL_OBJECT_ID
518+
*/
519+
SAI_ENI_ATTR_OUTBOUND_ROUTING_GROUP_ID,
520+
510521
/**
511522
* @brief End of attributes
512523
*/

experimental/saiexperimentaldashoutboundrouting.h

Lines changed: 99 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,16 @@ typedef struct _sai_outbound_routing_entry_t
6565
sai_object_id_t switch_id;
6666

6767
/**
68-
* @brief Exact matched key eni_id
69-
*
70-
* @objects SAI_OBJECT_TYPE_ENI
68+
* @brief LPM matched key destination
7169
*/
72-
sai_object_id_t eni_id;
70+
sai_ip_prefix_t destination;
7371

7472
/**
75-
* @brief LPM matched key destination
73+
* @brief Exact matched key outbound_routing_group_id
74+
*
75+
* @objects SAI_OBJECT_TYPE_OUTBOUND_ROUTING_GROUP
7676
*/
77-
sai_ip_prefix_t destination;
77+
sai_object_id_t outbound_routing_group_id;
7878

7979
} sai_outbound_routing_entry_t;
8080

@@ -182,7 +182,7 @@ typedef enum _sai_outbound_routing_entry_attr_t
182182
SAI_OUTBOUND_ROUTING_ENTRY_ATTR_OVERLAY_DIP_MASK,
183183

184184
/**
185-
* @brief Action route_service_tunnel parameter OVERLAY_SIP
185+
* @brief Action parameter overlay sip
186186
*
187187
* @type sai_ip_address_t
188188
* @flags CREATE_AND_SET
@@ -277,7 +277,39 @@ typedef enum _sai_outbound_routing_entry_attr_t
277277
} sai_outbound_routing_entry_attr_t;
278278

279279
/**
280-
* @brief Create dash_outbound_routing_outbound_routing_entry
280+
* @brief Attribute ID for outbound routing group
281+
*/
282+
typedef enum _sai_outbound_routing_group_attr_t
283+
{
284+
/**
285+
* @brief Start of attributes
286+
*/
287+
SAI_OUTBOUND_ROUTING_GROUP_ATTR_START,
288+
289+
/**
290+
* @brief Action parameter disabled
291+
*
292+
* @type bool
293+
* @flags CREATE_AND_SET
294+
* @default false
295+
*/
296+
SAI_OUTBOUND_ROUTING_GROUP_ATTR_DISABLED = SAI_OUTBOUND_ROUTING_GROUP_ATTR_START,
297+
298+
/**
299+
* @brief End of attributes
300+
*/
301+
SAI_OUTBOUND_ROUTING_GROUP_ATTR_END,
302+
303+
/** Custom range base value */
304+
SAI_OUTBOUND_ROUTING_GROUP_ATTR_CUSTOM_RANGE_START = 0x10000000,
305+
306+
/** End of custom range base */
307+
SAI_OUTBOUND_ROUTING_GROUP_ATTR_CUSTOM_RANGE_END,
308+
309+
} sai_outbound_routing_group_attr_t;
310+
311+
/**
312+
* @brief Create outbound routing entry
281313
*
282314
* @param[in] outbound_routing_entry Entry
283315
* @param[in] attr_count Number of attributes
@@ -371,6 +403,58 @@ typedef sai_status_t (*sai_bulk_remove_outbound_routing_entry_fn)(
371403
_In_ sai_bulk_op_error_mode_t mode,
372404
_Out_ sai_status_t *object_statuses);
373405

406+
/**
407+
* @brief Create outbound routing group
408+
*
409+
* @param[out] outbound_routing_group_id Entry id
410+
* @param[in] switch_id Switch id
411+
* @param[in] attr_count Number of attributes
412+
* @param[in] attr_list Array of attributes
413+
*
414+
* @return #SAI_STATUS_SUCCESS on success Failure status code on error
415+
*/
416+
typedef sai_status_t (*sai_create_outbound_routing_group_fn)(
417+
_Out_ sai_object_id_t *outbound_routing_group_id,
418+
_In_ sai_object_id_t switch_id,
419+
_In_ uint32_t attr_count,
420+
_In_ const sai_attribute_t *attr_list);
421+
422+
/**
423+
* @brief Remove outbound routing group
424+
*
425+
* @param[in] outbound_routing_group_id Entry id
426+
*
427+
* @return #SAI_STATUS_SUCCESS on success Failure status code on error
428+
*/
429+
typedef sai_status_t (*sai_remove_outbound_routing_group_fn)(
430+
_In_ sai_object_id_t outbound_routing_group_id);
431+
432+
/**
433+
* @brief Set attribute for outbound routing group
434+
*
435+
* @param[in] outbound_routing_group_id Entry id
436+
* @param[in] attr Attribute
437+
*
438+
* @return #SAI_STATUS_SUCCESS on success Failure status code on error
439+
*/
440+
typedef sai_status_t (*sai_set_outbound_routing_group_attribute_fn)(
441+
_In_ sai_object_id_t outbound_routing_group_id,
442+
_In_ const sai_attribute_t *attr);
443+
444+
/**
445+
* @brief Get attribute for outbound routing group
446+
*
447+
* @param[in] outbound_routing_group_id Entry id
448+
* @param[in] attr_count Number of attributes
449+
* @param[inout] attr_list Array of attributes
450+
*
451+
* @return #SAI_STATUS_SUCCESS on success Failure status code on error
452+
*/
453+
typedef sai_status_t (*sai_get_outbound_routing_group_attribute_fn)(
454+
_In_ sai_object_id_t outbound_routing_group_id,
455+
_In_ uint32_t attr_count,
456+
_Inout_ sai_attribute_t *attr_list);
457+
374458
typedef struct _sai_dash_outbound_routing_api_t
375459
{
376460
sai_create_outbound_routing_entry_fn create_outbound_routing_entry;
@@ -380,6 +464,13 @@ typedef struct _sai_dash_outbound_routing_api_t
380464
sai_bulk_create_outbound_routing_entry_fn create_outbound_routing_entries;
381465
sai_bulk_remove_outbound_routing_entry_fn remove_outbound_routing_entries;
382466

467+
sai_create_outbound_routing_group_fn create_outbound_routing_group;
468+
sai_remove_outbound_routing_group_fn remove_outbound_routing_group;
469+
sai_set_outbound_routing_group_attribute_fn set_outbound_routing_group_attribute;
470+
sai_get_outbound_routing_group_attribute_fn get_outbound_routing_group_attribute;
471+
sai_bulk_object_create_fn create_outbound_routing_groups;
472+
sai_bulk_object_remove_fn remove_outbound_routing_groups;
473+
383474
} sai_dash_outbound_routing_api_t;
384475

385476
/**

experimental/saitypesextensions.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ typedef enum _sai_object_type_extensions_t
7676

7777
SAI_OBJECT_TYPE_DASH_TUNNEL,
7878

79+
SAI_OBJECT_TYPE_OUTBOUND_ROUTING_GROUP,
80+
7981
/* Add new experimental object types above this line */
8082

8183
SAI_OBJECT_TYPE_EXTENSIONS_RANGE_END

0 commit comments

Comments
 (0)