diff --git a/experimental/saiexperimentaldashdirectionlookup.h b/experimental/saiexperimentaldashdirectionlookup.h index a750d88da..9b65894be 100644 --- a/experimental/saiexperimentaldashdirectionlookup.h +++ b/experimental/saiexperimentaldashdirectionlookup.h @@ -42,6 +42,8 @@ typedef enum _sai_direction_lookup_entry_action_t { SAI_DIRECTION_LOOKUP_ENTRY_ACTION_SET_OUTBOUND_DIRECTION, + SAI_DIRECTION_LOOKUP_ENTRY_ACTION_SET_INBOUND_DIRECTION, + } sai_direction_lookup_entry_action_t; /** @@ -88,6 +90,7 @@ typedef enum _sai_direction_lookup_entry_attr_t * @type sai_dash_eni_mac_override_type_t * @flags CREATE_AND_SET * @default SAI_DASH_ENI_MAC_OVERRIDE_TYPE_NONE + * @validonly SAI_DIRECTION_LOOKUP_ENTRY_ATTR_ACTION == SAI_DIRECTION_LOOKUP_ENTRY_ACTION_SET_OUTBOUND_DIRECTION or SAI_DIRECTION_LOOKUP_ENTRY_ATTR_ACTION == SAI_DIRECTION_LOOKUP_ENTRY_ACTION_SET_INBOUND_DIRECTION */ SAI_DIRECTION_LOOKUP_ENTRY_ATTR_DASH_ENI_MAC_OVERRIDE_TYPE, diff --git a/experimental/saiexperimentaldasheni.h b/experimental/saiexperimentaldasheni.h index bfdf03eec..5154336ec 100644 --- a/experimental/saiexperimentaldasheni.h +++ b/experimental/saiexperimentaldasheni.h @@ -556,6 +556,15 @@ typedef enum _sai_eni_attr_t */ SAI_ENI_ATTR_FLOW_TABLE_ID, + /** + * @brief Action parameter DASH ENI mode + * + * @type sai_dash_eni_mode_t + * @flags CREATE_ONLY + * @default SAI_DASH_ENI_MODE_VM + */ + SAI_ENI_ATTR_DASH_ENI_MODE, + /** * @brief End of attributes */ @@ -814,6 +823,9 @@ typedef enum _sai_eni_stat_t /** DASH ENI OUTBOUND_PORT_MAP_PORT_RANGE_ENTRY_MISS_DROP_PACKETS stat count */ SAI_ENI_STAT_OUTBOUND_PORT_MAP_PORT_RANGE_ENTRY_MISS_DROP_PACKETS, + /** DASH ENI ENI_TRUSTED_VNI_ENTRY_MISS_DROP_PACKETS stat count */ + SAI_ENI_STAT_ENI_TRUSTED_VNI_ENTRY_MISS_DROP_PACKETS, + } sai_eni_stat_t; /** diff --git a/experimental/saiexperimentaldashtrustedvni.h b/experimental/saiexperimentaldashtrustedvni.h new file mode 100644 index 000000000..0bebf2b5f --- /dev/null +++ b/experimental/saiexperimentaldashtrustedvni.h @@ -0,0 +1,376 @@ +/** + * Copyright (c) 2014 Microsoft Open Technologies, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT + * LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS + * FOR A PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT. + * + * See the Apache Version 2.0 License for specific language governing + * permissions and limitations under the License. + * + * Microsoft would like to thank the following companies for their review and + * assistance with these files: Intel Corporation, Mellanox Technologies Ltd, + * Dell Products, L.P., Facebook, Inc., Marvell International Ltd. + * + * @file saiexperimentaldashtrustedvni.h + * + * @brief This module defines SAI extensions for DASH trusted VNI + * + * @warning This module is a SAI experimental module + */ + +#if !defined (__SAIEXPERIMENTALDASHTRUSTEDVNI_H_) +#define __SAIEXPERIMENTALDASHTRUSTEDVNI_H_ + +#include + +/** + * @defgroup SAIEXPERIMENTALDASHTRUSTEDVNI SAI - Experimental: DASH trusted VNI specific API definitions + * + * @{ + */ + +/** + * @brief Attribute data for #SAI_GLOBAL_TRUSTED_VNI_ENTRY_ATTR_ACTION + */ +typedef enum _sai_global_trusted_vni_entry_action_t +{ + SAI_GLOBAL_TRUSTED_VNI_ENTRY_ACTION_PERMIT, + +} sai_global_trusted_vni_entry_action_t; + +/** + * @brief Attribute data for #SAI_ENI_TRUSTED_VNI_ENTRY_ATTR_ACTION + */ +typedef enum _sai_eni_trusted_vni_entry_action_t +{ + SAI_ENI_TRUSTED_VNI_ENTRY_ACTION_PERMIT, + +} sai_eni_trusted_vni_entry_action_t; + +/** + * @brief Entry for global_trusted_vni_entry + */ +typedef struct _sai_global_trusted_vni_entry_t +{ + /** + * @brief Switch ID + * + * @objects SAI_OBJECT_TYPE_SWITCH + */ + sai_object_id_t switch_id; + + /** + * @brief Range matched key vni_range + */ + sai_u32_range_t vni_range; + +} sai_global_trusted_vni_entry_t; + +/** + * @brief Attribute ID for global trusted VNI entry + */ +typedef enum _sai_global_trusted_vni_entry_attr_t +{ + /** + * @brief Start of attributes + */ + SAI_GLOBAL_TRUSTED_VNI_ENTRY_ATTR_START, + + /** + * @brief Action + * + * @type sai_global_trusted_vni_entry_action_t + * @flags CREATE_AND_SET + * @default SAI_GLOBAL_TRUSTED_VNI_ENTRY_ACTION_PERMIT + */ + SAI_GLOBAL_TRUSTED_VNI_ENTRY_ATTR_ACTION = SAI_GLOBAL_TRUSTED_VNI_ENTRY_ATTR_START, + + /** + * @brief End of attributes + */ + SAI_GLOBAL_TRUSTED_VNI_ENTRY_ATTR_END, + + /** Custom range base value */ + SAI_GLOBAL_TRUSTED_VNI_ENTRY_ATTR_CUSTOM_RANGE_START = 0x10000000, + + /** End of custom range base */ + SAI_GLOBAL_TRUSTED_VNI_ENTRY_ATTR_CUSTOM_RANGE_END, + +} sai_global_trusted_vni_entry_attr_t; + +/** + * @brief Entry for eni_trusted_vni_entry + */ +typedef struct _sai_eni_trusted_vni_entry_t +{ + /** + * @brief Switch ID + * + * @objects SAI_OBJECT_TYPE_SWITCH + */ + sai_object_id_t switch_id; + + /** + * @brief Exact matched key eni_id + * + * @objects SAI_OBJECT_TYPE_ENI + */ + sai_object_id_t eni_id; + + /** + * @brief Range matched key vni_range + */ + sai_u32_range_t vni_range; + +} sai_eni_trusted_vni_entry_t; + +/** + * @brief Attribute ID for ENI trusted VNI entry + */ +typedef enum _sai_eni_trusted_vni_entry_attr_t +{ + /** + * @brief Start of attributes + */ + SAI_ENI_TRUSTED_VNI_ENTRY_ATTR_START, + + /** + * @brief Action + * + * @type sai_eni_trusted_vni_entry_action_t + * @flags CREATE_AND_SET + * @default SAI_ENI_TRUSTED_VNI_ENTRY_ACTION_PERMIT + */ + SAI_ENI_TRUSTED_VNI_ENTRY_ATTR_ACTION = SAI_ENI_TRUSTED_VNI_ENTRY_ATTR_START, + + /** + * @brief End of attributes + */ + SAI_ENI_TRUSTED_VNI_ENTRY_ATTR_END, + + /** Custom range base value */ + SAI_ENI_TRUSTED_VNI_ENTRY_ATTR_CUSTOM_RANGE_START = 0x10000000, + + /** End of custom range base */ + SAI_ENI_TRUSTED_VNI_ENTRY_ATTR_CUSTOM_RANGE_END, + +} sai_eni_trusted_vni_entry_attr_t; + +/** + * @brief Create global trusted VNI entry + * + * @param[in] global_trusted_vni_entry Entry + * @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_global_trusted_vni_entry_fn)( + _In_ const sai_global_trusted_vni_entry_t *global_trusted_vni_entry, + _In_ uint32_t attr_count, + _In_ const sai_attribute_t *attr_list); + +/** + * @brief Remove global trusted VNI entry + * + * @param[in] global_trusted_vni_entry Entry + * + * @return #SAI_STATUS_SUCCESS on success Failure status code on error + */ +typedef sai_status_t (*sai_remove_global_trusted_vni_entry_fn)( + _In_ const sai_global_trusted_vni_entry_t *global_trusted_vni_entry); + +/** + * @brief Set attribute for global trusted VNI entry + * + * @param[in] global_trusted_vni_entry Entry + * @param[in] attr Attribute + * + * @return #SAI_STATUS_SUCCESS on success Failure status code on error + */ +typedef sai_status_t (*sai_set_global_trusted_vni_entry_attribute_fn)( + _In_ const sai_global_trusted_vni_entry_t *global_trusted_vni_entry, + _In_ const sai_attribute_t *attr); + +/** + * @brief Get attribute for global trusted VNI entry + * + * @param[in] global_trusted_vni_entry Entry + * @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_global_trusted_vni_entry_attribute_fn)( + _In_ const sai_global_trusted_vni_entry_t *global_trusted_vni_entry, + _In_ uint32_t attr_count, + _Inout_ sai_attribute_t *attr_list); + +/** + * @brief Bulk create global trusted VNI entry + * + * @param[in] object_count Number of objects to create + * @param[in] global_trusted_vni_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_global_trusted_vni_entry_fn)( + _In_ uint32_t object_count, + _In_ const sai_global_trusted_vni_entry_t *global_trusted_vni_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 global trusted VNI entry + * + * @param[in] object_count Number of objects to remove + * @param[in] global_trusted_vni_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_global_trusted_vni_entry_fn)( + _In_ uint32_t object_count, + _In_ const sai_global_trusted_vni_entry_t *global_trusted_vni_entry, + _In_ sai_bulk_op_error_mode_t mode, + _Out_ sai_status_t *object_statuses); + +/** + * @brief Create ENI trusted VNI entry + * + * @param[in] eni_trusted_vni_entry Entry + * @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_eni_trusted_vni_entry_fn)( + _In_ const sai_eni_trusted_vni_entry_t *eni_trusted_vni_entry, + _In_ uint32_t attr_count, + _In_ const sai_attribute_t *attr_list); + +/** + * @brief Remove ENI trusted VNI entry + * + * @param[in] eni_trusted_vni_entry Entry + * + * @return #SAI_STATUS_SUCCESS on success Failure status code on error + */ +typedef sai_status_t (*sai_remove_eni_trusted_vni_entry_fn)( + _In_ const sai_eni_trusted_vni_entry_t *eni_trusted_vni_entry); + +/** + * @brief Set attribute for ENI trusted VNI entry + * + * @param[in] eni_trusted_vni_entry Entry + * @param[in] attr Attribute + * + * @return #SAI_STATUS_SUCCESS on success Failure status code on error + */ +typedef sai_status_t (*sai_set_eni_trusted_vni_entry_attribute_fn)( + _In_ const sai_eni_trusted_vni_entry_t *eni_trusted_vni_entry, + _In_ const sai_attribute_t *attr); + +/** + * @brief Get attribute for ENI trusted VNI entry + * + * @param[in] eni_trusted_vni_entry Entry + * @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_eni_trusted_vni_entry_attribute_fn)( + _In_ const sai_eni_trusted_vni_entry_t *eni_trusted_vni_entry, + _In_ uint32_t attr_count, + _Inout_ sai_attribute_t *attr_list); + +/** + * @brief Bulk create ENI trusted VNI entry + * + * @param[in] object_count Number of objects to create + * @param[in] eni_trusted_vni_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_eni_trusted_vni_entry_fn)( + _In_ uint32_t object_count, + _In_ const sai_eni_trusted_vni_entry_t *eni_trusted_vni_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 ENI trusted VNI entry + * + * @param[in] object_count Number of objects to remove + * @param[in] eni_trusted_vni_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_eni_trusted_vni_entry_fn)( + _In_ uint32_t object_count, + _In_ const sai_eni_trusted_vni_entry_t *eni_trusted_vni_entry, + _In_ sai_bulk_op_error_mode_t mode, + _Out_ sai_status_t *object_statuses); + +typedef struct _sai_dash_trusted_vni_api_t +{ + sai_create_global_trusted_vni_entry_fn create_global_trusted_vni_entry; + sai_remove_global_trusted_vni_entry_fn remove_global_trusted_vni_entry; + sai_set_global_trusted_vni_entry_attribute_fn set_global_trusted_vni_entry_attribute; + sai_get_global_trusted_vni_entry_attribute_fn get_global_trusted_vni_entry_attribute; + sai_bulk_create_global_trusted_vni_entry_fn create_global_trusted_vni_entries; + sai_bulk_remove_global_trusted_vni_entry_fn remove_global_trusted_vni_entries; + + sai_create_eni_trusted_vni_entry_fn create_eni_trusted_vni_entry; + sai_remove_eni_trusted_vni_entry_fn remove_eni_trusted_vni_entry; + sai_set_eni_trusted_vni_entry_attribute_fn set_eni_trusted_vni_entry_attribute; + sai_get_eni_trusted_vni_entry_attribute_fn get_eni_trusted_vni_entry_attribute; + sai_bulk_create_eni_trusted_vni_entry_fn create_eni_trusted_vni_entries; + sai_bulk_remove_eni_trusted_vni_entry_fn remove_eni_trusted_vni_entries; + +} sai_dash_trusted_vni_api_t; + +/** + * @} + */ +#endif /** __SAIEXPERIMENTALDASHTRUSTEDVNI_H_ */ diff --git a/experimental/saiextensions.h b/experimental/saiextensions.h index b48bc65a8..f43ee480a 100644 --- a/experimental/saiextensions.h +++ b/experimental/saiextensions.h @@ -34,6 +34,7 @@ #include "saiportextensions.h" /* new experimental object type includes */ +#include "saiexperimentaldashtrustedvni.h" #include "saiexperimentaldashoutboundportmap.h" #include "saiexperimentaldashappliance.h" #include "saiexperimentaldashflow.h" @@ -92,6 +93,8 @@ typedef enum _sai_api_extensions_t SAI_API_DASH_OUTBOUND_PORT_MAP, + SAI_API_DASH_TRUSTED_VNI, + /* Add new experimental APIs above this line */ SAI_API_EXTENSIONS_RANGE_END diff --git a/experimental/saitypesextensions.h b/experimental/saitypesextensions.h index 983d380b0..940b1af20 100644 --- a/experimental/saitypesextensions.h +++ b/experimental/saitypesextensions.h @@ -96,6 +96,10 @@ typedef enum _sai_object_type_extensions_t SAI_OBJECT_TYPE_OUTBOUND_PORT_MAP_PORT_RANGE_ENTRY, + SAI_OBJECT_TYPE_GLOBAL_TRUSTED_VNI_ENTRY, + + SAI_OBJECT_TYPE_ENI_TRUSTED_VNI_ENTRY, + /* Add new experimental object types above this line */ SAI_OBJECT_TYPE_EXTENSIONS_RANGE_END @@ -339,5 +343,16 @@ typedef enum _sai_dash_flow_sync_state_t } sai_dash_flow_sync_state_t; +/** + * @brief Defines a list of enums for dash_eni_mode + */ +typedef enum _sai_dash_eni_mode_t +{ + SAI_DASH_ENI_MODE_VM, + + SAI_DASH_ENI_MODE_FNIC, + +} sai_dash_eni_mode_t; + #endif /* __SAITYPESEXTENSIONS_H_ */ diff --git a/inc/saiobject.h b/inc/saiobject.h index ccbd9a9d5..84dd67018 100644 --- a/inc/saiobject.h +++ b/inc/saiobject.h @@ -38,6 +38,7 @@ #include /* new experimental object type includes */ +#include #include #include #include @@ -133,6 +134,12 @@ typedef union _sai_object_key_entry_t /** @validonly object_type == SAI_OBJECT_TYPE_OUTBOUND_PORT_MAP_PORT_RANGE_ENTRY */ sai_outbound_port_map_port_range_entry_t outbound_port_map_port_range_entry; + /** @validonly object_type == SAI_OBJECT_TYPE_GLOBAL_TRUSTED_VNI_ENTRY */ + sai_global_trusted_vni_entry_t global_trusted_vni_entry; + + /** @validonly object_type == SAI_OBJECT_TYPE_ENI_TRUSTED_VNI_ENTRY */ + sai_eni_trusted_vni_entry_t eni_trusted_vni_entry; + /* Add new experimental entries above this line */ } sai_object_key_entry_t;