From 99e927b57ab6ec58e598d5f2f69533626038ed56 Mon Sep 17 00:00:00 2001 From: Ann Pokora Date: Thu, 14 Jan 2021 14:03:50 -0800 Subject: [PATCH 1/2] Enhancements for MPLS support Signed-off-by: Ann Pokora --- inc/saimpls.h | 97 ++++++++++++++++++++++++++++++++++++++++ inc/sairouterinterface.h | 9 ++++ inc/saiswitch.h | 8 ++++ 3 files changed, 114 insertions(+) diff --git a/inc/saimpls.h b/inc/saimpls.h index f103fd1ea..eb17c4057 100644 --- a/inc/saimpls.h +++ b/inc/saimpls.h @@ -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() */ @@ -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; /** diff --git a/inc/sairouterinterface.h b/inc/sairouterinterface.h index 0b4cd918e..1d71d488e 100644 --- a/inc/sairouterinterface.h +++ b/inc/sairouterinterface.h @@ -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 + */ + SAI_ROUTER_INTERFACE_ATTR_ADMIN_MPLS_STATE, + /** * @brief End of attributes */ diff --git a/inc/saiswitch.h b/inc/saiswitch.h index 0a358d081..206152035 100644 --- a/inc/saiswitch.h +++ b/inc/saiswitch.h @@ -2265,6 +2265,14 @@ typedef enum _sai_switch_attr_t */ SAI_SWITCH_ATTR_TUNNEL_LOOPBACK_PACKET_ACTION, + /** + * @brief Available MPLS in segment entries + * + * @type sai_uint32_t + * @flags READ_ONLY + */ + SAI_SWITCH_ATTR_AVAILABLE_MPLS_INSEG_ENTRY, + /** * @brief End of attributes */ From 16bd6f2da391349b56051cc65401bad371b4fcdb Mon Sep 17 00:00:00 2001 From: Ann Pokora Date: Tue, 19 Jan 2021 10:30:35 -0800 Subject: [PATCH 2/2] remove unnecessary SAI_SWITCH_ATTR_AVAILABLE_MPLS_INSEG_ENTRY Signed-off-by: Ann Pokora --- inc/saiswitch.h | 8 -------- 1 file changed, 8 deletions(-) diff --git a/inc/saiswitch.h b/inc/saiswitch.h index 206152035..0a358d081 100644 --- a/inc/saiswitch.h +++ b/inc/saiswitch.h @@ -2265,14 +2265,6 @@ typedef enum _sai_switch_attr_t */ SAI_SWITCH_ATTR_TUNNEL_LOOPBACK_PACKET_ACTION, - /** - * @brief Available MPLS in segment entries - * - * @type sai_uint32_t - * @flags READ_ONLY - */ - SAI_SWITCH_ATTR_AVAILABLE_MPLS_INSEG_ENTRY, - /** * @brief End of attributes */