Skip to content

Commit

Permalink
[DASH] Add Routing Group API (opencomputeproject#2026)
Browse files Browse the repository at this point in the history
Add intermediate container object for outbound
routing entries to attach them in all together to ENI.

Signed-off-by: siqbal1986 <shahzad.iqbal@microsoft.com>
  • Loading branch information
marian-pritsak authored and siqbal1986 committed Sep 30, 2024
1 parent abc8f02 commit cd9a32d
Show file tree
Hide file tree
Showing 3 changed files with 112 additions and 8 deletions.
11 changes: 11 additions & 0 deletions experimental/saiexperimentaldasheni.h
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,17 @@ typedef enum _sai_eni_attr_t
*/
SAI_ENI_ATTR_MAX_RESIMULATED_FLOW_PER_SECOND,

/**
* @brief Action parameter outbound routing group id
*
* @type sai_object_id_t
* @flags CREATE_AND_SET
* @objects SAI_OBJECT_TYPE_OUTBOUND_ROUTING_GROUP
* @allownull true
* @default SAI_NULL_OBJECT_ID
*/
SAI_ENI_ATTR_OUTBOUND_ROUTING_GROUP_ID,

/**
* @brief End of attributes
*/
Expand Down
107 changes: 99 additions & 8 deletions experimental/saiexperimentaldashoutboundrouting.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,16 @@ typedef struct _sai_outbound_routing_entry_t
sai_object_id_t switch_id;

/**
* @brief Exact matched key eni_id
*
* @objects SAI_OBJECT_TYPE_ENI
* @brief LPM matched key destination
*/
sai_object_id_t eni_id;
sai_ip_prefix_t destination;

/**
* @brief LPM matched key destination
* @brief Exact matched key outbound_routing_group_id
*
* @objects SAI_OBJECT_TYPE_OUTBOUND_ROUTING_GROUP
*/
sai_ip_prefix_t destination;
sai_object_id_t outbound_routing_group_id;

} sai_outbound_routing_entry_t;

Expand Down Expand Up @@ -182,7 +182,7 @@ typedef enum _sai_outbound_routing_entry_attr_t
SAI_OUTBOUND_ROUTING_ENTRY_ATTR_OVERLAY_DIP_MASK,

/**
* @brief Action route_service_tunnel parameter OVERLAY_SIP
* @brief Action parameter overlay sip
*
* @type sai_ip_address_t
* @flags CREATE_AND_SET
Expand Down Expand Up @@ -277,7 +277,39 @@ typedef enum _sai_outbound_routing_entry_attr_t
} sai_outbound_routing_entry_attr_t;

/**
* @brief Create dash_outbound_routing_outbound_routing_entry
* @brief Attribute ID for outbound routing group
*/
typedef enum _sai_outbound_routing_group_attr_t
{
/**
* @brief Start of attributes
*/
SAI_OUTBOUND_ROUTING_GROUP_ATTR_START,

/**
* @brief Action parameter disabled
*
* @type bool
* @flags CREATE_AND_SET
* @default false
*/
SAI_OUTBOUND_ROUTING_GROUP_ATTR_DISABLED = SAI_OUTBOUND_ROUTING_GROUP_ATTR_START,

/**
* @brief End of attributes
*/
SAI_OUTBOUND_ROUTING_GROUP_ATTR_END,

/** Custom range base value */
SAI_OUTBOUND_ROUTING_GROUP_ATTR_CUSTOM_RANGE_START = 0x10000000,

/** End of custom range base */
SAI_OUTBOUND_ROUTING_GROUP_ATTR_CUSTOM_RANGE_END,

} sai_outbound_routing_group_attr_t;

/**
* @brief Create outbound routing entry
*
* @param[in] outbound_routing_entry Entry
* @param[in] attr_count Number of attributes
Expand Down Expand Up @@ -371,6 +403,58 @@ typedef sai_status_t (*sai_bulk_remove_outbound_routing_entry_fn)(
_In_ sai_bulk_op_error_mode_t mode,
_Out_ sai_status_t *object_statuses);

/**
* @brief Create outbound routing group
*
* @param[out] outbound_routing_group_id Entry id
* @param[in] switch_id Switch id
* @param[in] attr_count Number of attributes
* @param[in] attr_list Array of attributes
*
* @return #SAI_STATUS_SUCCESS on success Failure status code on error
*/
typedef sai_status_t (*sai_create_outbound_routing_group_fn)(
_Out_ sai_object_id_t *outbound_routing_group_id,
_In_ sai_object_id_t switch_id,
_In_ uint32_t attr_count,
_In_ const sai_attribute_t *attr_list);

/**
* @brief Remove outbound routing group
*
* @param[in] outbound_routing_group_id Entry id
*
* @return #SAI_STATUS_SUCCESS on success Failure status code on error
*/
typedef sai_status_t (*sai_remove_outbound_routing_group_fn)(
_In_ sai_object_id_t outbound_routing_group_id);

/**
* @brief Set attribute for outbound routing group
*
* @param[in] outbound_routing_group_id Entry id
* @param[in] attr Attribute
*
* @return #SAI_STATUS_SUCCESS on success Failure status code on error
*/
typedef sai_status_t (*sai_set_outbound_routing_group_attribute_fn)(
_In_ sai_object_id_t outbound_routing_group_id,
_In_ const sai_attribute_t *attr);

/**
* @brief Get attribute for outbound routing group
*
* @param[in] outbound_routing_group_id Entry id
* @param[in] attr_count Number of attributes
* @param[inout] attr_list Array of attributes
*
* @return #SAI_STATUS_SUCCESS on success Failure status code on error
*/
typedef sai_status_t (*sai_get_outbound_routing_group_attribute_fn)(
_In_ sai_object_id_t outbound_routing_group_id,
_In_ uint32_t attr_count,
_Inout_ sai_attribute_t *attr_list);

typedef struct _sai_dash_outbound_routing_api_t
{
sai_create_outbound_routing_entry_fn create_outbound_routing_entry;
Expand All @@ -380,6 +464,13 @@ typedef struct _sai_dash_outbound_routing_api_t
sai_bulk_create_outbound_routing_entry_fn create_outbound_routing_entries;
sai_bulk_remove_outbound_routing_entry_fn remove_outbound_routing_entries;

sai_create_outbound_routing_group_fn create_outbound_routing_group;
sai_remove_outbound_routing_group_fn remove_outbound_routing_group;
sai_set_outbound_routing_group_attribute_fn set_outbound_routing_group_attribute;
sai_get_outbound_routing_group_attribute_fn get_outbound_routing_group_attribute;
sai_bulk_object_create_fn create_outbound_routing_groups;
sai_bulk_object_remove_fn remove_outbound_routing_groups;

} sai_dash_outbound_routing_api_t;

/**
Expand Down
2 changes: 2 additions & 0 deletions experimental/saitypesextensions.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ typedef enum _sai_object_type_extensions_t

SAI_OBJECT_TYPE_DASH_TUNNEL,

SAI_OBJECT_TYPE_OUTBOUND_ROUTING_GROUP,

/* Add new experimental object types above this line */

SAI_OBJECT_TYPE_EXTENSIONS_RANGE_END
Expand Down

0 comments on commit cd9a32d

Please sign in to comment.