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

Enhancements for MPLS support #1181

Merged
merged 2 commits into from
Feb 22, 2021
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
97 changes: 97 additions & 0 deletions inc/saimpls.h
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,98 @@ typedef sai_status_t (*sai_get_inseg_entry_attribute_fn)(
_In_ uint32_t attr_count,
_Inout_ sai_attribute_t *attr_list);

/**
* @brief Bulk create In Segment entry
*
* @param[in] object_count Number of objects to create
* @param[in] inseg_entry List of object to create
* @param[in] attr_count List of attr_count. Caller passes the number
* of attribute for each object to create.
* @param[in] attr_list List of attributes for every object.
* @param[in] mode Bulk operation error handling mode.
* @param[out] object_statuses List of status for every object. Caller needs to
* allocate the buffer
*
* @return #SAI_STATUS_SUCCESS on success when all objects are created or
* #SAI_STATUS_FAILURE when any of the objects fails to create. When there is
* failure, Caller is expected to go through the list of returned statuses to
* find out which fails and which succeeds.
*/
typedef sai_status_t (*sai_bulk_create_inseg_entry_fn)(
_In_ uint32_t object_count,
_In_ const sai_inseg_entry_t *inseg_entry,
_In_ const uint32_t *attr_count,
_In_ const sai_attribute_t **attr_list,
_In_ sai_bulk_op_error_mode_t mode,
_Out_ sai_status_t *object_statuses);

/**
* @brief Bulk remove In Segment entry
*
* @param[in] object_count Number of objects to remove
* @param[in] inseg_entry List of objects to remove
* @param[in] mode Bulk operation error handling mode.
* @param[out] object_statuses List of status for every object. Caller needs to
* allocate the buffer
*
* @return #SAI_STATUS_SUCCESS on success when all objects are removed or
* #SAI_STATUS_FAILURE when any of the objects fails to remove. When there is
* failure, Caller is expected to go through the list of returned statuses to
* find out which fails and which succeeds.
*/
typedef sai_status_t (*sai_bulk_remove_inseg_entry_fn)(
_In_ uint32_t object_count,
_In_ const sai_inseg_entry_t *inseg_entry,
_In_ sai_bulk_op_error_mode_t mode,
_Out_ sai_status_t *object_statuses);

/**
* @brief Bulk set attribute on In Segment entry
*
* @param[in] object_count Number of objects to set attribute
* @param[in] inseg_entry List of objects to set attribute
* @param[in] attr_list List of attributes to set on objects, one attribute per object
* @param[in] mode Bulk operation error handling mode.
* @param[out] object_statuses List of status for every object. Caller needs to
* allocate the buffer
*
* @return #SAI_STATUS_SUCCESS on success when all objects are removed or
* #SAI_STATUS_FAILURE when any of the objects fails to remove. When there is
* failure, Caller is expected to go through the list of returned statuses to
* find out which fails and which succeeds.
*/
typedef sai_status_t (*sai_bulk_set_inseg_entry_attribute_fn)(
_In_ uint32_t object_count,
_In_ const sai_inseg_entry_t *inseg_entry,
_In_ const sai_attribute_t *attr_list,
_In_ sai_bulk_op_error_mode_t mode,
_Out_ sai_status_t *object_statuses);

/**
* @brief Bulk get attribute on In Segment entry
*
* @param[in] object_count Number of objects to set attribute
* @param[in] inseg_entry List of objects to set attribute
* @param[in] attr_count List of attr_count. Caller passes the number
* of attribute for each object to get
* @param[inout] attr_list List of attributes to set on objects, one attribute per object
* @param[in] mode Bulk operation error handling mode
* @param[out] object_statuses List of status for every object. Caller needs to
* allocate the buffer
*
* @return #SAI_STATUS_SUCCESS on success when all objects are removed or
* #SAI_STATUS_FAILURE when any of the objects fails to remove. When there is
* failure, Caller is expected to go through the list of returned statuses to
* find out which fails and which succeeds.
*/
typedef sai_status_t (*sai_bulk_get_inseg_entry_attribute_fn)(
_In_ uint32_t object_count,
_In_ const sai_inseg_entry_t *inseg_entry,
_In_ const uint32_t *attr_count,
_Inout_ sai_attribute_t **attr_list,
_In_ sai_bulk_op_error_mode_t mode,
_Out_ sai_status_t *object_statuses);

/**
* @brief MPLS methods table retrieved with sai_api_query()
*/
Expand All @@ -291,6 +383,11 @@ typedef struct _sai_mpls_api_t
sai_set_inseg_entry_attribute_fn set_inseg_entry_attribute;
sai_get_inseg_entry_attribute_fn get_inseg_entry_attribute;

sai_bulk_create_inseg_entry_fn create_inseg_entries;
sai_bulk_remove_inseg_entry_fn remove_inseg_entries;
sai_bulk_set_inseg_entry_attribute_fn set_inseg_entries_attribute;
sai_bulk_get_inseg_entry_attribute_fn get_inseg_entries_attribute;

} sai_mpls_api_t;

/**
Expand Down
9 changes: 9 additions & 0 deletions inc/sairouterinterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,15 @@ typedef enum _sai_router_interface_attr_t
*/
SAI_ROUTER_INTERFACE_ATTR_DISABLE_DECREMENT_TTL,

/**
* @brief Admin MPLS state
*
* @type bool
* @flags CREATE_AND_SET
* @default false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

default it to true? just like IPv4 and IPv6?

*/
SAI_ROUTER_INTERFACE_ATTR_ADMIN_MPLS_STATE,

/**
* @brief End of attributes
*/
Expand Down