Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DASH] Add Routing Group API #2026

Merged
merged 1 commit into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading