diff --git a/doc/SAI-Proposal-6-MPLS-ver1.docx b/doc/MPLS/SAI-Proposal-MPLS-ver1.docx similarity index 100% rename from doc/SAI-Proposal-6-MPLS-ver1.docx rename to doc/MPLS/SAI-Proposal-MPLS-ver1.docx diff --git a/doc/MPLS/SAI-Proposal-MPLS-ver2.docx b/doc/MPLS/SAI-Proposal-MPLS-ver2.docx new file mode 100644 index 000000000..541d333a4 Binary files /dev/null and b/doc/MPLS/SAI-Proposal-MPLS-ver2.docx differ diff --git a/doc/TAM/SAI-Proposal-TAM-Microbursts-v0.2.docx b/doc/TAM/SAI-Proposal-TAM-Microbursts-v0.2.docx new file mode 100644 index 000000000..3bce88d40 Binary files /dev/null and b/doc/TAM/SAI-Proposal-TAM-Microbursts-v0.2.docx differ diff --git a/inc/sai.h b/inc/sai.h index 58c1f77dd..9d1945503 100644 --- a/inc/sai.h +++ b/inc/sai.h @@ -8,7 +8,7 @@ * 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, MERCHANTABLITY OR NON-INFRINGEMENT. + * 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. @@ -19,7 +19,7 @@ * * @file sai.h * - * @brief This module defines an entry point into Switch Abstraction Interfrace (SAI) + * @brief This module defines an entry point into Switch Abstraction Interface (SAI) */ #if !defined (__SAI_H_) @@ -71,13 +71,13 @@ /** * @brief Defined API sets have assigned ID's. * - * If specific api method table changes in any way (method signature, number of + * If specific API method table changes in any way (method signature, number of * methods), a new ID needs to be created (e.g. VLAN2) and old API still may * need to be supported for compatibility with older adapter hosts. */ typedef enum _sai_api_t { - SAI_API_UNSPECIFIED = 0, /**< unspecified api */ + SAI_API_UNSPECIFIED = 0, /**< unspecified API */ SAI_API_SWITCH = 1, /**< sai_switch_api_t */ SAI_API_PORT = 2, /**< sai_port_api_t */ SAI_API_FDB = 3, /**< sai_fdb_api_t */ @@ -128,7 +128,7 @@ typedef enum _sai_log_level_t /** Log Level Notice */ SAI_LOG_LEVEL_NOTICE = 2, - /** Log level Warnng */ + /** Log level Warning */ SAI_LOG_LEVEL_WARN = 3, /** Log Level Error */ @@ -185,7 +185,7 @@ sai_status_t sai_api_initialize( * @brief Retrieve a pointer to the C-style method table for desired SAI * functionality as specified by the given sai_api_id. * - * @param[in] sai_api_id SAI api ID + * @param[in] sai_api_id SAI API ID * @param[out] api_method_table Caller allocated method table The table must * remain valid until the sai_api_uninitialize() is called * @@ -196,7 +196,7 @@ sai_status_t sai_api_query( _Out_ void** api_method_table); /** - * @brief Uninitialization of the adapter module. SAI functionalities, + * @brief Uninitialize adapter module. SAI functionalities, * retrieved via sai_api_query() cannot be used after this call. * * @return #SAI_STATUS_SUCCESS on success Failure status code on error @@ -204,9 +204,9 @@ sai_status_t sai_api_query( sai_status_t sai_api_uninitialize(void); /** - * @brief Set log level for sai api module. The default log level is #SAI_LOG_LEVEL_WARN + * @brief Set log level for SAI API module. The default log level is #SAI_LOG_LEVEL_WARN * - * @param[in] sai_api_id SAI api ID + * @param[in] sai_api_id SAI API ID * @param[in] log_level Log level * * @return #SAI_STATUS_SUCCESS on success Failure status code on error @@ -216,25 +216,25 @@ sai_status_t sai_log_set( _In_ sai_log_level_t log_level); /** - * @brief Query sai object type. + * @brief Query SAI object type. * * @param[in] sai_object_id Object id * - * @return Return #SAI_OBJECT_TYPE_NULL when sai_object_id is not valid. - * Otherwise, return a valid sai object type SAI_OBJECT_TYPE_XXX + * @return #SAI_OBJECT_TYPE_NULL when sai_object_id is not valid. + * Otherwise, return a valid SAI object type SAI_OBJECT_TYPE_XXX */ sai_object_type_t sai_object_type_query( _In_ sai_object_id_t sai_object_id); /** - * @brief Query sai switch id. + * @brief Query SAI switch id. * * @param[in] sai_object_id Object id * - * @return Return #SAI_NULL_OBJECT_ID when sai_object_id is not valid. + * @return #SAI_NULL_OBJECT_ID when sai_object_id is not valid. * Otherwise, return a valid SAI_OBJECT_TYPE_SWITCH object on which * provided object id belongs. If valid switch id object is provided - * as input parameter it should returin itself. + * as input parameter it should return itself. */ sai_object_id_t sai_switch_id_query( _In_ sai_object_id_t sai_object_id); diff --git a/inc/saiacl.h b/inc/saiacl.h index e43405e2c..1c9c05be7 100644 --- a/inc/saiacl.h +++ b/inc/saiacl.h @@ -8,7 +8,7 @@ * 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, MERCHANTABLITY OR NON-INFRINGEMENT. + * 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. @@ -79,7 +79,7 @@ typedef enum _sai_acl_ip_type_t /** IPv4 and IPv6 packets */ SAI_ACL_IP_TYPE_IP, - /** Non-Ip packet */ + /** Non-IP packet */ SAI_ACL_IP_TYPE_NON_IP, /** Any IPv4 packet */ @@ -153,7 +153,7 @@ typedef enum _sai_acl_action_type_t /** Egress Mirror */ SAI_ACL_ACTION_TYPE_MIRROR_EGRESS, - /** Assosiate with policer (policer id) */ + /** Associate with policer (policer id) */ SAI_ACL_ACTION_TYPE_SET_POLICER, /** Decrement TTL */ @@ -165,16 +165,16 @@ typedef enum _sai_acl_action_type_t /** Set Packet Color */ SAI_ACL_ACTION_TYPE_SET_PACKET_COLOR, - /** Set Packet Inner Vlan-Id */ + /** Set Packet Inner Vlan Id */ SAI_ACL_ACTION_TYPE_SET_INNER_VLAN_ID, - /** Set Packet Inner Vlan-Priority */ + /** Set Packet Inner Vlan Priority */ SAI_ACL_ACTION_TYPE_SET_INNER_VLAN_PRI, - /** Set Packet Outer Vlan-Id */ + /** Set Packet Outer Vlan Id */ SAI_ACL_ACTION_TYPE_SET_OUTER_VLAN_ID, - /** Set Packet Outer Vlan-Priority */ + /** Set Packet Outer Vlan Priority */ SAI_ACL_ACTION_TYPE_SET_OUTER_VLAN_PRI, /** Set Packet Src MAC Address */ @@ -225,7 +225,7 @@ typedef enum _sai_acl_action_type_t /** Set user defined trap id */ SAI_ACL_ACTION_TYPE_SET_USER_TRAP_ID, - /** Set Do Not Learn unknow source MAC */ + /** Set Do Not Learn unknown source MAC */ SAI_ACL_ACTION_TYPE_SET_DO_NOT_LEARN, } sai_acl_action_type_t; @@ -266,9 +266,9 @@ typedef enum _sai_acl_table_group_attr_t * * ACL group bind point list - is a create only attribute required for ACL * groups to let the user specify his intention to allow further error - * checks and optimizations based on a specific ASIC's SAI implementation. + * checks and optimizations based on a specific ASIC SAI implementation. * ACL members being added to this group SHOULD be a subset of the bind - * point list that acl group was created with. + * point list that ACL group was created with. * * @type sai_s32_list_t sai_acl_bind_point_type_t * @flags CREATE_ONLY @@ -282,8 +282,8 @@ typedef enum _sai_acl_table_group_attr_t * ACL table group type represents the way various ACL tables within this * ACL table group perform their lookups. There are two optional values : * Sequential - All the ACL tables are looked up in a sequential order , - * which is based on the ACL table priorities and only one acl entry is matched - * with its corresponding acl entry action applied. In case two ACL tables + * which is based on the ACL table priorities and only one ACL entry is matched + * with its corresponding ACL entry action applied. In case two ACL tables * have the same priority they are looked up on a first come basis. * Parallel - All the ACL tables within the ACL table groups are looked up * in parallel and non-conflicting actions are resolved and applied from @@ -326,9 +326,9 @@ typedef enum _sai_acl_table_group_member_attr_t * @brief ACL table group id * * This attribute is required to associate or attach a member object (acl_table_id) - * to a acl table group id allocated by the create acl group api. + * to a ACL table group id allocated by the create ACL group API. * - * User should always use the group id returned by SAI create_acl_group api, + * User should always use the group id returned by SAI create_acl_group API, * to group the tables else Invalid attribute value error code will be returned. * * The ACL Table lookup could be done serially or in parallel. In both the @@ -417,7 +417,7 @@ typedef enum _sai_acl_table_attr_t * @brief Table size * * (default = 0) - Grow dynamically till MAX ACL TCAM Size - * By default table can grow upto maximum ACL TCAM space. + * By default table can grow up to maximum ACL TCAM space. * Supported only during Table Create for now until NPU * supports Dynamic adjustment of Table size post Table creation * @@ -604,7 +604,7 @@ typedef enum _sai_acl_table_attr_t SAI_ACL_TABLE_ATTR_FIELD_SRC_PORT, /** - * @brief Outer Vlan-Id + * @brief Outer Vlan Id * * @type bool * @flags CREATE_ONLY @@ -613,7 +613,7 @@ typedef enum _sai_acl_table_attr_t SAI_ACL_TABLE_ATTR_FIELD_OUTER_VLAN_ID, /** - * @brief Outer Vlan-Priority + * @brief Outer Vlan Priority * * @type bool * @flags CREATE_ONLY @@ -622,7 +622,7 @@ typedef enum _sai_acl_table_attr_t SAI_ACL_TABLE_ATTR_FIELD_OUTER_VLAN_PRI, /** - * @brief Outer Vlan-CFI + * @brief Outer Vlan CFI * * @type bool * @flags CREATE_ONLY @@ -631,7 +631,7 @@ typedef enum _sai_acl_table_attr_t SAI_ACL_TABLE_ATTR_FIELD_OUTER_VLAN_CFI, /** - * @brief Inner Vlan-Id + * @brief Inner Vlan Id * * @type bool * @flags CREATE_ONLY @@ -640,7 +640,7 @@ typedef enum _sai_acl_table_attr_t SAI_ACL_TABLE_ATTR_FIELD_INNER_VLAN_ID, /** - * @brief Inner Vlan-Priority + * @brief Inner Vlan Priority * * @type bool * @flags CREATE_ONLY @@ -649,7 +649,7 @@ typedef enum _sai_acl_table_attr_t SAI_ACL_TABLE_ATTR_FIELD_INNER_VLAN_PRI, /** - * @brief Inner Vlan-CFI + * @brief Inner Vlan CFI * * @type bool * @flags CREATE_ONLY @@ -703,7 +703,7 @@ typedef enum _sai_acl_table_attr_t SAI_ACL_TABLE_ATTR_FIELD_IP_IDENTIFICATION, /** - * @brief Ip Dscp + * @brief IP DSCP * * @type bool * @flags CREATE_ONLY @@ -712,7 +712,7 @@ typedef enum _sai_acl_table_attr_t SAI_ACL_TABLE_ATTR_FIELD_DSCP, /** - * @brief Ip Ecn + * @brief IP ECN * * @type bool * @flags CREATE_ONLY @@ -721,7 +721,7 @@ typedef enum _sai_acl_table_attr_t SAI_ACL_TABLE_ATTR_FIELD_ECN, /** - * @brief Ip Ttl + * @brief IP TTL * * @type bool * @flags CREATE_ONLY @@ -730,7 +730,7 @@ typedef enum _sai_acl_table_attr_t SAI_ACL_TABLE_ATTR_FIELD_TTL, /** - * @brief Ip Tos + * @brief IP TOS * * @type bool * @flags CREATE_ONLY @@ -739,7 +739,7 @@ typedef enum _sai_acl_table_attr_t SAI_ACL_TABLE_ATTR_FIELD_TOS, /** - * @brief Ip Flags + * @brief IP Flags * * @type bool * @flags CREATE_ONLY @@ -748,7 +748,7 @@ typedef enum _sai_acl_table_attr_t SAI_ACL_TABLE_ATTR_FIELD_IP_FLAGS, /** - * @brief Tcp Flags + * @brief TCP Flags * * @type bool * @flags CREATE_ONLY @@ -757,7 +757,7 @@ typedef enum _sai_acl_table_attr_t SAI_ACL_TABLE_ATTR_FIELD_TCP_FLAGS, /** - * @brief Ip Type + * @brief IP Type * * @type bool * @flags CREATE_ONLY @@ -766,7 +766,7 @@ typedef enum _sai_acl_table_attr_t SAI_ACL_TABLE_ATTR_FIELD_ACL_IP_TYPE, /** - * @brief Ip Frag + * @brief IP Frag * * @type bool * @flags CREATE_ONLY @@ -1003,8 +1003,8 @@ typedef enum _sai_acl_entry_attr_t /* * Match fields [sai_acl_field_data_t] * - Mandatory to pass at least one field during ACL Rule creation. - * - Unless noted specificially, both data and mask are required. - * - When bit field is used, only those least significent bits are valid for + * - Unless noted specifically, both data and mask are required. + * - When bit field is used, only those least significant bits are valid for * matching. */ @@ -1130,7 +1130,7 @@ typedef enum _sai_acl_entry_attr_t SAI_ACL_ENTRY_ATTR_FIELD_OUT_PORT, /** - * @brief Source port which could be a physical or lag port + * @brief Source port which could be a physical or LAG port * (mask is not needed) * * @type sai_acl_field_data_t sai_object_id_t @@ -1140,7 +1140,7 @@ typedef enum _sai_acl_entry_attr_t SAI_ACL_ENTRY_ATTR_FIELD_SRC_PORT, /** - * @brief Outer Vlan-Id (12 bits) + * @brief Outer Vlan Id (12 bits) * * @type sai_acl_field_data_t sai_uint16_t * @flags CREATE_AND_SET @@ -1149,7 +1149,7 @@ typedef enum _sai_acl_entry_attr_t SAI_ACL_ENTRY_ATTR_FIELD_OUTER_VLAN_ID, /** - * @brief Outer Vlan-Priority (3 bits) + * @brief Outer Vlan Priority (3 bits) * * @type sai_acl_field_data_t sai_uint8_t * @flags CREATE_AND_SET @@ -1157,7 +1157,7 @@ typedef enum _sai_acl_entry_attr_t SAI_ACL_ENTRY_ATTR_FIELD_OUTER_VLAN_PRI, /** - * @brief Outer Vlan-CFI (1 bit) + * @brief Outer Vlan CFI (1 bit) * * @type sai_acl_field_data_t sai_uint8_t * @flags CREATE_AND_SET @@ -1165,7 +1165,7 @@ typedef enum _sai_acl_entry_attr_t SAI_ACL_ENTRY_ATTR_FIELD_OUTER_VLAN_CFI, /** - * @brief Inner Vlan-Id (12 bits) + * @brief Inner Vlan Id (12 bits) * * @type sai_acl_field_data_t sai_uint16_t * @flags CREATE_AND_SET @@ -1174,7 +1174,7 @@ typedef enum _sai_acl_entry_attr_t SAI_ACL_ENTRY_ATTR_FIELD_INNER_VLAN_ID, /** - * @brief Inner Vlan-Priority (3 bits) + * @brief Inner Vlan Priority (3 bits) * * @type sai_acl_field_data_t sai_uint8_t * @flags CREATE_AND_SET @@ -1182,7 +1182,7 @@ typedef enum _sai_acl_entry_attr_t SAI_ACL_ENTRY_ATTR_FIELD_INNER_VLAN_PRI, /** - * @brief Inner Vlan-CFI (1 bit) + * @brief Inner Vlan CFI (1 bit) * * @type sai_acl_field_data_t sai_uint8_t * @flags CREATE_AND_SET @@ -1234,7 +1234,7 @@ typedef enum _sai_acl_entry_attr_t SAI_ACL_ENTRY_ATTR_FIELD_IP_IDENTIFICATION, /** - * @brief Ip Dscp (6 bits) + * @brief IP DSCP (6 bits) * * @type sai_acl_field_data_t sai_uint8_t * @flags CREATE_AND_SET @@ -1242,7 +1242,7 @@ typedef enum _sai_acl_entry_attr_t SAI_ACL_ENTRY_ATTR_FIELD_DSCP, /** - * @brief Ip Ecn (2 bits) + * @brief IP ECN (2 bits) * * @type sai_acl_field_data_t sai_uint8_t * @flags CREATE_AND_SET @@ -1250,7 +1250,7 @@ typedef enum _sai_acl_entry_attr_t SAI_ACL_ENTRY_ATTR_FIELD_ECN, /** - * @brief Ip Ttl + * @brief IP TTL * * @type sai_acl_field_data_t sai_uint8_t * @flags CREATE_AND_SET @@ -1258,7 +1258,7 @@ typedef enum _sai_acl_entry_attr_t SAI_ACL_ENTRY_ATTR_FIELD_TTL, /** - * @brief Ip Tos + * @brief IP TOS * * @type sai_acl_field_data_t sai_uint8_t * @flags CREATE_AND_SET @@ -1266,7 +1266,7 @@ typedef enum _sai_acl_entry_attr_t SAI_ACL_ENTRY_ATTR_FIELD_TOS, /** - * @brief Ip Flags (3 bits) + * @brief IP Flags (3 bits) * * @type sai_acl_field_data_t sai_uint8_t * @flags CREATE_AND_SET @@ -1274,7 +1274,7 @@ typedef enum _sai_acl_entry_attr_t SAI_ACL_ENTRY_ATTR_FIELD_IP_FLAGS, /** - * @brief Tcp Flags (6 bits) + * @brief TCP Flags (6 bits) * * @type sai_acl_field_data_t sai_uint8_t * @flags CREATE_AND_SET @@ -1282,7 +1282,7 @@ typedef enum _sai_acl_entry_attr_t SAI_ACL_ENTRY_ATTR_FIELD_TCP_FLAGS, /** - * @brief Ip Type (field mask is not needed) + * @brief IP Type (field mask is not needed) * * @type sai_acl_field_data_t sai_acl_ip_type_t * @flags CREATE_AND_SET @@ -1290,7 +1290,7 @@ typedef enum _sai_acl_entry_attr_t SAI_ACL_ENTRY_ATTR_FIELD_ACL_IP_TYPE, /** - * @brief Ip Frag (field mask is not needed) + * @brief IP Frag (field mask is not needed) * * @type sai_acl_field_data_t sai_acl_ip_frag_t * @flags CREATE_AND_SET @@ -1398,7 +1398,7 @@ typedef enum _sai_acl_entry_attr_t * @brief Meta Data carried from previous ACL Stage. * * When an ACL entry set the meta data, the ACL meta data - * form previous stages are overriden. + * form previous stages are overridden. * Value must be in the range defined in * #SAI_SWITCH_ATTR_ACL_USER_META_DATA_RANGE * @@ -1485,7 +1485,7 @@ typedef enum _sai_acl_entry_attr_t /** * @brief Redirect Packet to a destination which can be a port, - * lag, nexthop, nexthopgroup + * LAG, nexthop, nexthopgroup * * @type sai_acl_action_data_t sai_object_id_t * @flags CREATE_AND_SET @@ -1497,7 +1497,7 @@ typedef enum _sai_acl_entry_attr_t * @brief Redirect Packet to a list of destination which can be * a port list. * - * @type sai_acl_action_data_t sai_object_id_t + * @type sai_acl_action_data_t sai_object_list_t * @flags CREATE_AND_SET * @objects SAI_OBJECT_TYPE_PORT, SAI_OBJECT_TYPE_LAG, SAI_OBJECT_TYPE_NEXT_HOP, SAI_OBJECT_TYPE_NEXT_HOP_GROUP */ @@ -1547,7 +1547,7 @@ typedef enum _sai_acl_entry_attr_t SAI_ACL_ENTRY_ATTR_ACTION_MIRROR_EGRESS, /** - * @brief Assosiate with policer (policer id) + * @brief Associate with policer (policer id) * * @type sai_acl_action_data_t sai_object_id_t * @flags CREATE_AND_SET @@ -1580,7 +1580,7 @@ typedef enum _sai_acl_entry_attr_t SAI_ACL_ENTRY_ATTR_ACTION_SET_PACKET_COLOR, /** - * @brief Set Packet Inner Vlan-Id (12 bits) + * @brief Set Packet Inner Vlan Id (12 bits) * * @type sai_acl_action_data_t sai_uint32_t * @flags CREATE_AND_SET @@ -1588,7 +1588,7 @@ typedef enum _sai_acl_entry_attr_t SAI_ACL_ENTRY_ATTR_ACTION_SET_INNER_VLAN_ID, /** - * @brief Set Packet Inner Vlan-Priority (3 bits) + * @brief Set Packet Inner Vlan Priority (3 bits) * * @type sai_acl_action_data_t sai_uint8_t * @flags CREATE_AND_SET @@ -1596,7 +1596,7 @@ typedef enum _sai_acl_entry_attr_t SAI_ACL_ENTRY_ATTR_ACTION_SET_INNER_VLAN_PRI, /** - * @brief Set Packet Outer Vlan-Id (12 bits) + * @brief Set Packet Outer Vlan Id (12 bits) * * @type sai_acl_action_data_t sai_uint16_t * @flags CREATE_AND_SET @@ -1605,7 +1605,7 @@ typedef enum _sai_acl_entry_attr_t SAI_ACL_ENTRY_ATTR_ACTION_SET_OUTER_VLAN_ID, /** - * @brief Set Packet Outer Vlan-Priority (3 bits) + * @brief Set Packet Outer Vlan Priority (3 bits) * * @type sai_acl_action_data_t sai_uint8_t * @flags CREATE_AND_SET @@ -1695,7 +1695,7 @@ typedef enum _sai_acl_entry_attr_t SAI_ACL_ENTRY_ATTR_ACTION_SET_L4_DST_PORT, /** - * @brief Set ingress packet sampling (samplepacket session id) + * @brief Set ingress packet sampling (sample packet session id) * * @type sai_acl_action_data_t sai_object_id_t * @flags CREATE_AND_SET @@ -1704,7 +1704,7 @@ typedef enum _sai_acl_entry_attr_t SAI_ACL_ENTRY_ATTR_ACTION_INGRESS_SAMPLEPACKET_ENABLE, /** - * @brief Set egress packet sampling (samplepacket session id) + * @brief Set egress packet sampling (sample packet session id) * * @type sai_acl_action_data_t sai_object_id_t * @flags CREATE_AND_SET @@ -1760,7 +1760,7 @@ typedef enum _sai_acl_entry_attr_t SAI_ACL_ENTRY_ATTR_ACTION_SET_USER_TRAP_ID, /** - * @brief Do Not Learn unknown source MAC on match(enable/disbale) (parameter is not needed) + * @brief Do Not Learn unknown source MAC on match(enable/disable) (parameter is not needed) * * @type sai_acl_action_data_t sai_uint32_t * @flags CREATE_AND_SET @@ -1778,6 +1778,12 @@ typedef enum _sai_acl_entry_attr_t */ SAI_ACL_ENTRY_ATTR_END, + /** Custom range base value */ + SAI_ACL_ENTRY_ATTR_CUSTOM_RANGE_START = 0x10000000, + + /** End of custom range base */ + SAI_ACL_ENTRY_ATTR_CUSTOM_RANGE_END + } sai_acl_entry_attr_t; /** @@ -1848,6 +1854,12 @@ typedef enum _sai_acl_counter_attr_t */ SAI_ACL_COUNTER_ATTR_END, + /** Custom range base value */ + SAI_ACL_COUNTER_ATTR_CUSTOM_RANGE_START = 0x10000000, + + /** End of custom range base */ + SAI_ACL_COUNTER_ATTR_CUSTOM_RANGE_END + } sai_acl_counter_attr_t; /** @@ -1910,13 +1922,19 @@ typedef enum _sai_acl_range_attr_t */ SAI_ACL_RANGE_ATTR_END, + /** Custom range base value */ + SAI_ACL_RANGE_ATTR_CUSTOM_RANGE_START = 0x10000000, + + /** End of custom range base */ + SAI_ACL_RANGE_ATTR_CUSTOM_RANGE_END + } sai_acl_range_attr_t; /** * @brief Create an ACL table * * @param[out] acl_table_id The the ACL table id - * @param[in] attr_count number of attributes + * @param[in] attr_count Number of attributes * @param[in] switch_id Switch Object id * @param[in] attr_list Array of attributes * @@ -2123,7 +2141,7 @@ typedef sai_status_t (*sai_get_acl_range_attribute_fn)( * @brief Create an ACL Table Group * * @param[out] acl_table_group_id The ACL group id - * @param[in] attr_count number of attributes + * @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 @@ -2174,7 +2192,7 @@ typedef sai_status_t (*sai_get_acl_table_group_attribute_fn)( * @brief Create an ACL Table Group Member * * @param[out] acl_table_group_member_id The ACL table group member id - * @param[in] attr_count number of attributes + * @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 diff --git a/inc/saibridge.h b/inc/saibridge.h index d8ea29a7b..0df49e1fd 100644 --- a/inc/saibridge.h +++ b/inc/saibridge.h @@ -8,7 +8,7 @@ * 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, MERCHANTABLITY OR NON-INFRINGEMENT. + * 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. @@ -70,10 +70,10 @@ typedef enum _sai_bridge_port_fdb_learning_mode_t */ typedef enum _sai_bridge_port_type_t { - /** Port or Lag */ + /** Port or LAG */ SAI_BRIDGE_PORT_TYPE_PORT, - /** {Port or Lag.vlan} */ + /** {Port or LAG.vlan} */ SAI_BRIDGE_PORT_TYPE_SUB_PORT, /** bridge router port */ @@ -106,7 +106,7 @@ typedef enum _sai_bridge_port_attr_t SAI_BRIDGE_PORT_ATTR_TYPE = SAI_BRIDGE_PORT_ATTR_START, /** - * @brief Associated Port or Lag object id + * @brief Associated Port or LAG object id * * @type sai_object_id_t * @flags MANDATORY_ON_CREATE | CREATE_ONLY @@ -126,7 +126,7 @@ typedef enum _sai_bridge_port_attr_t SAI_BRIDGE_PORT_ATTR_VLAN_ID, /** - * @brief Associated router inerface object id + * @brief Associated router interface object id * * Please note that for SAI_BRIDGE_PORT_TYPE_1Q_ROUTER, * all vlan interfaces are auto bounded for the bridge port. @@ -177,7 +177,7 @@ typedef enum _sai_bridge_port_attr_t SAI_BRIDGE_PORT_ATTR_MAX_LEARNED_ADDRESSES, /** - * @brief Action for packets with unknown source mac address + * @brief Action for packets with unknown source MAC address * when FDB learning limit is reached. * * @type sai_packet_action_t @@ -204,8 +204,8 @@ typedef enum _sai_bridge_port_attr_t * * @param[out] bridge_port_id Bridge port ID * @param[in] switch_id Switch object id - * @param[in] attr_count number of attributes - * @param[in] attr_list array of attributes + * @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 */ @@ -229,7 +229,7 @@ typedef sai_status_t(*sai_remove_bridge_port_fn) ( * @brief Set attribute for bridge port * * @param[in] bridge_port_id Bridge port ID - * @param[in] attr attribute to set + * @param[in] attr Attribute to set * * @return #SAI_STATUS_SUCCESS on success Failure status code on error */ @@ -241,8 +241,8 @@ typedef sai_status_t(*sai_set_bridge_port_attribute_fn)( * @brief Get attributes of bridge port * * @param[in] bridge_port_id Bridge port ID - * @param[in] attr_count number of attributes - * @param[inout] attr_list array of attributes + * @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 */ @@ -329,8 +329,8 @@ typedef enum _sai_bridge_attr_t * * @param[out] bridge_id Bridge ID * @param[in] switch_id Switch object id - * @param[in] attr_count number of attributes - * @param[in] attr_list array of attributes + * @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 */ @@ -354,7 +354,7 @@ typedef sai_status_t(*sai_remove_bridge_fn) ( * @brief Set attribute for bridge * * @param[in] bridge_id Bridge ID - * @param[in] attr attribute to set + * @param[in] attr Attribute to set * * @return #SAI_STATUS_SUCCESS on success Failure status code on error */ @@ -366,8 +366,8 @@ typedef sai_status_t(*sai_set_bridge_attribute_fn)( * @brief Get attributes of bridge * * @param[in] bridge_id Bridge ID - * @param[in] attr_count number of attributes - * @param[inout] attr_list array of attributes + * @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 */ @@ -377,7 +377,7 @@ typedef sai_status_t(*sai_get_bridge_attribute_fn)( _Inout_ sai_attribute_t *attr_list); /** - * @brief bridge methods table retrieved with sai_api_query() + * @brief Bridge methods table retrieved with sai_api_query() */ typedef struct _sai_bridge_api_t { diff --git a/inc/saibuffer.h b/inc/saibuffer.h index 0158d3835..b58910780 100644 --- a/inc/saibuffer.h +++ b/inc/saibuffer.h @@ -8,7 +8,7 @@ * 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, MERCHANTABLITY OR NON-INFRINGEMENT. + * 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. @@ -56,10 +56,33 @@ typedef enum _sai_ingress_priority_group_attr_t */ SAI_INGRESS_PRIORITY_GROUP_ATTR_BUFFER_PROFILE = SAI_INGRESS_PRIORITY_GROUP_ATTR_START, + /** + * @brief Port id + * + * @type sai_object_id_t + * @flags MANDATORY_ON_CREATE | CREATE_ONLY | KEY + * @objects SAI_OBJECT_TYPE_PORT + */ + SAI_INGRESS_PRIORITY_GROUP_ATTR_PORT, + + /** + * @brief PG index + * + * @type sai_uint8_t + * @flags MANDATORY_ON_CREATE | CREATE_ONLY | KEY + */ + SAI_INGRESS_PRIORITY_GROUP_ATTR_INDEX, + /** * @brief End of attributes */ - SAI_INGRESS_PRIORITY_GROUP_ATTR_END + SAI_INGRESS_PRIORITY_GROUP_ATTR_END, + + /** Custom range base value */ + SAI_INGRESS_PRIORITY_GROUP_ATTR_CUSTOM_RANGE_START = 0x10000000, + + /** End of custom range base */ + SAI_INGRESS_PRIORITY_GROUP_ATTR_CUSTOM_RANGE_END } sai_ingress_priority_group_attr_t; @@ -86,10 +109,10 @@ typedef enum _sai_ingress_priority_group_stat_t /** get watermark pg shared occupancy in bytes [uint64_t] */ SAI_INGRESS_PRIORITY_GROUP_STAT_SHARED_WATERMARK_BYTES = 0x00000005, - /** get current pg xoff room occupancy in bytes [uint64_t] */ + /** get current pg XOFF room occupancy in bytes [uint64_t] */ SAI_INGRESS_PRIORITY_GROUP_STAT_XOFF_ROOM_CURR_OCCUPANCY_BYTES = 0x00000006, - /** get watermark pg xoff room occupancy in bytes [uint64_t] */ + /** get watermark pg XOFF room occupancy in bytes [uint64_t] */ SAI_INGRESS_PRIORITY_GROUP_STAT_XOFF_ROOM_WATERMARK_BYTES = 0x00000007, /** get dropped packets count [uint64_t] */ @@ -156,16 +179,16 @@ typedef sai_status_t(*sai_get_ingress_priority_group_attribute_fn)( * @brief Get ingress priority group statistics counters. * * @param[in] ingress_pg_id Ingress priority group id - * @param[in] counter_ids Specifies the array of counter ids * @param[in] number_of_counters Number of counters in the array + * @param[in] counter_ids Specifies the array of counter ids * @param[out] counters Array of resulting counter values. * * @return #SAI_STATUS_SUCCESS on success Failure status code on error */ typedef sai_status_t(*sai_get_ingress_priority_group_stats_fn)( _In_ sai_object_id_t ingress_pg_id, - _In_ const sai_ingress_priority_group_stat_t *counter_ids, _In_ uint32_t number_of_counters, + _In_ const sai_ingress_priority_group_stat_t *counter_ids, _Out_ uint64_t* counters); /** @@ -221,7 +244,7 @@ typedef enum _sai_buffer_pool_attr_t /** * @brief Shared buffer size in bytes * - * This is derived from substracting all reversed buffers of queue/port + * This is derived from subtracting all reversed buffers of queue/port * from the total pool size. * * @type sai_uint32_t @@ -238,7 +261,7 @@ typedef enum _sai_buffer_pool_attr_t SAI_BUFFER_POOL_ATTR_TYPE, /** - * @brief buffer pool size in bytes + * @brief Buffer pool size in bytes * * @type sai_uint32_t * @flags MANDATORY_ON_CREATE | CREATE_AND_SET @@ -246,7 +269,7 @@ typedef enum _sai_buffer_pool_attr_t SAI_BUFFER_POOL_ATTR_SIZE, /** - * @brief shared threshold mode for the buffer + * @brief Shared threshold mode for the buffer * * @type sai_buffer_pool_threshold_mode_t * @flags CREATE_ONLY @@ -255,7 +278,7 @@ typedef enum _sai_buffer_pool_attr_t SAI_BUFFER_POOL_ATTR_THRESHOLD_MODE, /** - * @brief shared headroom pool size in bytes for lossless traffic + * @brief Shared headroom pool size in bytes for lossless traffic * * Only valid for the ingress buffer pool * @@ -270,6 +293,12 @@ typedef enum _sai_buffer_pool_attr_t */ SAI_BUFFER_POOL_ATTR_END, + /** Custom range base value */ + SAI_BUFFER_POOL_ATTR_CUSTOM_RANGE_START = 0x10000000, + + /** End of custom range base */ + SAI_BUFFER_POOL_ATTR_CUSTOM_RANGE_END + } sai_buffer_pool_attr_t; /** @@ -283,7 +312,7 @@ typedef enum _sai_buffer_pool_stat_t /** get watermark pool occupancy in bytes [uint64_t] */ SAI_BUFFER_POOL_STAT_WATERMARK_BYTES = 0x00000001, - /** get count of packest dropped in this pool [uint64_t] */ + /** get count of packets dropped in this pool [uint64_t] */ SAI_BUFFER_POOL_STAT_DROPPED_PACKETS = 0x00000002, /** Custom range base value */ @@ -347,16 +376,16 @@ typedef sai_status_t(*sai_get_buffer_pool_attribute_fn)( * @brief Get buffer pool statistics counters. * * @param[in] pool_id Buffer pool id - * @param[in] counter_ids Specifies the array of counter ids * @param[in] number_of_counters Number of counters in the array + * @param[in] counter_ids Specifies the array of counter ids * @param[out] counters Array of resulting counter values. * * @return #SAI_STATUS_SUCCESS on success Failure status code on error */ typedef sai_status_t(*sai_get_buffer_pool_stats_fn)( _In_ sai_object_id_t pool_id, - _In_ const sai_buffer_pool_stat_t *counter_ids, _In_ uint32_t number_of_counters, + _In_ const sai_buffer_pool_stat_t *counter_ids, _Out_ uint64_t* counters); /** @@ -511,6 +540,12 @@ typedef enum _sai_buffer_profile_attr_t */ SAI_BUFFER_PROFILE_ATTR_END, + /** Custom range base value */ + SAI_BUFFER_PROFILE_ATTR_CUSTOM_RANGE_START = 0x10000000, + + /** End of custom range base */ + SAI_BUFFER_PROFILE_ATTR_CUSTOM_RANGE_END + } sai_buffer_profile_attr_t; /** @@ -566,7 +601,7 @@ typedef sai_status_t(*sai_get_buffer_profile_attribute_fn)( _Inout_ sai_attribute_t *attr_list); /** - * @brief buffer methods table retrieved with sai_api_query() + * @brief Buffer methods table retrieved with sai_api_query() */ typedef struct _sai_buffer_api_t { diff --git a/inc/saifdb.h b/inc/saifdb.h index 9a5c681ed..88c31b655 100644 --- a/inc/saifdb.h +++ b/inc/saifdb.h @@ -8,7 +8,7 @@ * 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, MERCHANTABLITY OR NON-INFRINGEMENT. + * 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. @@ -58,7 +58,7 @@ typedef struct _sai_fdb_entry_t */ sai_object_id_t switch_id; - /** Mac address */ + /** MAC address */ sai_mac_t mac_address; /** Bridge type */ @@ -90,13 +90,13 @@ typedef enum _sai_fdb_event_t /** FDB entry move */ SAI_FDB_EVENT_MOVE, - /** FDB entry flushd */ + /** FDB entry flushed */ SAI_FDB_EVENT_FLUSHED, } sai_fdb_event_t; /** - * @brief Attribute Id for fdb entry + * @brief Attribute Id for FDB entry */ typedef enum _sai_fdb_entry_attr_t { @@ -191,8 +191,8 @@ typedef enum _sai_fdb_flush_entry_type_t * = #SAI_FDB_FLUSH_ENTRY_TYPE_STATIC. If you want to flush both static and dynamic entries, * then there is no need to specify the #SAI_FDB_FLUSH_ATTR_ENTRY_TYPE attribute. * The API uses AND operation when multiple attributes are specified. For - * exmaple, - * 1) Flush all entries in fdb table - Do not specify any attribute + * example, + * 1) Flush all entries in FDB table - Do not specify any attribute * 2) Flush all entries by bridge port - Set #SAI_FDB_FLUSH_ATTR_BRIDGE_PORT_ID * 3) Flush all entries by VLAN - Set #SAI_FDB_FLUSH_ATTR_VLAN_ID * 4) Flush all entries by bridge port and VLAN - Set #SAI_FDB_FLUSH_ATTR_BRIDGE_PORT_ID @@ -242,6 +242,12 @@ typedef enum _sai_fdb_flush_attr_t */ SAI_FDB_FLUSH_ATTR_END, + /** Custom range base value */ + SAI_FDB_FLUSH_ATTR_CUSTOM_RANGE_START = 0x10000000, + + /** End of custom range base */ + SAI_FDB_FLUSH_ATTR_CUSTOM_RANGE_END + } sai_fdb_flush_attr_t; /** @@ -288,7 +294,7 @@ typedef sai_status_t (*sai_remove_fdb_entry_fn)( _In_ const sai_fdb_entry_t *fdb_entry); /** - * @brief Set fdb entry attribute value + * @brief Set FDB entry attribute value * * @param[in] fdb_entry FDB entry * @param[in] attr Attribute @@ -300,7 +306,7 @@ typedef sai_status_t (*sai_set_fdb_entry_attribute_fn)( _In_ const sai_attribute_t *attr); /** - * @brief Get fdb entry attribute value + * @brief Get FDB entry attribute value * * @param[in] fdb_entry FDB entry * @param[in] attr_count Number of attributes @@ -331,7 +337,7 @@ typedef sai_status_t (*sai_flush_fdb_entries_fn)( * @brief FDB notifications * * @param[in] count Number of notifications - * @param[in] data Pointer to fdb event notification data array + * @param[in] data Pointer to FDB event notification data array */ typedef void (*sai_fdb_event_notification_fn)( _In_ uint32_t count, diff --git a/inc/saihash.h b/inc/saihash.h index 67f8eb21c..80537fd3c 100644 --- a/inc/saihash.h +++ b/inc/saihash.h @@ -8,7 +8,7 @@ * 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, MERCHANTABLITY OR NON-INFRINGEMENT. + * 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. @@ -34,7 +34,7 @@ */ /** - * @brief Attribute data for sai native hash fields + * @brief Attribute data for SAI native hash fields */ typedef enum _sai_native_hash_field_t { @@ -64,7 +64,7 @@ typedef enum _sai_native_hash_field_t /** Native hash field IP protocol */ SAI_NATIVE_HASH_FIELD_IP_PROTOCOL = 5, - /** Native hash field ethernet type */ + /** Native hash field Ethernet type */ SAI_NATIVE_HASH_FIELD_ETHERTYPE = 6, /** Native hash field L4 source port */ @@ -118,10 +118,16 @@ typedef enum _sai_hash_attr_t */ SAI_HASH_ATTR_END, + /** Custom range base value */ + SAI_HASH_ATTR_CUSTOM_RANGE_START = 0x10000000, + + /** End of custom range base */ + SAI_HASH_ATTR_CUSTOM_RANGE_END + } sai_hash_attr_t; /** - *@brief Create hash + * @brief Create hash * * @param[out] hash_id Hash id * @param[in] switch_id Switch object id @@ -163,7 +169,7 @@ typedef sai_status_t (*sai_set_hash_attribute_fn)( * * @param[in] hash_id Hash id * @param[in] attr_count Number of attributes - * @param[inout] attrs Aarray of attributes + * @param[inout] attr_list Array of attributes * * @return #SAI_STATUS_SUCCESS on success Failure status code on error */ @@ -173,7 +179,7 @@ typedef sai_status_t (*sai_get_hash_attribute_fn)( _Inout_ sai_attribute_t *attr_list); /** - * @brief hash methods, retrieved via sai_api_query() + * @brief Hash methods, retrieved via sai_api_query() */ typedef struct _sai_hash_api_t { diff --git a/inc/saihostif.h b/inc/saihostif.h index 1f4f636f2..0da3c244c 100644 --- a/inc/saihostif.h +++ b/inc/saihostif.h @@ -8,7 +8,7 @@ * 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, MERCHANTABLITY OR NON-INFRINGEMENT. + * 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. @@ -23,8 +23,8 @@ * * @par Abstract * - * This module defines SAI Host Interface which is responsbile for - * creating/deleting linux netdev corresponding to the host interface type. + * This module defines SAI Host Interface which is responsible for + * creating/deleting Linux netdev corresponding to the host interface type. * All the management operations of the netdevs such as changing IP address * are outside the scope of SAI. * @@ -66,7 +66,7 @@ typedef enum _sai_hostif_trap_group_attr_t SAI_HOSTIF_TRAP_GROUP_ATTR_ADMIN_STATE = SAI_HOSTIF_TRAP_GROUP_ATTR_START, /** - * @brief Cpu egress queue + * @brief CPU egress queue * * @type sai_uint32_t * @flags CREATE_AND_SET @@ -75,7 +75,7 @@ typedef enum _sai_hostif_trap_group_attr_t SAI_HOSTIF_TRAP_GROUP_ATTR_QUEUE, /** - * @brief Sai policer object id + * @brief SAI policer object id * * @type sai_object_id_t * @flags CREATE_AND_SET @@ -137,7 +137,7 @@ typedef sai_status_t (*sai_set_hostif_trap_group_attribute_fn)( _In_ const sai_attribute_t *attr); /** - * @brief get host interface trap group attribute value. + * @brief Get host interface trap group attribute value. * * @param[in] hostif_trap_group_id Host interface trap group id * @param[in] attr_count Number of attributes @@ -263,25 +263,25 @@ typedef enum _sai_hostif_trap_type_t SAI_HOSTIF_TRAP_TYPE_IP2ME = 0x00004000, /** - * @brief SSH traffic (tcp dst port == 22) to local router IP address + * @brief SSH traffic (TCP dst port == 22) to local router IP address * (default packet action is drop) */ SAI_HOSTIF_TRAP_TYPE_SSH = 0x00004001, /** - * @brief SNMP traffic (udp dst port == 161) to local router IP address + * @brief SNMP traffic (UDP dst port == 161) to local router IP address * (default packet action is drop) */ SAI_HOSTIF_TRAP_TYPE_SNMP = 0x00004002, /** - * @brief BGP traffic (tcp src port == 179 or tcp dst port == 179) to local + * @brief BGP traffic (TCP src port == 179 or TCP dst port == 179) to local * router IP address (default packet action is drop) */ SAI_HOSTIF_TRAP_TYPE_BGP = 0x00004003, /** - * @brief BGPv6 traffic (tcp src port == 179 or tcp dst port == 179) to + * @brief BGPv6 traffic (TCP src port == 179 or TCP dst port == 179) to * local router IP address (default packet action is drop) */ SAI_HOSTIF_TRAP_TYPE_BGPV6 = 0x00004004, @@ -456,7 +456,7 @@ typedef enum _sai_hostif_user_defined_trap_type_t /** ACL traps (default packet action is drop) */ SAI_HOSTIF_USER_DEFINED_TRAP_TYPE_ACL, - /** fdb traps (default packet action is drop) */ + /** FDB traps (default packet action is drop) */ SAI_HOSTIF_USER_DEFINED_TRAP_TYPE_FDB, /** Custom range base */ @@ -623,7 +623,7 @@ typedef enum _sai_hostif_attr_t /** * @brief Name [char[HOSTIF_NAME_SIZE]] * - * The maximum number of charactars for the name is HOSTIF_NAME_SIZE - 1 since + * The maximum number of characters for the name is HOSTIF_NAME_SIZE - 1 since * it needs the terminating null byte ('\0') at the end. * * Valid only when #SAI_HOSTIF_ATTR_TYPE == #SAI_HOSTIF_TYPE_NETDEV @@ -653,7 +653,7 @@ typedef enum _sai_hostif_attr_t SAI_HOSTIF_ATTR_QUEUE, /** - * @brief Rnd of attributes + * @brief End of attributes */ SAI_HOSTIF_ATTR_END, @@ -671,7 +671,7 @@ typedef enum _sai_hostif_attr_t * @param[out] hif_id Host interface id * @param[in] switch_id Switch object id * @param[in] attr_count Number of attributes - * @param[in] attr_list Aarray of attributes + * @param[in] attr_list Array of attributes * * @return #SAI_STATUS_SUCCESS on success Failure status code on error */ @@ -785,7 +785,7 @@ typedef enum _sai_hostif_table_entry_attr_t * Valid only when #SAI_HOSTIF_TABLE_ENTRY_ATTR_TYPE == #SAI_HOSTIF_TABLE_ENTRY_TYPE_PORT * || #SAI_HOSTIF_TABLE_ENTRY_TYPE_LAG || #SAI_HOSTIF_TABLE_ENTRY_TYPE_VLAN * should be port object when type is SAI_HOSTIF_TABLE_ENTRY_TYPE_PORT - * should be lag object when type is SAI_HOSTIF_TABLE_ENTRY_TYPE_LAG + * should be LAG object when type is SAI_HOSTIF_TABLE_ENTRY_TYPE_LAG * should be VLAN ID object when type is SAI_HOSTIF_TABLE_ENTRY_TYPE_VLAN * * @type sai_object_id_t @@ -830,7 +830,7 @@ typedef enum _sai_hostif_table_entry_attr_t SAI_HOSTIF_TABLE_ENTRY_ATTR_HOST_IF, /** - * @brief Rnd of attributes + * @brief End of attributes */ SAI_HOSTIF_TABLE_ENTRY_ATTR_END, @@ -848,7 +848,7 @@ typedef enum _sai_hostif_table_entry_attr_t * @param[out] hif_table_entry Host interface table entry * @param[in] switch_id Switch object id * @param[in] attr_count Number of attributes - * @param[in] attr_list Aarray of attributes + * @param[in] attr_list Array of attributes * * @return #SAI_STATUS_SUCCESS on success Failure status code on error */ @@ -861,7 +861,7 @@ typedef sai_status_t(*sai_create_hostif_table_entry_fn)( /** * @brief Remove host interface table entry * - * @param[in] hif_table_entry - host interface table entry + * @param[in] hif_table_entry Host interface table entry * * @return #SAI_STATUS_SUCCESS on success Failure status code on error */ @@ -871,7 +871,7 @@ typedef sai_status_t(*sai_remove_hostif_table_entry_fn)( /** * @brief Set host interface table entry attribute * - * @param[in] hif_table_entry - host interface table entry + * @param[in] hif_table_entry Host interface table entry * @param[in] attr Attribute * * @return #SAI_STATUS_SUCCESS on success Failure status code on error @@ -883,7 +883,7 @@ typedef sai_status_t(*sai_set_hostif_table_entry_attribute_fn)( /** * @brief Get host interface table entry attribute * - * @param[in] hif_table_entry - host interface table entry + * @param[in] hif_table_entry Host interface table entry * @param[in] attr_count Number of attributes * @param[inout] attr_list Array of attributes * @@ -908,7 +908,7 @@ typedef enum _sai_hostif_tx_type_t /** tx packet goes to the switch ASIC processing pipeline to decide the output port */ SAI_HOSTIF_TX_TYPE_PIPELINE_LOOKUP, - /** Custom range bae */ + /** Custom range base */ SAI_HOSTIF_TX_TYPE_CUSTOM_RANGE_BASE = 0x10000000 } sai_hostif_tx_type_t; @@ -963,7 +963,7 @@ typedef enum _sai_hostif_packet_attr_t * * For receive case, filled with the egress destination port for unicast packets. * Egress LAG member port id to be filled for the LAG destination case. - * Applicable for use-case like SAMPLEPACKET traps + * Applicable for use-case like samplepacket traps * * @type sai_object_id_t * @flags MANDATORY_ON_CREATE | CREATE_ONLY @@ -977,6 +977,12 @@ typedef enum _sai_hostif_packet_attr_t */ SAI_HOSTIF_PACKET_ATTR_END, + /** Custom range base value */ + SAI_HOSTIF_PACKET_ATTR_CUSTOM_RANGE_START = 0x10000000, + + /** End of custom range base */ + SAI_HOSTIF_PACKET_ATTR_CUSTOM_RANGE_END + } sai_hostif_packet_attr_t; /** @@ -984,8 +990,8 @@ typedef enum _sai_hostif_packet_attr_t * * @param[in] hif_id Host interface id * @param[out] buffer Packet buffer - * @param[inout] buffer_size Allocated buffer size [in], actual packet size in bytes [out] - * @param[inout] attr_count Allocated list size [in], number of attributes [out] + * @param[inout] buffer_size Allocated buffer size [in], Actual packet size in bytes [out] + * @param[inout] attr_count Allocated list size [in], Number of attributes [out] * @param[out] attr_list Array of attributes * * @return #SAI_STATUS_SUCCESS on success #SAI_STATUS_BUFFER_OVERFLOW if @@ -1007,7 +1013,7 @@ typedef sai_status_t(*sai_recv_hostif_packet_fn)( * When sending through FD channel, fill SAI_OBJECT_TYPE_HOST_INTERFACE object, of type #SAI_HOSTIF_TYPE_FD. * When sending through CB channel, fill Switch Object ID, SAI_OBJECT_TYPE_SWITCH. * @param[in] buffer Packet buffer - * @param[in] buffer size Packet size in bytes + * @param[in] buffer_size Packet size in bytes * @param[in] attr_count Number of attributes * @param[in] attr_list Array of attributes * @@ -1026,7 +1032,7 @@ typedef sai_status_t(*sai_send_hostif_packet_fn)( * @param[in] switch_id Switch Object ID * @param[in] buffer Packet buffer * @param[in] buffer_size Actual packet size in bytes - * @param[in] attr_count Nnumber of attributes + * @param[in] attr_count Number of attributes * @param[in] attr_list Array of attributes */ typedef void(*sai_packet_event_notification_fn)( @@ -1037,7 +1043,7 @@ typedef void(*sai_packet_event_notification_fn)( _In_ const sai_attribute_t *attr_list); /** - * @brief hostif methods table retrieved with sai_api_query() + * @brief Hostif methods table retrieved with sai_api_query() */ typedef struct _sai_hostif_api_t { diff --git a/inc/saiipmc.h b/inc/saiipmc.h index c208075fe..e03f7db38 100644 --- a/inc/saiipmc.h +++ b/inc/saiipmc.h @@ -8,7 +8,7 @@ * 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, MERCHANTABLITY OR NON-INFRINGEMENT. + * 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. @@ -68,7 +68,7 @@ typedef struct _sai_ipmc_entry_t /** IPMC entry type */ sai_ipmc_entry_type_t type; - /** IP dest address */ + /** IP destination address */ sai_ip_address_t destination; /** IP source address */ @@ -76,7 +76,7 @@ typedef struct _sai_ipmc_entry_t } sai_ipmc_entry_t; /** - * @brief Attribute Id for ipmc entry + * @brief Attribute Id for IPMC entry */ typedef enum _sai_ipmc_entry_attr_t { @@ -125,7 +125,7 @@ typedef enum _sai_ipmc_entry_attr_t SAI_IPMC_ENTRY_ATTR_END, /* Custom range base value */ - SAI_IPMC_ENTRY_ATTR_CUSTOM_RANGE_BASE = 0x10000000, + SAI_IPMC_ENTRY_ATTR_CUSTOM_RANGE_START = 0x10000000, /* -- */ SAI_IPMC_ENTRY_ATTR_CUSTOM_RANGE_END @@ -157,7 +157,7 @@ typedef sai_status_t (*sai_remove_ipmc_entry_fn)( _In_ const sai_ipmc_entry_t *ipmc_entry); /** - * @brief Set ipmc entry attribute value + * @brief Set IPMC entry attribute value * * @param[in] ipmc_entry IPMC entry * @param[in] attr Attribute @@ -169,7 +169,7 @@ typedef sai_status_t (*sai_set_ipmc_entry_attribute_fn)( _In_ const sai_attribute_t *attr); /** - * @brief Get ipmc entry attribute value + * @brief Get IPMC entry attribute value * * @param[in] ipmc_entry IPMC entry * @param[in] attr_count Number of attributes diff --git a/inc/saiipmcgroup.h b/inc/saiipmcgroup.h index b53b98550..56465991c 100644 --- a/inc/saiipmcgroup.h +++ b/inc/saiipmcgroup.h @@ -8,7 +8,7 @@ * 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, MERCHANTABLITY OR NON-INFRINGEMENT. + * 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. @@ -153,7 +153,7 @@ typedef sai_status_t (*sai_set_ipmc_group_attribute_fn)( * @brief Get IPMC Group attribute * * @param[in] sai_object_id_t IPMC group id - * @param[in] attr_count -Number of attributes + * @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 @@ -166,9 +166,9 @@ typedef sai_status_t (*sai_get_ipmc_group_attribute_fn)( /** * @brief Create IPMC group member * - * @param[out] ipmc_group_member_id - IPMC group member id - * @param[in] attr_count - number of attributes - * @param[in] attr_list - array of attributes + * @param[out] ipmc_group_member_id IPMC group member 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 */ @@ -181,9 +181,9 @@ typedef sai_status_t (*sai_create_ipmc_group_member_fn)( /** * @brief Remove IPMC group member * - * @param[in] ipmc_group_member_id - IPMC group member id + * @param[in] ipmc_group_member_id IPMC group member id * - * @return SAI_STATUS_SUCCESS on success Failure status code on error + * @return #SAI_STATUS_SUCCESS on success Failure status code on error */ typedef sai_status_t (*sai_remove_ipmc_group_member_fn)( _In_ sai_object_id_t ipmc_group_member_id); @@ -191,8 +191,8 @@ typedef sai_status_t (*sai_remove_ipmc_group_member_fn)( /** * @brief Set IPMC Group attribute * - * @param[in] sai_object_id_t - IPMC group member id - * @param[in] attr - attribute + * @param[in] sai_object_id_t IPMC group member id + * @param[in] attr Attribute * * @return #SAI_STATUS_SUCCESS on success Failure status code on error */ @@ -203,11 +203,11 @@ typedef sai_status_t (*sai_set_ipmc_group_member_attribute_fn)( /** * @brief Get IPMC Group attribute * - * @param[in] sai_object_id_t - ipmc_group_member_id - * @param[in] attr_count - number of attributes - * @param[inout] attr_list - array of attributes + * @param[in] sai_object_id_t IPMC group member 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 + * @return #SAI_STATUS_SUCCESS on success Failure status code on error */ typedef sai_status_t (*sai_get_ipmc_group_member_attribute_fn)( _In_ sai_object_id_t ipmc_group_member_id, diff --git a/inc/sail2mc.h b/inc/sail2mc.h index c18139203..0677c0823 100644 --- a/inc/sail2mc.h +++ b/inc/sail2mc.h @@ -8,7 +8,7 @@ * 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, MERCHANTABLITY OR NON-INFRINGEMENT. + * 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. @@ -74,7 +74,7 @@ typedef struct _sai_l2mc_entry_t /** L2MC entry type */ sai_l2mc_entry_type_t type; - /** IP dest address */ + /** IP destination address */ sai_ip_address_t destination; /** IP source address */ @@ -82,7 +82,7 @@ typedef struct _sai_l2mc_entry_t } sai_l2mc_entry_t; /** - * @brief Attribute Id for l2mc entry + * @brief Attribute Id for L2MC entry */ typedef enum _sai_l2mc_entry_attr_t { @@ -120,9 +120,9 @@ typedef enum _sai_l2mc_entry_attr_t SAI_L2MC_ENTRY_ATTR_END, /* Custom range base value */ - SAI_L2MC_ENTRY_ATTR_CUSTOM_RANGE_BASE = 0x10000000, + SAI_L2MC_ENTRY_ATTR_CUSTOM_RANGE_START = 0x10000000, - /* -- */ + /** End of custom range base */ SAI_L2MC_ENTRY_ATTR_CUSTOM_RANGE_END } sai_l2mc_entry_attr_t; @@ -152,7 +152,7 @@ typedef sai_status_t (*sai_remove_l2mc_entry_fn)( _In_ const sai_l2mc_entry_t *l2mc_entry); /** - * @brief Set l2mc entry attribute value + * @brief Set L2MC entry attribute value * * @param[in] l2mc_entry L2MC entry * @param[in] attr Attribute @@ -164,7 +164,7 @@ typedef sai_status_t (*sai_set_l2mc_entry_attribute_fn)( _In_ const sai_attribute_t *attr); /** - * @brief Get l2mc entry attribute value + * @brief Get L2MC entry attribute value * * @param[in] l2mc_entry L2MC entry * @param[in] attr_count Number of attributes diff --git a/inc/sail2mcgroup.h b/inc/sail2mcgroup.h index 3850d11c2..3b69b5ef8 100644 --- a/inc/sail2mcgroup.h +++ b/inc/sail2mcgroup.h @@ -8,7 +8,7 @@ * 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, MERCHANTABLITY OR NON-INFRINGEMENT. + * 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. @@ -153,7 +153,7 @@ typedef sai_status_t (*sai_set_l2mc_group_attribute_fn)( * @brief Get L2MC Group attribute * * @param[in] sai_object_id_t L2MC group id - * @param[in] attr_count -Number of attributes + * @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 @@ -166,9 +166,9 @@ typedef sai_status_t (*sai_get_l2mc_group_attribute_fn)( /** * @brief Create L2MC group member * - * @param[out] l2mc_group_member_id - L2MC group member id - * @param[in] attr_count - number of attributes - * @param[in] attr_list - array of attributes + * @param[out] l2mc_group_member_id L2MC group member 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 */ @@ -181,9 +181,9 @@ typedef sai_status_t (*sai_create_l2mc_group_member_fn)( /** * @brief Remove L2MC group member * - * @param[in] l2mc_group_member_id - L2MC group member id + * @param[in] l2mc_group_member_id L2MC group member id * - * @return SAI_STATUS_SUCCESS on success Failure status code on error + * @return #SAI_STATUS_SUCCESS on success Failure status code on error */ typedef sai_status_t (*sai_remove_l2mc_group_member_fn)( _In_ sai_object_id_t l2mc_group_member_id); @@ -191,8 +191,8 @@ typedef sai_status_t (*sai_remove_l2mc_group_member_fn)( /** * @brief Set L2MC Group attribute * - * @param[in] sai_object_id_t - L2MC group member id - * @param[in] attr - attribute + * @param[in] sai_object_id_t L2MC group member id + * @param[in] attr Attribute * * @return #SAI_STATUS_SUCCESS on success Failure status code on error */ @@ -203,11 +203,11 @@ typedef sai_status_t (*sai_set_l2mc_group_member_attribute_fn)( /** * @brief Get L2MC Group attribute * - * @param[in] sai_object_id_t - l2mc_group_member_id - * @param[in] attr_count - number of attributes - * @param[inout] attr_list - array of attributes + * @param[in] sai_object_id_t L2MC group member 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 + * @return #SAI_STATUS_SUCCESS on success Failure status code on error */ typedef sai_status_t (*sai_get_l2mc_group_member_attribute_fn)( _In_ sai_object_id_t l2mc_group_member_id, diff --git a/inc/sailag.h b/inc/sailag.h index 678463fae..f59e5609c 100644 --- a/inc/sailag.h +++ b/inc/sailag.h @@ -8,7 +8,7 @@ * 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, MERCHANTABLITY OR NON-INFRINGEMENT. + * 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. @@ -34,7 +34,7 @@ */ /** - * @brief Lag attribute: List of attributes for LAG object + * @brief LAG attribute: List of attributes for LAG object */ typedef enum _sai_lag_attr_t { @@ -57,7 +57,7 @@ typedef enum _sai_lag_attr_t /** * @brief LAG bind point for ingress ACL object * - * Bind (or unbind) an ingress acl table or acl group on a LAG. Enable/Update + * Bind (or unbind) an ingress ACL table or ACL group on a LAG. Enable/Update * ingress ACL table or ACL group filtering by assigning the list of valid * object id. Disable ingress filtering by assigning SAI_NULL_OBJECT_ID * in the attribute value. @@ -73,7 +73,7 @@ typedef enum _sai_lag_attr_t /** * @brief LAG bind point for egress ACL object * - * Bind (or unbind) an egress acl tables or acl groups on a LAG. Enable/Update + * Bind (or unbind) an egress ACL tables or ACL groups on a LAG. Enable/Update * egress ACL table or ACL group filtering by assigning the list of valid * object id. Disable egress filtering by assigning SAI_NULL_OBJECT_ID * in the attribute value. diff --git a/inc/saimcastfdb.h b/inc/saimcastfdb.h index 304a4a9c9..86eee4ffc 100644 --- a/inc/saimcastfdb.h +++ b/inc/saimcastfdb.h @@ -8,7 +8,7 @@ * 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, MERCHANTABLITY OR NON-INFRINGEMENT. + * 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. @@ -45,7 +45,7 @@ typedef struct _sai_mcast_fdb_entry_t */ sai_object_id_t switch_id; - /** Mac address */ + /** MAC address */ sai_mac_t mac_address; /** Vlan ID */ @@ -54,7 +54,7 @@ typedef struct _sai_mcast_fdb_entry_t } sai_mcast_fdb_entry_t; /** - * @brief Attribute Id for multicast fdb entry + * @brief Attribute Id for multicast FDB entry */ typedef enum _sai_mcast_fdb_entry_attr_t { @@ -132,7 +132,7 @@ typedef sai_status_t (*sai_remove_mcast_fdb_entry_fn)( _In_ const sai_mcast_fdb_entry_t *fdb_entry); /** - * @brief Set multicast fdb entry attribute value + * @brief Set multicast FDB entry attribute value * * @param[in] fdb_entry FDB entry * @param[in] attr Attribute @@ -144,7 +144,7 @@ typedef sai_status_t (*sai_set_mcast_fdb_entry_attribute_fn)( _In_ const sai_attribute_t *attr); /** - * @brief Get fdb entry attribute value + * @brief Get FDB entry attribute value * * @param[in] fdb_entry FDB entry * @param[in] attr_count Number of attributes diff --git a/inc/saimirror.h b/inc/saimirror.h index d23f9abf5..860b7389d 100644 --- a/inc/saimirror.h +++ b/inc/saimirror.h @@ -8,7 +8,7 @@ * 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, MERCHANTABLITY OR NON-INFRINGEMENT. + * 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. @@ -28,7 +28,7 @@ #include /** - * @defgroup SAIMIRROR SAI - Mirror specific public APIs and datastructures + * @defgroup SAIMIRROR SAI - Mirror specific public APIs and data structures * * @{ */ @@ -38,13 +38,13 @@ */ typedef enum _sai_mirror_session_type_t { - /** Local span */ + /** Local SPAN */ SAI_MIRROR_SESSION_TYPE_LOCAL = 0, - /** Remote span */ + /** Remote SPAN */ SAI_MIRROR_SESSION_TYPE_REMOTE, - /** Enhanced Remote span */ + /** Enhanced Remote SPAN */ SAI_MIRROR_SESSION_TYPE_ENHANCED_REMOTE, } sai_mirror_session_type_t; @@ -80,7 +80,7 @@ typedef enum _sai_mirror_session_attr_t SAI_MIRROR_SESSION_ATTR_TYPE = SAI_MIRROR_SESSION_ATTR_START, /** - * @brief Destination/Analyser/Monitor Port + * @brief Destination/Analyzer/Monitor Port * * @type sai_object_id_t * @flags MANDATORY_ON_CREATE | CREATE_AND_SET @@ -110,42 +110,43 @@ typedef enum _sai_mirror_session_attr_t SAI_MIRROR_SESSION_ATTR_TC, /** - * @brief Valid for RSPAN and ERSPAN - * - * L2 header TPID if vlanId is not zero + * @brief L2 header TPID. Valid for RSPAN or ERSPAN with valid Vlan header * * @type sai_uint16_t - * @flags MANDATORY_ON_CREATE | CREATE_AND_SET + * @flags CREATE_AND_SET * @isvlan false - * @condition SAI_MIRROR_SESSION_ATTR_TYPE == SAI_MIRROR_SESSION_TYPE_ENHANCED_REMOTE or SAI_MIRROR_SESSION_ATTR_TYPE == SAI_MIRROR_SESSION_TYPE_REMOTE + * @default 0x8100 + * @validonly SAI_MIRROR_SESSION_ATTR_VLAN_HEADER_VALID == true or SAI_MIRROR_SESSION_ATTR_TYPE == SAI_MIRROR_SESSION_TYPE_REMOTE */ SAI_MIRROR_SESSION_ATTR_VLAN_TPID, /** - * @brief Valid for RSPAN and ERSPAN L2 header VlanId + * @brief L2 header VLAN Id. Valid for RSPAN or ERSPAN with valid Vlan header * * @type sai_uint16_t * @flags MANDATORY_ON_CREATE | CREATE_AND_SET * @isvlan true - * @condition SAI_MIRROR_SESSION_ATTR_TYPE == SAI_MIRROR_SESSION_TYPE_ENHANCED_REMOTE or SAI_MIRROR_SESSION_ATTR_TYPE == SAI_MIRROR_SESSION_TYPE_REMOTE + * @condition SAI_MIRROR_SESSION_ATTR_VLAN_HEADER_VALID == true or SAI_MIRROR_SESSION_ATTR_TYPE == SAI_MIRROR_SESSION_TYPE_REMOTE */ SAI_MIRROR_SESSION_ATTR_VLAN_ID, /** - * @brief Valid for RSPAN and ERSPAN packet priority (3 bits) + * @brief L2 header packet priority (3 bits). Valid for RSPAN or ERSPAN with valid Vlan header * * @type sai_uint8_t - * @flags MANDATORY_ON_CREATE | CREATE_AND_SET - * @condition SAI_MIRROR_SESSION_ATTR_TYPE == SAI_MIRROR_SESSION_TYPE_ENHANCED_REMOTE or SAI_MIRROR_SESSION_ATTR_TYPE == SAI_MIRROR_SESSION_TYPE_REMOTE + * @flags CREATE_AND_SET + * @default 0 + * @validonly SAI_MIRROR_SESSION_ATTR_VLAN_HEADER_VALID == true or SAI_MIRROR_SESSION_ATTR_TYPE == SAI_MIRROR_SESSION_TYPE_REMOTE */ SAI_MIRROR_SESSION_ATTR_VLAN_PRI, /** - * @brief Valid for RSPAN and ERSPAN Vlan-CFI (1 bit) + * @brief L2 header Vlan CFI (1 bit). Valid for RSPAN or ERSPAN with valid Vlan header * * @type sai_uint8_t - * @flags MANDATORY_ON_CREATE | CREATE_AND_SET - * @condition SAI_MIRROR_SESSION_ATTR_TYPE == SAI_MIRROR_SESSION_TYPE_ENHANCED_REMOTE or SAI_MIRROR_SESSION_ATTR_TYPE == SAI_MIRROR_SESSION_TYPE_REMOTE + * @flags CREATE_AND_SET + * @default 0 + * @validonly SAI_MIRROR_SESSION_ATTR_VLAN_HEADER_VALID == true or SAI_MIRROR_SESSION_ATTR_TYPE == SAI_MIRROR_SESSION_TYPE_REMOTE */ SAI_MIRROR_SESSION_ATTR_VLAN_CFI, @@ -154,6 +155,16 @@ typedef enum _sai_mirror_session_attr_t * SAI_MIRROR_SESSION_TYPE_ENHANCED_REMOTE */ + /** + * @brief Vlan header valid + * + * @type bool + * @flags CREATE_ONLY + * @default false + * @validonly SAI_MIRROR_SESSION_ATTR_TYPE == SAI_MIRROR_SESSION_TYPE_ENHANCED_REMOTE + */ + SAI_MIRROR_SESSION_ATTR_VLAN_HEADER_VALID, + /** * @brief Encapsulation type * @@ -191,7 +202,7 @@ typedef enum _sai_mirror_session_attr_t SAI_MIRROR_SESSION_ATTR_TTL, /** - * @brief tunnel source IP + * @brief Tunnel source IP * * @type sai_ip_address_t * @flags MANDATORY_ON_CREATE | CREATE_AND_SET @@ -241,6 +252,12 @@ typedef enum _sai_mirror_session_attr_t */ SAI_MIRROR_SESSION_ATTR_END, + /** Custom range base value */ + SAI_MIRROR_SESSION_ATTR_CUSTOM_RANGE_START = 0x10000000, + + /** End of custom range base */ + SAI_MIRROR_SESSION_ATTR_CUSTOM_RANGE_END + } sai_mirror_session_attr_t; /** @@ -291,7 +308,7 @@ typedef sai_status_t (*sai_set_mirror_session_attribute_fn)( * @param[in] attr_count Number of attributes * @param[inout] attr_list Value of attribute * - * @return SAI_STATUS_SUCCESS if operation is successful otherwise a different + * @return #SAI_STATUS_SUCCESS if operation is successful otherwise a different * error code is returned. */ typedef sai_status_t (*sai_get_mirror_session_attribute_fn)( diff --git a/inc/saineighbor.h b/inc/saineighbor.h index 588b33e63..588e17bfb 100644 --- a/inc/saineighbor.h +++ b/inc/saineighbor.h @@ -8,7 +8,7 @@ * 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, MERCHANTABLITY OR NON-INFRINGEMENT. + * 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. @@ -40,7 +40,7 @@ */ /** - * @brief Attribute Id for sai neighbor object + * @brief Attribute Id for SAI neighbor object */ typedef enum _sai_neighbor_entry_attr_t { @@ -50,7 +50,7 @@ typedef enum _sai_neighbor_entry_attr_t SAI_NEIGHBOR_ENTRY_ATTR_START, /** - * @brief Destination mac address for the neighbor + * @brief Destination MAC address for the neighbor * * @type sai_mac_t * @flags MANDATORY_ON_CREATE | CREATE_AND_SET @@ -104,7 +104,7 @@ typedef enum _sai_neighbor_entry_attr_t } sai_neighbor_entry_attr_t; /** - * @brief neighbor entry + * @brief Neighbor entry */ typedef struct _sai_neighbor_entry_t { @@ -136,7 +136,7 @@ typedef struct _sai_neighbor_entry_t * * @param[in] neighbor_entry Neighbor entry * @param[in] attr_count Number of attributes - * @param[in] attrs Array of attributes + * @param[in] attr_list Array of attributes * * @return #SAI_STATUS_SUCCESS on success Failure status code on error */ @@ -174,7 +174,7 @@ typedef sai_status_t (*sai_set_neighbor_entry_attribute_fn)( * * @param[in] neighbor_entry Neighbor entry * @param[in] attr_count Number of attributes - * @param[inout] attrs Array of attributes + * @param[inout] attr_list Array of attributes * * @return #SAI_STATUS_SUCCESS on success Failure status code on error */ @@ -193,7 +193,7 @@ typedef sai_status_t (*sai_remove_all_neighbor_entries_fn)( _In_ sai_object_id_t switch_id); /** - * @brief neighbor table methods, retrieved via sai_api_query() + * @brief Neighbor table methods, retrieved via sai_api_query() */ typedef struct _sai_neighbor_api_t { diff --git a/inc/sainexthop.h b/inc/sainexthop.h index b833a502c..4e16cba3a 100644 --- a/inc/sainexthop.h +++ b/inc/sainexthop.h @@ -8,7 +8,7 @@ * 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, MERCHANTABLITY OR NON-INFRINGEMENT. + * 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. @@ -68,7 +68,7 @@ typedef enum _sai_next_hop_attr_t SAI_NEXT_HOP_ATTR_TYPE = SAI_NEXT_HOP_ATTR_START, /** - * @brief Next hop entry ipv4 address + * @brief Next hop entry IPv4 address * * @type sai_ip_address_t * @flags MANDATORY_ON_CREATE | CREATE_ONLY diff --git a/inc/sainexthopgroup.h b/inc/sainexthopgroup.h index 16cbb1590..1d01979ff 100644 --- a/inc/sainexthopgroup.h +++ b/inc/sainexthopgroup.h @@ -8,7 +8,7 @@ * 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, MERCHANTABLITY OR NON-INFRINGEMENT. + * 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. @@ -181,8 +181,8 @@ typedef sai_status_t (*sai_set_next_hop_group_attribute_fn)( /** * @brief Get Next Hop Group attribute * - * @param[in] sai_object_id_t Next_hop_group_id - * @param[in] attr_count -Number of attributes + * @param[in] sai_object_id_t Next hop group 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 @@ -195,9 +195,9 @@ typedef sai_status_t (*sai_get_next_hop_group_attribute_fn)( /** * @brief Create next hop group member * - * @param[out] next_hop_group_member_id - next hop group member id - * @param[in] attr_count - number of attributes - * @param[in] attr_list - array of attributes + * @param[out] next_hop_group_member_id Next hop group member 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 */ @@ -210,9 +210,9 @@ typedef sai_status_t (*sai_create_next_hop_group_member_fn)( /** * @brief Remove next hop group member * - * @param[in] next_hop_group_member_id - next hop group member id + * @param[in] next_hop_group_member_id Next hop group member ID * - * @return SAI_STATUS_SUCCESS on success Failure status code on error + * @return #SAI_STATUS_SUCCESS on success Failure status code on error */ typedef sai_status_t (*sai_remove_next_hop_group_member_fn)( _In_ sai_object_id_t next_hop_group_member_id); @@ -220,8 +220,8 @@ typedef sai_status_t (*sai_remove_next_hop_group_member_fn)( /** * @brief Set Next Hop Group attribute * - * @param[in] sai_object_id_t - next_hop_group_member_id - * @param[in] attr - attribute + * @param[in] sai_object_id_t Next hop group member ID + * @param[in] attr Attribute * * @return #SAI_STATUS_SUCCESS on success Failure status code on error */ @@ -232,11 +232,11 @@ typedef sai_status_t (*sai_set_next_hop_group_member_attribute_fn)( /** * @brief Get Next Hop Group attribute * - * @param[in] sai_object_id_t - next_hop_group_member_id - * @param[in] attr_count - number of attributes - * @param[inout] attr_list - array of attributes + * @param[in] sai_object_id_t Next hop group member 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 + * @return #SAI_STATUS_SUCCESS on success Failure status code on error */ typedef sai_status_t (*sai_get_next_hop_group_member_attribute_fn)( _In_ sai_object_id_t next_hop_group_member_id, diff --git a/inc/saiobject.h b/inc/saiobject.h index e800eaee1..b2b4b8ef2 100644 --- a/inc/saiobject.h +++ b/inc/saiobject.h @@ -8,7 +8,7 @@ * 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, MERCHANTABLITY OR NON-INFRINGEMENT. + * 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. @@ -40,7 +40,7 @@ */ /** - * @brief Structure for bulk retrieval of objectids, attribute and values for + * @brief Structure for bulk retrieval of object ids, attribute and values for * each object-type. Key will be used in case of object-types not having * object-ids. */ @@ -119,15 +119,15 @@ sai_status_t sai_get_object_key( * the attributes. Callee also set the corresponding status to * #SAI_STATUS_BUFFER_OVERFLOW. * - * @param[inout] attrs Nist of attributes for every object. Caller is + * @param[inout] attr_list List of attributes for every object. Caller is * responsible for allocating and freeing buffer for the attributes. - * For list based attribute, e.g., s32list, oidlist, callee should + * For list based attribute, e.g., s32list, objlist, callee should * assume the caller has not allocate the memory for the list and * should only to fill the count but not list. Then, caller * can use corresponding get_attribute to get the list. * * @param[inout] object_statuses Status for each object. If the object does - * not exist, callee sets the correpsonding status to #SAI_STATUS_INVALID_OBJECT_ID. + * not exist, callee sets the corresponding status to #SAI_STATUS_INVALID_OBJECT_ID. * If the allocated attribute count is not large enough, * set the status to #SAI_STATUS_BUFFER_OVERFLOW. * @@ -139,7 +139,7 @@ sai_status_t sai_bulk_get_attribute( _In_ uint32_t object_count, _In_ sai_object_key_t *object_key, _Inout_ uint32_t *attr_count, - _Inout_ sai_attribute_t **attrs, + _Inout_ sai_attribute_t **attr_list, _Inout_ sai_status_t *object_statuses); /** diff --git a/inc/saipolicer.h b/inc/saipolicer.h index c34cbeb3d..441b801d9 100644 --- a/inc/saipolicer.h +++ b/inc/saipolicer.h @@ -8,7 +8,7 @@ * 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, MERCHANTABLITY OR NON-INFRINGEMENT. + * 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. @@ -28,7 +28,7 @@ #include /** - * @defgroup SAIPOLICER SAI - Qos Policer specific API definitions + * @defgroup SAIPOLICER SAI - QOS Policer specific API definitions * * @{ */ @@ -251,7 +251,7 @@ typedef enum _sai_policer_stat_t * * @param[out] policer_id The policer id * @param[in] switch_id Switch id - * @param[in] attr_count Nnumber of attributes + * @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 @@ -302,27 +302,26 @@ typedef sai_status_t (*sai_get_policer_attribute_fn)( * @brief Get Policer Statistics * * @param[in] policer_id Policer id - * @param[in] counter_ids Array of counter ids * @param[in] number_of_counters Number of counters in the array + * @param[in] counter_ids Array of counter ids * @param[out] counters Array of resulting counter values. * * @return #SAI_STATUS_SUCCESS on success Failure status code on error */ typedef sai_status_t (*sai_get_policer_stats_fn)( _In_ sai_object_id_t policer_id, - _In_ const sai_policer_stat_t *counter_ids, _In_ uint32_t number_of_counters, + _In_ const sai_policer_stat_t *counter_ids, _Out_ uint64_t *counters); /** * @brief Clear Policer statistics counters. * * @param[in] policer_id Policer id - * @param[in] number_of_counters number of counters in the array - * @param[in] counter_ids specifies the array of counter ids + * @param[in] number_of_counters Number of counters in the array + * @param[in] counter_ids Specifies the array of counter ids * - * @return SAI_STATUS_SUCCESS on success - * Failure status code on error + * @return #SAI_STATUS_SUCCESS on success, failure status code on error */ typedef sai_status_t (*sai_clear_policer_stats_fn)( _In_ sai_object_id_t policer_id, diff --git a/inc/saiport.h b/inc/saiport.h index bbb62e3a1..385c286c9 100644 --- a/inc/saiport.h +++ b/inc/saiport.h @@ -8,7 +8,7 @@ * 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, MERCHANTABLITY OR NON-INFRINGEMENT. + * 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. @@ -121,10 +121,10 @@ typedef enum _sai_port_internal_loopback_mode_t /** disable internal loopback */ SAI_PORT_INTERNAL_LOOPBACK_MODE_NONE, - /** port internal loopback at phy module */ + /** port internal loopback at PHY module */ SAI_PORT_INTERNAL_LOOPBACK_MODE_PHY, - /** port internal loopback at mac module */ + /** port internal loopback at MAC module */ SAI_PORT_INTERNAL_LOOPBACK_MODE_MAC } sai_port_internal_loopback_mode_t; @@ -381,7 +381,7 @@ typedef enum _sai_port_attr_t SAI_PORT_ATTR_NUMBER_OF_INGRESS_PRIORITY_GROUPS, /** - * @brief list of ingress priority groups + * @brief List of ingress priority groups * * @type sai_object_list_t * @flags READ_ONLY @@ -639,7 +639,7 @@ typedef enum _sai_port_attr_t /** * @brief Port bind point for ingress ACL object * - * Bind (or unbind) an ingress acl table or acl group on a port. Enable/Update + * Bind (or unbind) an ingress ACL table or ACL group on a port. Enable/Update * ingress ACL table or ACL group filtering by assigning the list of valid * object id. Disable ingress filtering by assigning SAI_NULL_OBJECT_ID * in the attribute value. @@ -655,7 +655,7 @@ typedef enum _sai_port_attr_t /** * @brief Port bind point for egress ACL object * - * Bind (or unbind) an egress acl tables or acl group on a port. Enable/Update + * Bind (or unbind) an egress ACL tables or ACL group on a port. Enable/Update * egress ACL table or ACL group filtering by assigning the list of valid * object id. Disable egress filtering by assigning SAI_NULL_OBJECT_ID * in the attribute value. @@ -993,8 +993,8 @@ typedef enum _sai_port_attr_t /** * @brief Port EEE Configuration * - * Energy Efficient Ethernet(EEE) is an IEEE 802.3 az standard aiming to - * reduce power consumptions on Ethernet ports (native copper ports). + * Energy Efficient Ethernet(EEE) is an IEEE 802.3az standard aiming to + * reduce power consumption on Ethernet ports (native copper ports). * Enable the EEE on port level * * @type bool @@ -1006,7 +1006,8 @@ typedef enum _sai_port_attr_t /** * @brief Port EEE IDLE time configuration * - * Time (in microsecs) to move to Low power state (No traffic), at the end of which MAC transitions to Low power state. + * Time (in microseconds) to move to Low power state (No traffic), at the + * end of which MAC transitions to Low power state. * MAX value set more benefit. * * @type sai_uint16_t @@ -1019,7 +1020,8 @@ typedef enum _sai_port_attr_t /** * @brief Port EEE Wakeup time configuration * - * Time(in microsecs) to wait before transmitter is leaving Low Power Mode State. Min value set avoid latency. + * Time (in microseconds) to wait before transmitter is leaving Low Power + * Mode State. Min value set avoid latency. * * @type sai_uint16_t * @flags CREATE_AND_SET @@ -1055,190 +1057,190 @@ typedef enum _sai_port_attr_t */ typedef enum _sai_port_stat_t { - /** sai port stat if in octets */ + /** SAI port stat if in octets */ SAI_PORT_STAT_IF_IN_OCTETS, - /** sai port stat if in ucast pkts */ + /** SAI port stat if in ucast pkts */ SAI_PORT_STAT_IF_IN_UCAST_PKTS, - /** sai port stat if in non ucast pkts */ + /** SAI port stat if in non ucast pkts */ SAI_PORT_STAT_IF_IN_NON_UCAST_PKTS, - /** sai port stat if in discards */ + /** SAI port stat if in discards */ SAI_PORT_STAT_IF_IN_DISCARDS, - /** sai port stat if in errors */ + /** SAI port stat if in errors */ SAI_PORT_STAT_IF_IN_ERRORS, - /** sai port stat if in unknown protos */ + /** SAI port stat if in unknown protocols */ SAI_PORT_STAT_IF_IN_UNKNOWN_PROTOS, - /** sai port stat if in broadcast pkts */ + /** SAI port stat if in broadcast pkts */ SAI_PORT_STAT_IF_IN_BROADCAST_PKTS, - /** sai port stat if in multicast pkts */ + /** SAI port stat if in multicast pkts */ SAI_PORT_STAT_IF_IN_MULTICAST_PKTS, - /** sai port stat if in vlan discards */ + /** SAI port stat if in vlan discards */ SAI_PORT_STAT_IF_IN_VLAN_DISCARDS, - /** sai port stat if out octets */ + /** SAI port stat if out octets */ SAI_PORT_STAT_IF_OUT_OCTETS, - /** sai port stat if out ucast pkts */ + /** SAI port stat if out ucast pkts */ SAI_PORT_STAT_IF_OUT_UCAST_PKTS, - /** sai port stat if out non ucast pkts */ + /** SAI port stat if out non ucast pkts */ SAI_PORT_STAT_IF_OUT_NON_UCAST_PKTS, - /** sai port stat if out discards */ + /** SAI port stat if out discards */ SAI_PORT_STAT_IF_OUT_DISCARDS, - /** sai port stat if out errors */ + /** SAI port stat if out errors */ SAI_PORT_STAT_IF_OUT_ERRORS, - /** sai port stat if out qlen */ + /** SAI port stat if out queue length */ SAI_PORT_STAT_IF_OUT_QLEN, - /** sai port stat if out broadcast pkts */ + /** SAI port stat if out broadcast pkts */ SAI_PORT_STAT_IF_OUT_BROADCAST_PKTS, - /** sai port stat if out multicast pkts */ + /** SAI port stat if out multicast pkts */ SAI_PORT_STAT_IF_OUT_MULTICAST_PKTS, - /** sai port stat ether stats drop events */ + /** SAI port stat ether stats drop events */ SAI_PORT_STAT_ETHER_STATS_DROP_EVENTS, - /** sai port stat ether stats multicast pkts */ + /** SAI port stat ether stats multicast pkts */ SAI_PORT_STAT_ETHER_STATS_MULTICAST_PKTS, - /** sai port stat ether stats broadcast pkts */ + /** SAI port stat ether stats broadcast pkts */ SAI_PORT_STAT_ETHER_STATS_BROADCAST_PKTS, - /** sai port stat ether stats undersize pkts */ + /** SAI port stat ether stats undersized pkts */ SAI_PORT_STAT_ETHER_STATS_UNDERSIZE_PKTS, - /** sai port stat ether stats fragments */ + /** SAI port stat ether stats fragments */ SAI_PORT_STAT_ETHER_STATS_FRAGMENTS, - /** sai port stat ether stats pkts 64 octets */ + /** SAI port stat ether stats pkts 64 octets */ SAI_PORT_STAT_ETHER_STATS_PKTS_64_OCTETS, - /** sai port stat ether stats pkts 65 to 127 octets */ + /** SAI port stat ether stats pkts 65 to 127 octets */ SAI_PORT_STAT_ETHER_STATS_PKTS_65_TO_127_OCTETS, - /** sai port stat ether stats pkts 128 to 255 octets */ + /** SAI port stat ether stats pkts 128 to 255 octets */ SAI_PORT_STAT_ETHER_STATS_PKTS_128_TO_255_OCTETS, - /** sai port stat ether stats pkts 256 to 511 octets */ + /** SAI port stat ether stats pkts 256 to 511 octets */ SAI_PORT_STAT_ETHER_STATS_PKTS_256_TO_511_OCTETS, - /** sai port stat ether stats pkts 512 to 1023 octets */ + /** SAI port stat ether stats pkts 512 to 1023 octets */ SAI_PORT_STAT_ETHER_STATS_PKTS_512_TO_1023_OCTETS, - /** sai port stat ether stats pkts 1024 to 1518 octets */ + /** SAI port stat ether stats pkts 1024 to 1518 octets */ SAI_PORT_STAT_ETHER_STATS_PKTS_1024_TO_1518_OCTETS, - /** sai port stat ether stats pkts 1519 to 2047 octets */ + /** SAI port stat ether stats pkts 1519 to 2047 octets */ SAI_PORT_STAT_ETHER_STATS_PKTS_1519_TO_2047_OCTETS, - /** sai port stat ether stats pkts 2048 to 4095 octets */ + /** SAI port stat ether stats pkts 2048 to 4095 octets */ SAI_PORT_STAT_ETHER_STATS_PKTS_2048_TO_4095_OCTETS, - /** sai port stat ether stats pkts 4096 to 9216 octets */ + /** SAI port stat ether stats pkts 4096 to 9216 octets */ SAI_PORT_STAT_ETHER_STATS_PKTS_4096_TO_9216_OCTETS, - /** sai port stat ether stats pkts 9217 to 16383 octets */ + /** SAI port stat ether stats pkts 9217 to 16383 octets */ SAI_PORT_STAT_ETHER_STATS_PKTS_9217_TO_16383_OCTETS, - /** sai port stat ether stats oversize pkts */ + /** SAI port stat ether stats oversize pkts */ SAI_PORT_STAT_ETHER_STATS_OVERSIZE_PKTS, - /** sai port stat ether rx oversize pkts */ + /** SAI port stat ether rx oversize pkts */ SAI_PORT_STAT_ETHER_RX_OVERSIZE_PKTS, - /** sai port stat ether tx oversize pkts */ + /** SAI port stat ether tx oversize pkts */ SAI_PORT_STAT_ETHER_TX_OVERSIZE_PKTS, - /** sai port stat ether stats jabbers */ + /** SAI port stat ether stats jabbers */ SAI_PORT_STAT_ETHER_STATS_JABBERS, - /** sai port stat ether stats octets */ + /** SAI port stat ether stats octets */ SAI_PORT_STAT_ETHER_STATS_OCTETS, - /** sai port stat ether stats pkts */ + /** SAI port stat ether stats pkts */ SAI_PORT_STAT_ETHER_STATS_PKTS, - /** sai port stat ether stats collisions */ + /** SAI port stat ether stats collisions */ SAI_PORT_STAT_ETHER_STATS_COLLISIONS, - /** sai port stat ether stats crc align errors */ + /** SAI port stat ether stats CRC align errors */ SAI_PORT_STAT_ETHER_STATS_CRC_ALIGN_ERRORS, - /** sai port stat ether stats tx no errors */ + /** SAI port stat ether stats tx no errors */ SAI_PORT_STAT_ETHER_STATS_TX_NO_ERRORS, - /** sai port stat ether stats rx no errors */ + /** SAI port stat ether stats rx no errors */ SAI_PORT_STAT_ETHER_STATS_RX_NO_ERRORS, - /** sai port stat ip in receives */ + /** SAI port stat IP in receives */ SAI_PORT_STAT_IP_IN_RECEIVES, - /** sai port stat ip in octets */ + /** SAI port stat IP in octets */ SAI_PORT_STAT_IP_IN_OCTETS, - /** sai port stat ip in ucast pkts */ + /** SAI port stat IP in ucast pkts */ SAI_PORT_STAT_IP_IN_UCAST_PKTS, - /** sai port stat ip in non ucast pkts */ + /** SAI port stat IP in non ucast pkts */ SAI_PORT_STAT_IP_IN_NON_UCAST_PKTS, - /** sai port stat ip in discards */ + /** SAI port stat IP in discards */ SAI_PORT_STAT_IP_IN_DISCARDS, - /** sai port stat ip out octets */ + /** SAI port stat IP out octets */ SAI_PORT_STAT_IP_OUT_OCTETS, - /** sai port stat ip out ucast pkts */ + /** SAI port stat IP out ucast pkts */ SAI_PORT_STAT_IP_OUT_UCAST_PKTS, - /** sai port stat ip out non ucast pkts */ + /** SAI port stat IP out non ucast pkts */ SAI_PORT_STAT_IP_OUT_NON_UCAST_PKTS, - /** sai port stat ip out discards */ + /** SAI port stat IP out discards */ SAI_PORT_STAT_IP_OUT_DISCARDS, - /** sai port stat ipv6 in receives */ + /** SAI port stat IPv6 in receives */ SAI_PORT_STAT_IPV6_IN_RECEIVES, - /** sai port stat ipv6 in octets */ + /** SAI port stat IPv6 in octets */ SAI_PORT_STAT_IPV6_IN_OCTETS, - /** sai port stat ipv6 in ucast pkts */ + /** SAI port stat IPv6 in ucast pkts */ SAI_PORT_STAT_IPV6_IN_UCAST_PKTS, - /** sai port stat ipv6 in non ucast pkts */ + /** SAI port stat IPv6 in non ucast pkts */ SAI_PORT_STAT_IPV6_IN_NON_UCAST_PKTS, - /** sai port stat ipv6 in mcast pkts */ + /** SAI port stat IPv6 in mcast pkts */ SAI_PORT_STAT_IPV6_IN_MCAST_PKTS, - /** sai port stat ipv6 in discards */ + /** SAI port stat IPv6 in discards */ SAI_PORT_STAT_IPV6_IN_DISCARDS, - /** sai port stat ipv6 out octets */ + /** SAI port stat IPv6 out octets */ SAI_PORT_STAT_IPV6_OUT_OCTETS, - /** sai port stat ipv6 out ucast pkts */ + /** SAI port stat IPv6 out ucast pkts */ SAI_PORT_STAT_IPV6_OUT_UCAST_PKTS, - /** sai port stat ipv6 out non ucast pkts */ + /** SAI port stat IPv6 out non ucast pkts */ SAI_PORT_STAT_IPV6_OUT_NON_UCAST_PKTS, - /** sai port stat ipv6 out mcast pkts */ + /** SAI port stat IPv6 out mcast pkts */ SAI_PORT_STAT_IPV6_OUT_MCAST_PKTS, - /** sai port stat ipv6 out discards */ + /** SAI port stat IPv6 out discards */ SAI_PORT_STAT_IPV6_OUT_DISCARDS, /** get/set WRED green packet count [uint64_t] */ @@ -1271,61 +1273,61 @@ typedef enum _sai_port_stat_t /** packet size based packets count rt stat ether in pkts 64 octets */ SAI_PORT_STAT_ETHER_IN_PKTS_64_OCTETS, - /** sai port stat ether in pkts 65 to 127 octets */ + /** SAI port stat ether in pkts 65 to 127 octets */ SAI_PORT_STAT_ETHER_IN_PKTS_65_TO_127_OCTETS, - /** sai port stat ether in pkts 128 to 255 octets */ + /** SAI port stat ether in pkts 128 to 255 octets */ SAI_PORT_STAT_ETHER_IN_PKTS_128_TO_255_OCTETS, - /** sai port stat ether in pkts 256 to 511 octets */ + /** SAI port stat ether in pkts 256 to 511 octets */ SAI_PORT_STAT_ETHER_IN_PKTS_256_TO_511_OCTETS, - /** sai port stat ether in pkts 512 to 1023 octets */ + /** SAI port stat ether in pkts 512 to 1023 octets */ SAI_PORT_STAT_ETHER_IN_PKTS_512_TO_1023_OCTETS, - /** sai port stat ether in pkts 1024 to 1518 octets */ + /** SAI port stat ether in pkts 1024 to 1518 octets */ SAI_PORT_STAT_ETHER_IN_PKTS_1024_TO_1518_OCTETS, - /** sai port stat ether in pkts 1519 to 2047 octets */ + /** SAI port stat ether in pkts 1519 to 2047 octets */ SAI_PORT_STAT_ETHER_IN_PKTS_1519_TO_2047_OCTETS, - /** sai port stat ether in pkts 2048 to 4095 octets */ + /** SAI port stat ether in pkts 2048 to 4095 octets */ SAI_PORT_STAT_ETHER_IN_PKTS_2048_TO_4095_OCTETS, - /** sai port stat ether in pkts 4096 to 9216 octets */ + /** SAI port stat ether in pkts 4096 to 9216 octets */ SAI_PORT_STAT_ETHER_IN_PKTS_4096_TO_9216_OCTETS, - /** sai port stat ether in pkts 9217 to 16383 octets */ + /** SAI port stat ether in pkts 9217 to 16383 octets */ SAI_PORT_STAT_ETHER_IN_PKTS_9217_TO_16383_OCTETS, - /** sai port stat ether out pkts 64 octets */ + /** SAI port stat ether out pkts 64 octets */ SAI_PORT_STAT_ETHER_OUT_PKTS_64_OCTETS, - /** sai port stat ether out pkts 65 to 127 octets */ + /** SAI port stat ether out pkts 65 to 127 octets */ SAI_PORT_STAT_ETHER_OUT_PKTS_65_TO_127_OCTETS, - /** sai port stat ether out pkts 128 to 255 octets */ + /** SAI port stat ether out pkts 128 to 255 octets */ SAI_PORT_STAT_ETHER_OUT_PKTS_128_TO_255_OCTETS, - /** sai port stat ether out pkts 256 to 511 octets */ + /** SAI port stat ether out pkts 256 to 511 octets */ SAI_PORT_STAT_ETHER_OUT_PKTS_256_TO_511_OCTETS, - /** sai port stat ether out pkts 512 to 1023 octets */ + /** SAI port stat ether out pkts 512 to 1023 octets */ SAI_PORT_STAT_ETHER_OUT_PKTS_512_TO_1023_OCTETS, - /** sai port stat ether out pkts 1024 to 1518 octets */ + /** SAI port stat ether out pkts 1024 to 1518 octets */ SAI_PORT_STAT_ETHER_OUT_PKTS_1024_TO_1518_OCTETS, - /** sai port stat ether out pkts 1519 to 2047 octets */ + /** SAI port stat ether out pkts 1519 to 2047 octets */ SAI_PORT_STAT_ETHER_OUT_PKTS_1519_TO_2047_OCTETS, - /** sai port stat ether out pkts 2048 to 4095 octets */ + /** SAI port stat ether out pkts 2048 to 4095 octets */ SAI_PORT_STAT_ETHER_OUT_PKTS_2048_TO_4095_OCTETS, - /** sai port stat ether out pkts 4096 to 9216 octets */ + /** SAI port stat ether out pkts 4096 to 9216 octets */ SAI_PORT_STAT_ETHER_OUT_PKTS_4096_TO_9216_OCTETS, - /** sai port stat ether out pkts 9217 to 16383 octets */ + /** SAI port stat ether out pkts 9217 to 16383 octets */ SAI_PORT_STAT_ETHER_OUT_PKTS_9217_TO_16383_OCTETS, /** get in port current occupancy in bytes [uint64_t] */ @@ -1367,73 +1369,73 @@ typedef enum _sai_port_stat_t /** PFC Packet Counters for RX and TX per PFC priority [uint64_t] */ SAI_PORT_STAT_PFC_0_RX_PKTS, - /** sai port stat pfc 0 tx pkts */ + /** SAI port stat PFC 0 tx pkts */ SAI_PORT_STAT_PFC_0_TX_PKTS, - /** sai port stat pfc 1 rx pkts */ + /** SAI port stat PFC 1 rx pkts */ SAI_PORT_STAT_PFC_1_RX_PKTS, - /** sai port stat pfc 1 tx pkts */ + /** SAI port stat PFC 1 tx pkts */ SAI_PORT_STAT_PFC_1_TX_PKTS, - /** sai port stat pfc 2 rx pkts */ + /** SAI port stat PFC 2 rx pkts */ SAI_PORT_STAT_PFC_2_RX_PKTS, - /** sai port stat pfc 2 tx pkts */ + /** SAI port stat PFC 2 tx pkts */ SAI_PORT_STAT_PFC_2_TX_PKTS, - /** sai port stat pfc 3 rx pkts */ + /** SAI port stat PFC 3 rx pkts */ SAI_PORT_STAT_PFC_3_RX_PKTS, - /** sai port stat pfc 3 tx pkts */ + /** SAI port stat PFC 3 tx pkts */ SAI_PORT_STAT_PFC_3_TX_PKTS, - /** sai port stat pfc 4 rx pkts */ + /** SAI port stat PFC 4 rx pkts */ SAI_PORT_STAT_PFC_4_RX_PKTS, - /** sai port stat pfc 4 tx pkts */ + /** SAI port stat PFC 4 tx pkts */ SAI_PORT_STAT_PFC_4_TX_PKTS, - /** sai port stat pfc 5 rx pkts */ + /** SAI port stat PFC 5 rx pkts */ SAI_PORT_STAT_PFC_5_RX_PKTS, - /** sai port stat pfc 5 tx pkts */ + /** SAI port stat PFC 5 tx pkts */ SAI_PORT_STAT_PFC_5_TX_PKTS, - /** sai port stat pfc 6 rx pkts */ + /** SAI port stat PFC 6 rx pkts */ SAI_PORT_STAT_PFC_6_RX_PKTS, - /** sai port stat pfc 6 tx pkts */ + /** SAI port stat PFC 6 tx pkts */ SAI_PORT_STAT_PFC_6_TX_PKTS, - /** sai port stat pfc 7 rx pkts */ + /** SAI port stat PFC 7 rx pkts */ SAI_PORT_STAT_PFC_7_RX_PKTS, - /** sai port stat pfc 7 tx pkts */ + /** SAI port stat PFC 7 tx pkts */ SAI_PORT_STAT_PFC_7_TX_PKTS, /** PFC based ON to OFF pause transitions counter per PFC priority [uint64_t] */ SAI_PORT_STAT_PFC_0_ON2OFF_RX_PKTS, - /** sai port stat pfc 1 on to off rx pkts */ + /** SAI port stat PFC 1 on to off rx pkts */ SAI_PORT_STAT_PFC_1_ON2OFF_RX_PKTS, - /** sai port stat pfc 2 on to off rx pkts */ + /** SAI port stat PFC 2 on to off rx pkts */ SAI_PORT_STAT_PFC_2_ON2OFF_RX_PKTS, - /** sai port stat pfc 3 on to off rx pkts */ + /** SAI port stat PFC 3 on to off rx pkts */ SAI_PORT_STAT_PFC_3_ON2OFF_RX_PKTS, - /** sai port stat pfc 4 on to off rx pkts */ + /** SAI port stat PFC 4 on to off rx pkts */ SAI_PORT_STAT_PFC_4_ON2OFF_RX_PKTS, - /** sai port stat pfc 5 on to off rx pkts */ + /** SAI port stat PFC 5 on to off rx pkts */ SAI_PORT_STAT_PFC_5_ON2OFF_RX_PKTS, - /** sai port stat pfc 6 on to off rx pkts */ + /** SAI port stat PFC 6 on to off rx pkts */ SAI_PORT_STAT_PFC_6_ON2OFF_RX_PKTS, - /** sai port stat pfc 7 on to off rx pkts */ + /** SAI port stat PFC 7 on to off rx pkts */ SAI_PORT_STAT_PFC_7_ON2OFF_RX_PKTS, /** @@ -1519,31 +1521,31 @@ typedef sai_status_t (*sai_get_port_attribute_fn)( * @brief Get port statistics counters. * * @param[in] port_id Port id - * @param[in] counter_ids Specifies the array of counter ids * @param[in] number_of_counters Number of counters in the array + * @param[in] counter_ids Specifies the array of counter ids * @param[out] counters Array of resulting counter values. * * @return #SAI_STATUS_SUCCESS on success Failure status code on error */ typedef sai_status_t (*sai_get_port_stats_fn)( _In_ sai_object_id_t port_id, - _In_ const sai_port_stat_t *counter_ids, _In_ uint32_t number_of_counters, + _In_ const sai_port_stat_t *counter_ids, _Out_ uint64_t *counters); /** * @brief Clear port statistics counters. * * @param[in] port_id Port id - * @param[in] counter_ids Specifies the array of counter ids * @param[in] number_of_counters Number of counters in the array + * @param[in] counter_ids Specifies the array of counter ids * * @return #SAI_STATUS_SUCCESS on success Failure status code on error */ typedef sai_status_t (*sai_clear_port_stats_fn)( _In_ sai_object_id_t port_id, - _In_ const sai_port_stat_t *counter_ids, - _In_ uint32_t number_of_counters); + _In_ uint32_t number_of_counters, + _In_ const sai_port_stat_t *counter_ids); /** * @brief Clear port's all statistics counters. diff --git a/inc/saiqosmap.h b/inc/saiqosmap.h index 2a7baafa7..97ee50d03 100644 --- a/inc/saiqosmap.h +++ b/inc/saiqosmap.h @@ -8,7 +8,7 @@ * 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, MERCHANTABLITY OR NON-INFRINGEMENT. + * 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. @@ -28,44 +28,44 @@ #include /** - * @defgroup SAIQOSMAPS SAI - Qos Maps specific API definitions. + * @defgroup SAIQOSMAPS SAI - QOS Maps specific API definitions. * * @{ */ /** - * @brief Enum defining qos map types. + * @brief Enum defining QOS map types. */ typedef enum _sai_qos_map_type_t { - /** Qos Map to set DOT1P to Traffic class */ + /** QOS Map to set DOT1P to Traffic class */ SAI_QOS_MAP_TYPE_DOT1P_TO_TC = 0x00000000, - /** Qos Map to set DOT1P to color */ + /** QOS Map to set DOT1P to color */ SAI_QOS_MAP_TYPE_DOT1P_TO_COLOR = 0x00000001, - /** Qos Map to set DSCP to Traffic class */ + /** QOS Map to set DSCP to Traffic class */ SAI_QOS_MAP_TYPE_DSCP_TO_TC = 0x00000002, - /** Qos Map to set DSCP to color */ + /** QOS Map to set DSCP to color */ SAI_QOS_MAP_TYPE_DSCP_TO_COLOR = 0x00000003, - /** Qos Map to set traffic class to queue */ + /** QOS Map to set traffic class to queue */ SAI_QOS_MAP_TYPE_TC_TO_QUEUE = 0x00000004, - /** Qos Map to set traffic class and color to DSCP */ + /** QOS Map to set traffic class and color to DSCP */ SAI_QOS_MAP_TYPE_TC_AND_COLOR_TO_DSCP = 0x00000005, - /** Qos Map to set traffic class and color to DSCP */ + /** QOS Map to set traffic class and color to DSCP */ SAI_QOS_MAP_TYPE_TC_AND_COLOR_TO_DOT1P = 0x00000006, - /** Qos Map to set traffic class to priority group */ + /** QOS Map to set traffic class to priority group */ SAI_QOS_MAP_TYPE_TC_TO_PRIORITY_GROUP = 0x00000007, - /** Qos Map to set PFC priority to priority group */ + /** QOS Map to set PFC priority to priority group */ SAI_QOS_MAP_TYPE_PFC_PRIORITY_TO_PRIORITY_GROUP = 0x00000008, - /** Qos Map to set PFC priority to queue */ + /** QOS Map to set PFC priority to queue */ SAI_QOS_MAP_TYPE_PFC_PRIORITY_TO_QUEUE = 0x00000009, /** Custom range base value */ @@ -74,7 +74,7 @@ typedef enum _sai_qos_map_type_t } sai_qos_map_type_t; /** - * @brief Enum defining attributes for Qos Maps. + * @brief Enum defining attributes for QOS Maps. */ typedef enum _sai_qos_map_attr_t { @@ -84,7 +84,7 @@ typedef enum _sai_qos_map_attr_t SAI_QOS_MAP_ATTR_START, /** - * @brief Qos Map type + * @brief QOS Map type * * @type sai_qos_map_type_t * @flags MANDATORY_ON_CREATE | CREATE_ONLY @@ -112,15 +112,15 @@ typedef enum _sai_qos_map_attr_t /** Custom range base value */ SAI_QOS_MAP_ATTR_CUSTOM_RANGE_START = 0x10000000, - /** Endo of custom range base */ + /** End of custom range base */ SAI_QOS_MAP_ATTR_CUSTOM_RANGE_END } sai_qos_map_attr_t ; /** - * @brief Create Qos Map + * @brief Create QOS Map * - * @param[out] qos_map_id Qos Map Id + * @param[out] qos_map_id QOS Map Id * @param[in] switch_id Switch id * @param[in] attr_count Number of attributes * @param[in] attr_list Array of attributes @@ -134,9 +134,9 @@ typedef sai_status_t (*sai_create_qos_map_fn)( _In_ const sai_attribute_t *attr_list); /** - * @brief Remove Qos Map + * @brief Remove QOS Map * - * @param[in] qos_map_id Qos Map id to be removed. + * @param[in] qos_map_id QOS Map id to be removed. * * @return #SAI_STATUS_SUCCESS on success Failure status code on error */ @@ -144,9 +144,9 @@ typedef sai_status_t (*sai_remove_qos_map_fn) ( _In_ sai_object_id_t qos_map_id); /** - * @brief Set attributes for qos map + * @brief Set attributes for QOS map * - * @param[in] qos_map_id Qos Map Id + * @param[in] qos_map_id QOS Map Id * @param[in] attr Attribute to set * * @return #SAI_STATUS_SUCCESS on success Failure status code on error @@ -156,7 +156,7 @@ typedef sai_status_t (*sai_set_qos_map_attribute_fn)( _In_ const sai_attribute_t *attr); /** - * @brief Get attrbutes of qos map + * @brief Get attributes of QOS map * * @param[in] qos_map_id Map id * @param[in] attr_count Number of attributes @@ -170,7 +170,7 @@ typedef sai_status_t (*sai_get_qos_map_attribute_fn)( _Inout_ sai_attribute_t *attr_list); /** - * @brief Qos Map methods table retrieved with sai_api_query() + * @brief QOS Map methods table retrieved with sai_api_query() */ typedef struct _sai_qos_map_api_t { diff --git a/inc/saiqueue.h b/inc/saiqueue.h index 29e5a970b..aa7c9333b 100644 --- a/inc/saiqueue.h +++ b/inc/saiqueue.h @@ -8,7 +8,7 @@ * 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, MERCHANTABLITY OR NON-INFRINGEMENT. + * 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. @@ -28,7 +28,7 @@ #include /** - * @defgroup SAIQUEUE SAI - Qos Queue specific API definitions. + * @defgroup SAIQUEUE SAI - QOS Queue specific API definitions. * * @{ */ @@ -73,7 +73,7 @@ typedef enum _sai_queue_attr_t SAI_QUEUE_ATTR_TYPE = SAI_QUEUE_ATTR_START, /** - * @brief Pord id + * @brief Port id * * @type sai_object_id_t * @flags MANDATORY_ON_CREATE | CREATE_ONLY | KEY @@ -92,8 +92,8 @@ typedef enum _sai_queue_attr_t /** * @brief Parent scheduler node * - * In case of Hierarchical Qos not supported, the parent node is the port. - * Condition on whether Hierarchial Qos is supported or not, need to remove + * In case of Hierarchical QOS not supported, the parent node is the port. + * Condition on whether Hierarchical QOS is supported or not, need to remove * the MANDATORY_ON_CREATE FLAG when HQoS is introduced * * @type sai_object_id_t @@ -286,8 +286,8 @@ typedef sai_status_t (*sai_remove_queue_fn)( /** * @brief Set attribute to Queue * - * @param[in] queue_id queue id to set the attribute - * @param[in] attr attribute to set + * @param[in] queue_id Queue ID to set the attribute + * @param[in] attr Attribute to set * * @return #SAI_STATUS_SUCCESS on success Failure status code on error */ @@ -313,34 +313,34 @@ typedef sai_status_t (*sai_get_queue_attribute_fn)( * @brief Get queue statistics counters. * * @param[in] queue_id Queue id - * @param[in] counter_ids Specifies the array of counter ids * @param[in] number_of_counters Number of counters in the array + * @param[in] counter_ids Specifies the array of counter ids * @param[out] counters Array of resulting counter values. * * @return #SAI_STATUS_SUCCESS on success Failure status code on error */ typedef sai_status_t (*sai_get_queue_stats_fn)( _In_ sai_object_id_t queue_id, - _In_ const sai_queue_stat_t *counter_ids, _In_ uint32_t number_of_counters, + _In_ const sai_queue_stat_t *counter_ids, _Out_ uint64_t *counters); /** * @brief Clear queue statistics counters. * * @param[in] queue_id Queue id - * @param[in] counter_ids Specifies the array of counter ids * @param[in] number_of_counters Number of counters in the array + * @param[in] counter_ids Specifies the array of counter ids * * @return #SAI_STATUS_SUCCESS on success Failure status code on error */ typedef sai_status_t (*sai_clear_queue_stats_fn)( _In_ sai_object_id_t queue_id, - _In_ const sai_queue_stat_t *counter_ids, - _In_ uint32_t number_of_counters); + _In_ uint32_t number_of_counters, + _In_ const sai_queue_stat_t *counter_ids); /** - * @brief Qos methods table retrieved with sai_api_query() + * @brief QOS methods table retrieved with sai_api_query() */ typedef struct _sai_queue_api_t { diff --git a/inc/sairoute.h b/inc/sairoute.h index e567edf37..4d9698d5d 100644 --- a/inc/sairoute.h +++ b/inc/sairoute.h @@ -8,7 +8,7 @@ * 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, MERCHANTABLITY OR NON-INFRINGEMENT. + * 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. @@ -34,7 +34,7 @@ */ /** - * @brief Attribute Id for sai route object + * @brief Attribute Id for SAI route object */ typedef enum _sai_route_entry_attr_t { @@ -158,7 +158,7 @@ typedef sai_status_t (*sai_create_route_entry_fn)( * * Note: IP prefix/mask expected in Network Byte Order. * - * @param[in] route_entry - route entry + * @param[in] route_entry Route entry * * @return #SAI_STATUS_SUCCESS on success Failure status code on error */ diff --git a/inc/sairouterinterface.h b/inc/sairouterinterface.h index d69ad8cbb..9698b4ee3 100644 --- a/inc/sairouterinterface.h +++ b/inc/sairouterinterface.h @@ -8,7 +8,7 @@ * 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, MERCHANTABLITY OR NON-INFRINGEMENT. + * 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. @@ -38,7 +38,7 @@ */ typedef enum _sai_router_interface_type_t { - /** Port or Lag Router Interface Type */ + /** Port or LAG Router Interface Type */ SAI_ROUTER_INTERFACE_TYPE_PORT, /** VLAN Router Interface Type */ @@ -85,7 +85,7 @@ typedef enum _sai_router_interface_attr_t SAI_ROUTER_INTERFACE_ATTR_TYPE, /** - * @brief Assosiated Port or Lag object id + * @brief Associated Port or LAG object id * * @type sai_object_id_t * @flags MANDATORY_ON_CREATE | CREATE_ONLY @@ -95,7 +95,7 @@ typedef enum _sai_router_interface_attr_t SAI_ROUTER_INTERFACE_ATTR_PORT_ID, /** - * @brief Assosiated Vlan + * @brief Associated Vlan * * @type sai_object_id_t * @flags MANDATORY_ON_CREATE | CREATE_ONLY @@ -148,7 +148,7 @@ typedef enum _sai_router_interface_attr_t /** * @brief RIF bind point for ingress ACL object * - * Bind (or unbind) an ingress acl table or acl group on a RIF. Enable/Update + * Bind (or unbind) an ingress ACL table or ACL group on a RIF. Enable/Update * ingress ACL table or ACL group filtering by assigning a valid object id. * Disable ingress filtering by assigning SAI_NULL_OBJECT_ID in the * attribute value. @@ -164,7 +164,7 @@ typedef enum _sai_router_interface_attr_t /** * @brief RIF bind point for egress ACL object * - * Bind (or unbind) an egress acl table or acl group on a RIF. Enable/Update + * Bind (or unbind) an egress ACL table or ACL group on a RIF. Enable/Update * egress ACL table or ACL group filtering by assigning a valid object id. * Disable egress filtering by assigning SAI_NULL_OBJECT_ID * in the attribute value. @@ -187,7 +187,7 @@ typedef enum _sai_router_interface_attr_t SAI_ROUTER_INTERFACE_ATTR_NEIGHBOR_MISS_PACKET_ACTION, /** - * @brief V4 Mcast enable + * @brief V4 mcast enable * * @type bool * @flags CREATE_AND_SET @@ -196,7 +196,7 @@ typedef enum _sai_router_interface_attr_t SAI_ROUTER_INTERFACE_ATTR_V4_MCAST_ENABLE, /** - * @brief V6 Mcast enable + * @brief V6 mcast enable * * @type bool * @flags CREATE_AND_SET diff --git a/inc/sairpfgroup.h b/inc/sairpfgroup.h index cab384b93..9ca50a47f 100644 --- a/inc/sairpfgroup.h +++ b/inc/sairpfgroup.h @@ -8,7 +8,7 @@ * 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, MERCHANTABLITY OR NON-INFRINGEMENT. + * 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. @@ -153,7 +153,7 @@ typedef sai_status_t (*sai_set_rpf_group_attribute_fn)( * @brief Get RPF interface Group attribute * * @param[in] sai_object_id_t RPF interface group id - * @param[in] attr_count -Number of attributes + * @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 @@ -166,9 +166,9 @@ typedef sai_status_t (*sai_get_rpf_group_attribute_fn)( /** * @brief Create RPF interface group member * - * @param[out] rpf_group_member_id - RPF interface group member id - * @param[in] attr_count - number of attributes - * @param[in] attr_list - array of attributes + * @param[out] rpf_group_member_id RPF interface group member 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 */ @@ -181,9 +181,9 @@ typedef sai_status_t (*sai_create_rpf_group_member_fn)( /** * @brief Remove RPF interface group member * - * @param[in] rpf_group_member_id - RPF interface group member id + * @param[in] rpf_group_member_id RPF interface group member id * - * @return SAI_STATUS_SUCCESS on success Failure status code on error + * @return #SAI_STATUS_SUCCESS on success Failure status code on error */ typedef sai_status_t (*sai_remove_rpf_group_member_fn)( _In_ sai_object_id_t rpf_group_member_id); @@ -191,8 +191,8 @@ typedef sai_status_t (*sai_remove_rpf_group_member_fn)( /** * @brief Set RPF interface Group attribute * - * @param[in] sai_object_id_t - RPF interface group member id - * @param[in] attr - attribute + * @param[in] sai_object_id_t RPF interface group member id + * @param[in] attr Attribute * * @return #SAI_STATUS_SUCCESS on success Failure status code on error */ @@ -203,11 +203,11 @@ typedef sai_status_t (*sai_set_rpf_group_member_attribute_fn)( /** * @brief Get RPF interface Group attribute * - * @param[in] sai_object_id_t - rpf_group_member_id - * @param[in] attr_count - number of attributes - * @param[inout] attr_list - array of attributes + * @param[in] sai_object_id_t RPF group member 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 + * @return #SAI_STATUS_SUCCESS on success Failure status code on error */ typedef sai_status_t (*sai_get_rpf_group_member_attribute_fn)( _In_ sai_object_id_t rpf_group_member_id, diff --git a/inc/saisamplepacket.h b/inc/saisamplepacket.h index 5962bf3ce..1c0f11d13 100644 --- a/inc/saisamplepacket.h +++ b/inc/saisamplepacket.h @@ -8,7 +8,7 @@ * 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, MERCHANTABLITY OR NON-INFRINGEMENT. + * 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. @@ -28,7 +28,7 @@ #include /** - * @defgroup SAISAMPLEPACKET SAI - samplepacket specific public APIs and datastructures + * @defgroup SAISAMPLEPACKET SAI - samplepacket specific public APIs and data structures * * @{ */ @@ -114,6 +114,12 @@ typedef enum _sai_samplepacket_attr_t */ SAI_SAMPLEPACKET_ATTR_END, + /** Custom range base value */ + SAI_SAMPLEPACKET_ATTR_CUSTOM_RANGE_START = 0x10000000, + + /** End of custom range base */ + SAI_SAMPLEPACKET_ATTR_CUSTOM_RANGE_END + } sai_samplepacket_attr_t; /** @@ -147,7 +153,7 @@ typedef sai_status_t (*sai_remove_samplepacket_fn)( /** * @brief Set samplepacket session attributes. * - * @param[in] session_id samplepacket session id + * @param[in] session_id Samplepacket session id * @param[in] attr Value of attribute * * @return #SAI_STATUS_SUCCESS if operation is successful otherwise a different @@ -173,7 +179,7 @@ typedef sai_status_t (*sai_get_samplepacket_attribute_fn)( _Inout_ sai_attribute_t *attr_list); /** - * @brief samplepacket method table retrieved with sai_api_query() + * @brief Samplepacket method table retrieved with sai_api_query() */ typedef struct _sai_samplepacket_api_t { diff --git a/inc/saischeduler.h b/inc/saischeduler.h index 771c30c2a..423833bd9 100644 --- a/inc/saischeduler.h +++ b/inc/saischeduler.h @@ -8,7 +8,7 @@ * 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, MERCHANTABLITY OR NON-INFRINGEMENT. + * 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. @@ -28,7 +28,7 @@ #include /** - * @defgroup SAISCHEDULER SAI - Qos scheduler specific API definitions + * @defgroup SAISCHEDULER SAI - QOS scheduler specific API definitions * * @{ */ diff --git a/inc/saischedulergroup.h b/inc/saischedulergroup.h index 0beb7fa56..7ec422140 100644 --- a/inc/saischedulergroup.h +++ b/inc/saischedulergroup.h @@ -8,7 +8,7 @@ * 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, MERCHANTABLITY OR NON-INFRINGEMENT. + * 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. @@ -28,7 +28,7 @@ #include /** - * @defgroup SAISCHEDULERGROUP SAI - Qos scheduler group specific API definitions + * @defgroup SAISCHEDULERGROUP SAI - QOS scheduler group specific API definitions * * @{ */ @@ -52,7 +52,7 @@ typedef enum _sai_scheduler_group_attr_t SAI_SCHEDULER_GROUP_ATTR_CHILD_COUNT = SAI_SCHEDULER_GROUP_ATTR_START, /** - * @brief Scheduler Group child obejct id list + * @brief Scheduler Group child object id list * * @type sai_object_list_t * @flags READ_ONLY @@ -86,7 +86,7 @@ typedef enum _sai_scheduler_group_attr_t SAI_SCHEDULER_GROUP_ATTR_MAX_CHILDS = 0x00000004, /** - * @brief Scheucler ID + * @brief Scheduler id * * @type sai_object_id_t * @flags MANDATORY_ON_CREATE | CREATE_AND_SET @@ -121,7 +121,7 @@ typedef enum _sai_scheduler_group_attr_t /** * @brief Create Scheduler group * - * @param[out] scheduler_group_id Scheudler group id + * @param[out] scheduler_group_id Scheduler group id * @param[in] switch_id The Switch id * @param[in] attr_count Number of attributes * @param[in] attr_list Array of attributes @@ -137,7 +137,7 @@ typedef sai_status_t (*sai_create_scheduler_group_fn)( /** * @brief Remove Scheduler group * - * @param[in] scheduler_group_id Scheudler group id + * @param[in] scheduler_group_id Scheduler group id * * @return #SAI_STATUS_SUCCESS on success Failure status code on error */ @@ -147,7 +147,7 @@ typedef sai_status_t (*sai_remove_scheduler_group_fn)( /** * @brief Set Scheduler group Attribute * - * @param[in] scheduler_group_id Scheudler group id + * @param[in] scheduler_group_id Scheduler group id * @param[in] attr Attribute to set * * @return #SAI_STATUS_SUCCESS on success Failure status code on error diff --git a/inc/saistatus.h b/inc/saistatus.h index ea2a7ee8f..999cc018b 100644 --- a/inc/saistatus.h +++ b/inc/saistatus.h @@ -8,7 +8,7 @@ * 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, MERCHANTABLITY OR NON-INFRINGEMENT. + * 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. @@ -199,7 +199,7 @@ #define SAI_STATUS_INVALID_ATTR_VALUE_MAX SAI_STATUS_CODE(0x0002FFFFL) /** - * @brief Attribute is not implmented (range from 0x00030000L to 0x003FFFFL) + * @brief Attribute is not implemented (range from 0x00030000L to 0x003FFFFL) * * Return this when the attribute is supported but not implemented on * the platform. diff --git a/inc/saistp.h b/inc/saistp.h index 28eb8c910..ac5684426 100644 --- a/inc/saistp.h +++ b/inc/saistp.h @@ -8,7 +8,7 @@ * 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, MERCHANTABLITY OR NON-INFRINGEMENT. + * 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. @@ -28,13 +28,13 @@ #include /** - * @defgroup SAISTP SAI - STP specific public APIs and datastructures + * @defgroup SAISTP SAI - STP specific public APIs and data structures * * @{ */ /** - * @brief Datastructure for stp port state + * @brief Data structure for STP port state */ typedef enum _sai_stp_port_state_t { @@ -60,7 +60,7 @@ typedef enum _sai_stp_attr_t SAI_STP_ATTR_START, /** - * @brief Vlans attached to STP instance + * @brief VLANs attached to STP instance * * @type sai_vlan_list_t * @flags READ_ONLY @@ -79,7 +79,7 @@ typedef enum _sai_stp_attr_t /** * @brief Port member list * - * When a stp is created, this list is empty, all ports state as blocking. + * When a STP is created, this list is empty, all ports state as blocking. * * @type sai_object_list_t * @flags READ_ONLY @@ -92,6 +92,12 @@ typedef enum _sai_stp_attr_t */ SAI_STP_ATTR_END, + /** Custom range base value */ + SAI_STP_ATTR_CUSTOM_RANGE_START = 0x10000000, + + /** End of custom range base */ + SAI_STP_ATTR_CUSTOM_RANGE_END + } sai_stp_attr_t; /** @@ -135,12 +141,18 @@ typedef enum _sai_stp_port_attr_t */ SAI_STP_PORT_ATTR_END, + /** Custom range base value */ + SAI_STP_PORT_ATTR_CUSTOM_RANGE_START = 0x10000000, + + /** End of custom range base */ + SAI_STP_PORT_ATTR_CUSTOM_RANGE_END + } sai_stp_port_attr_t; /** - * @brief Create stp instance with default port state as blocking. + * @brief Create STP instance with default port state as blocking. * - * @param[out] stp_id stp instance id + * @param[out] stp_id STP instance id * @param[in] switch_id Switch id * @param[in] attr_count Number of attributes * @param[in] attr_list Value of attributes @@ -155,9 +167,9 @@ typedef sai_status_t (*sai_create_stp_fn)( _In_ const sai_attribute_t *attr_list); /** - * @brief Remove stp instance. + * @brief Remove STP instance. * - * @param[in] stp_id Stp instance id + * @param[in] stp_id STP instance id * * @return #SAI_STATUS_SUCCESS if operation is successful otherwise a different * error code is returned. @@ -168,9 +180,9 @@ typedef sai_status_t (*sai_remove_stp_fn)( /** * @brief Set the attribute of STP instance. * - * @param[in] stp_id Stp instance id - * @param[in] attr attribute value - * @return SAI_STATUS_SUCCESS if operation is successful otherwise a different + * @param[in] stp_id STP instance id + * @param[in] attr Attribute value + * @return #SAI_STATUS_SUCCESS if operation is successful otherwise a different * error code is returned. */ typedef sai_status_t (*sai_set_stp_attribute_fn)( @@ -180,10 +192,10 @@ typedef sai_status_t (*sai_set_stp_attribute_fn)( /** * @brief Get the attribute of STP instance. * - * @param[in] stp_id stp instance id - * @param[in] attr_count number of the attribute - * @param[in] attr_list attribute value - * @return SAI_STATUS_SUCCESS if operation is successful otherwise a different + * @param[in] stp_id STP instance id + * @param[in] attr_count Number of the attribute + * @param[in] attr_list Attribute value + * @return #SAI_STATUS_SUCCESS if operation is successful otherwise a different * error code is returned. */ typedef sai_status_t (*sai_get_stp_attribute_fn)( @@ -192,12 +204,12 @@ typedef sai_status_t (*sai_get_stp_attribute_fn)( _Inout_ sai_attribute_t *attr_list); /** - * @brief Create stp port object + * @brief Create STP port object * - * @param[out] stp_port_id stp port id + * @param[out] stp_port_id STP port id * @param[in] attr_count Number of attributes * @param[in] attr_list Value of attributes - * @return SAI_STATUS_SUCCESS if operation is successful otherwise a different + * @return #SAI_STATUS_SUCCESS if operation is successful otherwise a different * error code is returned. */ typedef sai_status_t (*sai_create_stp_port_fn)( @@ -207,10 +219,10 @@ typedef sai_status_t (*sai_create_stp_port_fn)( _In_ const sai_attribute_t *attr_list); /** - * @brief Remove stp port object. + * @brief Remove STP port object. * - * @param[in] stp_port_id stp object id - * @return SAI_STATUS_SUCCESS if operation is successful otherwise a different + * @param[in] stp_port_id STP object id + * @return #SAI_STATUS_SUCCESS if operation is successful otherwise a different * error code is returned. */ typedef sai_status_t (*sai_remove_stp_port_fn)( @@ -219,9 +231,9 @@ typedef sai_status_t (*sai_remove_stp_port_fn)( /** * @brief Set the attribute of STP port. * - * @param[in] stp_port_id stp port id - * @param[in] attr attribute value - * @return SAI_STATUS_SUCCESS if operation is successful otherwise a different + * @param[in] stp_port_id STP port id + * @param[in] attr Attribute value + * @return #SAI_STATUS_SUCCESS if operation is successful otherwise a different * error code is returned. */ typedef sai_status_t (*sai_set_stp_port_attribute_fn)( @@ -231,10 +243,10 @@ typedef sai_status_t (*sai_set_stp_port_attribute_fn)( /** * @brief Get the attribute of STP port. * - * @param[in] stp_port_id stp port id - * @param[in] attr_count number of the attribute - * @param[in] attr_list attribute value - * @return SAI_STATUS_SUCCESS if operation is successful otherwise a different + * @param[in] stp_port_id STP port id + * @param[in] attr_count Number of the attribute + * @param[in] attr_list Attribute value + * @return #SAI_STATUS_SUCCESS if operation is successful otherwise a different * error code is returned. */ typedef sai_status_t (*sai_get_stp_port_attribute_fn)( diff --git a/inc/saiswitch.h b/inc/saiswitch.h index d2ca44256..616f1d151 100644 --- a/inc/saiswitch.h +++ b/inc/saiswitch.h @@ -8,7 +8,7 @@ * 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, MERCHANTABLITY OR NON-INFRINGEMENT. + * 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. @@ -37,7 +37,7 @@ */ /** - * @brief Maximum Hardware ID Lenght + * @brief Maximum Hardware ID Length */ #define SAI_MAX_HARDWARE_ID_LEN 255 @@ -104,16 +104,16 @@ typedef enum _sai_packet_action_t /** Combination of Packet Actions */ - /** This is a combination of sai packet action COPY and DROP. */ + /** This is a combination of SAI packet action COPY and DROP. */ SAI_PACKET_ACTION_TRAP, - /** This is a combination of sai packet action COPY and FORWARD. */ + /** This is a combination of SAI packet action COPY and FORWARD. */ SAI_PACKET_ACTION_LOG, - /** This is a combination of sai packet action COPY_CANCEL and DROP */ + /** This is a combination of SAI packet action COPY_CANCEL and DROP */ SAI_PACKET_ACTION_DENY, - /** This is a combination of sai packet action COPY_CANCEL and FORWARD */ + /** This is a combination of SAI packet action COPY_CANCEL and FORWARD */ SAI_PACKET_ACTION_TRANSIT } sai_packet_action_t; @@ -167,7 +167,7 @@ typedef enum _sai_switch_switching_mode_t */ typedef enum _sai_hash_algorithm_t { - /** CRC-based hash algorithm */ + /** CRC based hash algorithm */ SAI_HASH_ALGORITHM_CRC = 0, /** XOR-based hash algorithm */ @@ -176,7 +176,7 @@ typedef enum _sai_hash_algorithm_t /** Random-based hash algorithm */ SAI_HASH_ALGORITHM_RANDOM = 2, - /** Lower 16-bits of CRC32-based hash algorithm */ + /** Lower 16-bits of CRC32 based hash algorithm */ SAI_HASH_ALGORITHM_CRC_32LO = 3, /** Higher 16-bits of CRC32-based hash algorithm */ @@ -381,7 +381,7 @@ typedef enum _sai_switch_attr_t SAI_SWITCH_ATTR_ON_LINK_ROUTE_SUPPORTED, /** - * @brief Oper state + * @brief Operational state * * @type sai_switch_oper_status_t * @flags READ_ONLY @@ -543,23 +543,10 @@ typedef enum _sai_switch_attr_t */ SAI_SWITCH_ATTR_DEFAULT_1Q_BRIDGE_ID, - /** - * @brief Default .1Q bridge router port ID - * - * This bridge router port is associated with the default .1Q Bridge - * #SAI_SWITCH_ATTR_DEFAULT_1Q_BRIDGE_ID - * - * @type sai_object_id_t - * @flags READ_ONLY - * @objects SAI_OBJECT_TYPE_BRIDGE_PORT - * @default internal - */ - SAI_SWITCH_ATTR_DEFAULT_1Q_BRIDGE_PORT_ID, - /** * @brief Switch/Global bind point for ingress ACL object * - * Bind (or unbind) an ingress acl table or acl group globally. Enable/Update + * Bind (or unbind) an ingress ACL table or ACL group globally. Enable/Update * ingress ACL table or ACL group filtering by assigning the list of valid * object id . Disable ingress filtering by assigning SAI_NULL_OBJECT_ID * in the attribute value. @@ -575,7 +562,7 @@ typedef enum _sai_switch_attr_t /** * @brief Switch/Global bind point for egress ACL object * - * Bind (or unbind) an egress acl tables or acl group globally. Enable/Update + * Bind (or unbind) an egress ACL tables or ACL group globally. Enable/Update * egress ACL table or ACL group filtering by assigning the list of valid * object id. Disable egress filtering by assigning SAI_NULL_OBJECT_ID * in the attribute value. @@ -615,7 +602,7 @@ typedef enum _sai_switch_attr_t SAI_SWITCH_ATTR_QOS_MAX_NUMBER_OF_SCHEDULER_GROUPS_PER_HIERARCHY_LEVEL, /** - * @brief HQOS - Maximum number of childs supported per scheudler group + * @brief HQOS - Maximum number of childs supported per scheduler group * * @type sai_uint32_t * @flags READ_ONLY @@ -733,7 +720,7 @@ typedef enum _sai_switch_attr_t * * Will be 0 for #SAI_SWITCH_RESTART_TYPE_NONE. The Host Adapter will have to * wait for this minimum interval of time before it decides to bring down - * SAI due to init failure. + * SAI due to initialize failure. * * @type sai_uint32_t * @flags READ_ONLY @@ -873,7 +860,7 @@ typedef enum _sai_switch_attr_t * @brief SAI ECMP default symmetric hash * * When set, the hash calculation will result in the same value as when the - * source and destination addresses (L2 src/dst mac,L3 src/dst ip,L4 + * source and destination addresses (L2 src/dst MAC,L3 src/dst IP,L4 * src/dst port) were swapped, ensuring the same conversation will result * in the same hash value. * @@ -935,7 +922,7 @@ typedef enum _sai_switch_attr_t * @brief SAI LAG default symmetric hash * * When set, the hash calculation will result in the same value as when the source and - * destination addresses (L2 src/dst mac,L3 src/dst ip,L4 src/dst port) were swapped, + * destination addresses (L2 src/dst MAC,L3 src/dst IP,L4 src/dst port) were swapped, * ensuring the same conversation will result in the same hash value. * * @type bool @@ -1127,7 +1114,7 @@ typedef enum _sai_switch_attr_t /** * @brief Handle for switch profile id. * - * Use this to retrive the Key-Vlaue pairs as part of switch + * Use this to retrieve the Key-Value pairs as part of switch * initialization. * * @type sai_uint32_t @@ -1141,7 +1128,7 @@ typedef enum _sai_switch_attr_t * * Hardware information format is based on SAI implementations by vendors. * String is NULL terminated. Format is vendor specific. - * Example: Like PCI location, I2C adddress etc. + * Example: Like PCI location, I2C address etc. * In case of NULL, First NPU attached to CPU will be initialized. * Single NPU case this attribute is optional. * @@ -1174,7 +1161,7 @@ typedef enum _sai_switch_attr_t SAI_SWITCH_ATTR_INIT_SWITCH, /** - * @brief Set Switch oper status change notification callback + * @brief Set Switch operational status change notification callback * function passed to the adapter. * * Use sai_switch_state_change_notification_fn as notification function. @@ -1254,7 +1241,7 @@ typedef enum _sai_switch_attr_t SAI_SWITCH_ATTR_MIRROR_TC, /** - * @brief Ingress acl stage. + * @brief Ingress ACL stage. * * @type sai_acl_capability_t * @flags READ_ONLY @@ -1262,7 +1249,7 @@ typedef enum _sai_switch_attr_t SAI_SWITCH_ATTR_ACL_STAGE_INGRESS, /** - * @brief Egress acl stage. + * @brief Egress ACL stage. * * @type sai_acl_capability_t * @flags READ_ONLY @@ -1366,8 +1353,8 @@ typedef enum _sai_switch_attr_t * * 0: cold boot. Initialize NPU and external phys. * 1: warm boot. Do not re-initialize NPU or external phys, reconstruct SAI/SDK state from stored state. - * 2: fast boot. Only initilize NPU. SAI/SDK state should not be persisted except for those related - * to physical port attributes such as SPEED, AUTONEG mode, admin state, oper status. + * 2: fast boot. Only initialize NPU. SAI/SDK state should not be persisted except for those related + * to physical port attributes such as SPEED, AUTONEG mode, admin state, operational status. */ #define SAI_KEY_BOOT_TYPE "SAI_BOOT_TYPE" @@ -1387,7 +1374,7 @@ typedef enum _sai_switch_attr_t * @def SAI_KEY_HW_PORT_PROFILE_ID_CONFIG_FILE * Vendor specific Configuration file for Hardware Port Profile ID parameters. * HW port profile ID can be used to set vendor specific port attributes based on - * the tranceiver type plugged in to the port + * the transceiver type plugged in to the port */ #define SAI_KEY_HW_PORT_PROFILE_ID_CONFIG_FILE "SAI_HW_PORT_PROFILE_ID_CONFIG_FILE" @@ -1403,10 +1390,10 @@ typedef void (*sai_switch_shutdown_request_notification_fn)( _In_ sai_object_id_t switch_id); /** - * @brief Switch oper state change notification + * @brief Switch operational state change notification * * @param[in] switch_id Switch Id - * @param[in] switch_oper_status New switch oper state + * @param[in] switch_oper_status New switch operational state */ typedef void (*sai_switch_state_change_notification_fn)( _In_ sai_object_id_t switch_id, @@ -1420,7 +1407,7 @@ typedef void (*sai_switch_state_change_notification_fn)( * given for create/connect for each NPU. * * @param[out] switch_id The Switch Object ID - * @param[in] attr_count number of attributes + * @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 diff --git a/inc/saitunnel.h b/inc/saitunnel.h index 30fc38859..4f9e471af 100644 --- a/inc/saitunnel.h +++ b/inc/saitunnel.h @@ -8,7 +8,7 @@ * 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, MERCHANTABLITY OR NON-INFRINGEMENT. + * 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. @@ -273,7 +273,7 @@ typedef sai_status_t(*sai_set_tunnel_map_attribute_fn)( _In_ const sai_attribute_t *attr); /** - * @brief Get attrbutes of tunnel map + * @brief Get attributes of tunnel map * * @param[in] tunnel_map_id Tunnel map id * @param[in] attr_count Number of attributes @@ -302,7 +302,7 @@ typedef enum _sai_tunnel_type_t } sai_tunnel_type_t; /** - * @brief Defines tunnel ttl mode + * @brief Defines tunnel TTL mode */ typedef enum _sai_tunnel_ttl_mode_t { @@ -330,7 +330,7 @@ typedef enum _sai_tunnel_ttl_mode_t } sai_tunnel_ttl_mode_t; /** - * @brief Defines tunnel dscp mode + * @brief Defines tunnel DSCP mode */ typedef enum _sai_tunnel_dscp_mode_t { @@ -358,7 +358,7 @@ typedef enum _sai_tunnel_dscp_mode_t } sai_tunnel_dscp_mode_t; /** - * @brief Defines tunnel encap ecn mode + * @brief Defines tunnel encap ECN mode */ typedef enum _sai_tunnel_encap_ecn_mode_t { @@ -378,7 +378,7 @@ typedef enum _sai_tunnel_encap_ecn_mode_t } sai_tunnel_encap_ecn_mode_t; /** - * @brief Defines tunnel decap ecn mode + * @brief Defines tunnel decap ECN mode */ typedef enum _sai_tunnel_decap_ecn_mode_t { @@ -420,7 +420,7 @@ typedef enum _sai_tunnel_attr_t SAI_TUNNEL_ATTR_TYPE = SAI_TUNNEL_ATTR_START, /** - * @brief tunnel underlay interface + * @brief Tunnel underlay interface * * Underlay interface is router interface when conditions are met * @@ -432,7 +432,7 @@ typedef enum _sai_tunnel_attr_t SAI_TUNNEL_ATTR_UNDERLAY_INTERFACE, /** - * @brief Tunnel overlay interafce + * @brief Tunnel overlay interface * * Overlay interface is router interface when conditions are met * @@ -446,7 +446,7 @@ typedef enum _sai_tunnel_attr_t /* Tunnel encap attributes */ /** - * @brief Tunnel src ip + * @brief Tunnel src IP * * @type sai_ip_address_t * @flags MANDATORY_ON_CREATE | CREATE_ONLY @@ -474,7 +474,7 @@ typedef enum _sai_tunnel_attr_t SAI_TUNNEL_ATTR_ENCAP_TTL_VAL, /** - * @brief Tunnel dscp mode (pipe or uniform model) + * @brief Tunnel DSCP mode (pipe or uniform model) * * @type sai_tunnel_dscp_mode_t * @flags CREATE_ONLY @@ -483,7 +483,7 @@ typedef enum _sai_tunnel_attr_t SAI_TUNNEL_ATTR_ENCAP_DSCP_MODE, /** - * @brief tunnel DSCP value (6 bits) + * @brief Tunnel DSCP value (6 bits) * * @type sai_uint8_t * @flags MANDATORY_ON_CREATE | CREATE_ONLY @@ -562,7 +562,7 @@ typedef enum _sai_tunnel_attr_t SAI_TUNNEL_ATTR_DECAP_TTL_MODE, /** - * @brief Tunnel dscp mode (pipe or uniform model) + * @brief Tunnel DSCP mode (pipe or uniform model) * * Default SAI_TUNNEL_DSCP_MODE_UNIFORM_MODEL * @@ -626,9 +626,9 @@ typedef sai_status_t (*sai_set_tunnel_attribute_fn)( /** * @brief Get tunnel attributes * - * @param[in] tunnel _id Tunnel id + * @param[in] tunnel_id Tunnel id * @param[in] attr_count Number of attributes - * @param[inout] attr_list Aarray of attributes + * @param[inout] attr_list Array of attributes * * @return #SAI_STATUS_SUCCESS on success Failure status code on error */ @@ -642,10 +642,10 @@ typedef sai_status_t (*sai_get_tunnel_attribute_fn)( */ typedef enum _sai_tunnel_term_table_entry_type_t { - /** tunnel termination table point to point entry match on dst & src ip & tunnel type */ + /** tunnel termination table point to point entry match on dst & src IP & tunnel type */ SAI_TUNNEL_TERM_TABLE_ENTRY_TYPE_P2P, - /** tunnel termination table point to multi point entry match on dst ip & tunnel type */ + /** tunnel termination table point to multi point entry match on dst IP & tunnel type */ SAI_TUNNEL_TERM_TABLE_ENTRY_TYPE_P2MP, } sai_tunnel_term_table_entry_type_t; @@ -678,7 +678,7 @@ typedef enum _sai_tunnel_term_table_entry_attr_t SAI_TUNNEL_TERM_TABLE_ENTRY_ATTR_TYPE, /** - * @brief Tunnel termination ip address [ + * @brief Tunnel termination IP address * * @type sai_ip_address_t * @flags MANDATORY_ON_CREATE | CREATE_ONLY @@ -686,7 +686,7 @@ typedef enum _sai_tunnel_term_table_entry_attr_t SAI_TUNNEL_TERM_TABLE_ENTRY_ATTR_DST_IP, /** - * @brief Tunnel source ip address + * @brief Tunnel source IP address * * @type sai_ip_address_t * @flags MANDATORY_ON_CREATE | CREATE_ONLY @@ -720,7 +720,7 @@ typedef enum _sai_tunnel_term_table_entry_attr_t /** Custom range base value */ SAI_TUNNEL_TERM_TABLE_ENTRY_ATTR_CUSTOM_RANGE_START = 0x10000000, - /** Enc od custom range base */ + /** Enc of custom range base */ SAI_TUNNEL_TERM_TABLE_ENTRY_ATTR_CUSTOM_RANGE_END } sai_tunnel_term_table_entry_attr_t; @@ -830,7 +830,7 @@ typedef sai_status_t (*sai_get_tunnel_map_entry_attribute_fn)( _Inout_ sai_attribute_t *attr_list); /** - * @brief tunnel methods table retrieved with sai_api_query() + * @brief Tunnel methods table retrieved with sai_api_query() */ typedef struct _sai_tunnel_api_t { diff --git a/inc/saitypes.h b/inc/saitypes.h index 9f399f452..db5f97017 100644 --- a/inc/saitypes.h +++ b/inc/saitypes.h @@ -8,7 +8,7 @@ * 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, MERCHANTABLITY OR NON-INFRINGEMENT. + * 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. @@ -115,14 +115,15 @@ typedef int8_t sai_int8_t; typedef size_t sai_size_t; typedef uint64_t sai_object_id_t; typedef void *sai_pointer_t; + /** * @def SAI_NULL_OBJECT_ID - * Sai NULL object ID + * SAI NULL object ID */ #define SAI_NULL_OBJECT_ID 0L /** - * @brief Defines a list of sai object ids used as sai attribute value. + * @brief Defines a list of SAI object ids used as SAI attribute value. * * In set attribute function call, the count member defines the number of * objects. @@ -130,7 +131,7 @@ typedef void *sai_pointer_t; * In get attribute function call, the function call returns a list of objects * to the caller in the list member. The caller is responsible for allocating the * buffer for the list member and set the count member to the size of allocated object - * list. If the size is large enough to accomodate the list of object id, the + * list. If the size is large enough to accommodate the list of object id, the * callee will then fill the list member and set the count member to the actual * number of objects. If the list size is not large enough, the callee will set the * count member to the actual number of object id and return @@ -143,7 +144,7 @@ typedef struct _sai_object_list_t { } sai_object_list_t; /** - * @brief sai common api type + * @brief SAI common API type */ typedef enum _sai_common_api_t { SAI_COMMON_API_CREATE = 0, @@ -154,7 +155,7 @@ typedef enum _sai_common_api_t { } sai_common_api_t; /** - * @brief sai object type + * @brief SAI object type */ typedef enum _sai_object_type_t { SAI_OBJECT_TYPE_NULL = 0, /**< invalid object type */ @@ -265,14 +266,14 @@ typedef struct _sai_s32_range_t { } sai_s32_range_t; /** - * @brief Defines a vlan list datastructure + * @brief Defines a vlan list data structure */ typedef struct _sai_vlan_list_t { - /** Number of Vlans */ + /** Number of VLANs */ uint32_t count; - /** List of Vlans */ + /** List of VLANs */ sai_vlan_id_t *list; } sai_vlan_list_t; @@ -407,16 +408,16 @@ typedef enum _sai_packet_color_t } sai_packet_color_t; /** - * @brief Defines qos map types. + * @brief Defines QOS map types. * * @par Examples: * - * dot1p/dscp --> TC - * dot1p/dscp --> Color - * dot1p/dscp --> TC + Color - * Tc --> dot1p/Dscp. - * Tc + color --> dot1p/Dscp. - * Tc --> Egress Queue. + * dot1p/DSCP --> TC + * dot1p/DSCP --> Color + * dot1p/DSCP --> TC + Color + * TC --> dot1p/DSCP. + * TC + color --> dot1p/DSCP. + * TC --> Egress Queue. */ typedef struct _sai_qos_map_params_t { @@ -502,7 +503,7 @@ typedef struct _sai_tunnel_map_list_t } sai_tunnel_map_list_t; /** - * @brief Structure for acl attributes supported at each stage. + * @brief Structure for ACL attributes supported at each stage. * action_list alone is added now. Qualifier list can also be added * when needed. */ @@ -537,7 +538,9 @@ typedef enum _sai_fdb_entry_bridge_type_t } sai_fdb_entry_bridge_type_t; /** - * @brief Data Type to use enum's as attribute value is sai_int32_t s32 + * @brief Data Type + * + * To use enum values as attribute value is sai_int32_t s32 */ typedef union { bool booldata; @@ -597,8 +600,8 @@ typedef enum _sai_bulk_op_type_t { * @param[in] object_count Number of objects to create * @param[in] attr_count List of attr_count. Caller passes the number * of attribute for each object to create. - * @param[in] attrs List of attributes for every object. - * @param[in] type bulk operation type. + * @param[in] attr_list List of attributes for every object. + * @param[in] type Bulk operation type. * * @param[out] object_id List of object ids returned * @param[out] object_statuses List of status for every object. Caller needs to allocate the buffer. @@ -612,7 +615,7 @@ typedef sai_status_t (*sai_bulk_object_create_fn)( _In_ sai_object_id_t switch_id, _In_ uint32_t object_count, _In_ const uint32_t *attr_count, - _In_ const sai_attribute_t **attrs, + _In_ const sai_attribute_t **attr_list, _In_ sai_bulk_op_type_t type, _Out_ sai_object_id_t *object_id, _Out_ sai_status_t *object_statuses); @@ -622,7 +625,7 @@ typedef sai_status_t (*sai_bulk_object_create_fn)( * * @param[in] object_count Number of objects to create * @param[in] object_id List of object ids - * @param[in] type bulk operation type. + * @param[in] type Bulk operation type. * @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 diff --git a/inc/saiudf.h b/inc/saiudf.h index 540b94662..ab7f639c5 100644 --- a/inc/saiudf.h +++ b/inc/saiudf.h @@ -8,7 +8,7 @@ * 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, MERCHANTABLITY OR NON-INFRINGEMENT. + * 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. @@ -115,6 +115,12 @@ typedef enum _sai_udf_attr_t */ SAI_UDF_ATTR_END, + /** Custom range base value */ + SAI_UDF_ATTR_CUSTOM_RANGE_START = 0x10000000, + + /** End of custom range base */ + SAI_UDF_ATTR_CUSTOM_RANGE_END + } sai_udf_attr_t; /** @@ -176,6 +182,12 @@ typedef enum _sai_udf_match_attr_t */ SAI_UDF_MATCH_ATTR_END, + /** Custom range base value */ + SAI_UDF_MATCH_ATTR_CUSTOM_RANGE_START = 0x10000000, + + /** End of custom range base */ + SAI_UDF_MATCH_ATTR_CUSTOM_RANGE_END + } sai_udf_match_attr_t; /** @@ -239,6 +251,12 @@ typedef enum _sai_udf_group_attr_t */ SAI_UDF_GROUP_ATTR_END, + /** Custom range base value */ + SAI_UDF_GROUP_ATTR_CUSTOM_RANGE_START = 0x10000000, + + /** End of custom range base */ + SAI_UDF_GROUP_ATTR_CUSTOM_RANGE_END + } sai_udf_group_attr_t; /** @@ -247,7 +265,7 @@ typedef enum _sai_udf_group_attr_t * @param[out] udf_id UDF id * @param[in] switch_id Switch id * @param[in] attr_count Number of attributes - * @param[in] attr_list Aarray of attributes + * @param[in] attr_list Array of attributes * * @return #SAI_STATUS_SUCCESS on success Failure status code on error */ @@ -283,8 +301,8 @@ typedef sai_status_t (*sai_set_udf_attribute_fn)( * @brief Get UDF attribute value * * @param[in] udf_id UDF id - * @param[in] attr_count number of attributes - * @param[inout] attrs -rray of attributes + * @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 */ @@ -336,7 +354,7 @@ typedef sai_status_t (*sai_set_udf_match_attribute_fn)( * * @param[in] udf_match_id UDF match id * @param[in] attr_count Number of attributes - * @param[inout] attrs Aarray of attributes + * @param[inout] attr_list List of attributes * * @return #SAI_STATUS_SUCCESS on success Failure status code on error */ @@ -388,7 +406,7 @@ typedef sai_status_t (*sai_set_udf_group_attribute_fn)( * * @param[in] udf_group_id UDF group id * @param[in] attr_count Number of attributes - * @param[inout] attrs Array of attributes + * @param[inout] attr_list Array of attributes * * @return #SAI_STATUS_SUCCESS on success Failure status code on error */ diff --git a/inc/saivirtualrouter.h b/inc/saivirtualrouter.h index 980d53b3a..c2047b387 100644 --- a/inc/saivirtualrouter.h +++ b/inc/saivirtualrouter.h @@ -8,7 +8,7 @@ * 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, MERCHANTABLITY OR NON-INFRINGEMENT. + * 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. diff --git a/inc/saivlan.h b/inc/saivlan.h index f0d2ac52c..af942bc06 100644 --- a/inc/saivlan.h +++ b/inc/saivlan.h @@ -8,7 +8,7 @@ * 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, MERCHANTABLITY OR NON-INFRINGEMENT. + * 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. @@ -109,7 +109,7 @@ typedef enum _sai_vlan_attr_t /** * @brief STP Instance that the VLAN is associated to * - * Ddefault to default stp instance id + * Default to default STP instance id * * @type sai_object_id_t * @flags CREATE_AND_SET @@ -122,7 +122,7 @@ typedef enum _sai_vlan_attr_t * @brief To disable learning on a VLAN * * This should override port learn settings. If this is set to true on a - * vlan, then the source mac learning is disabled for this vlan on a member + * vlan, then the source MAC learning is disabled for this vlan on a member * port even if learn is enable on the port(based on port learn attribute) * * @type bool @@ -150,13 +150,13 @@ typedef enum _sai_vlan_attr_t SAI_VLAN_ATTR_IPV6_MCAST_LOOKUP_KEY_TYPE, /** - * @brief L2MC Group ID that unknown non-ip MACST packets forwarded to + * @brief L2MC Group ID that unknown non-IP MACST packets forwarded to * - * Indicating the output ports/LAGs for unknown non-ip multicast packets. + * Indicating the output ports/LAGs for unknown non-IP multicast packets. * This attribute only takes effect when one of the following conditions is met: - * (1)non-ip multicast packet - * (2)IPv4 multicast packet && not linklocal && IPv4 mcast snooping disabled for vlan - * (3)IPv6 multicast packet && not linklocal && IPv6 mcast snooping disabled for vlan + * (1) non-IP multicast packet + * (2) IPv4 multicast packet && not linklocal && IPv4 mcast snooping disabled for vlan + * (3) IPv6 multicast packet && not linklocal && IPv6 mcast snooping disabled for vlan * In case of SAI_NULL_OBJECT_ID, unknown multicast packets will be discarded. * If the group has no member, unknown multicast packets will be discarded. * @@ -169,11 +169,11 @@ typedef enum _sai_vlan_attr_t SAI_VLAN_ATTR_UNKNOWN_NON_IP_MCAST_OUTPUT_GROUP_ID, /** - * @brief L2MC Group ID that unknown ipv4 MACST packets forwarded to + * @brief L2MC Group ID that unknown IPv4 MACST packets forwarded to * * Indicating the output ports/LAGs for unknown IPv4 multicast packets. * This attribute only takes effect when the following condition is met: - * (1)IPv4 multicast packet && not linklocal && IPv4 mcast snooping enabled for vlan + * (1) IPv4 multicast packet && not linklocal && IPv4 mcast snooping enabled for vlan * In case of SAI_NULL_OBJECT_ID, unknown multicast packets will be discarded. * If the group has no member, unknown multicast packets will be discarded. * @@ -186,11 +186,11 @@ typedef enum _sai_vlan_attr_t SAI_VLAN_ATTR_UNKNOWN_IPV4_MCAST_OUTPUT_GROUP_ID, /** - * @brief L2MC Group ID that unknown ipv6 MACST packets forwarded to + * @brief L2MC Group ID that unknown IPv6 MACST packets forwarded to * * Indicating the output ports/LAGs for unknown IPv6 multicast packets. * This attribute only takes effect when the following condition is met: - * (1)IPv6 multicast packet && not linklocal && IPv6 mcast snooping enabled for vlan + * (1) IPv6 multicast packet && not linklocal && IPv6 mcast snooping enabled for vlan * In case of SAI_NULL_OBJECT_ID, unknown multicast packets will be discarded. * If the group has no member, unknown multicast packets will be discarded. * @@ -223,7 +223,7 @@ typedef enum _sai_vlan_attr_t /** * @brief VLAN bind point for ingress ACL object * - * Bind (or unbind) an ingress acl table or acl group on a VLAN. Enable/Update + * Bind (or unbind) an ingress ACL table or ACL group on a VLAN. Enable/Update * ingress ACL table or ACL group filtering by assigning the list of valid * object id. Disable ingress filtering by assigning SAI_NULL_OBJECT_ID * in the attribute value. @@ -239,7 +239,7 @@ typedef enum _sai_vlan_attr_t /** * @brief VLAN bind point for egress ACL object * - * Bind (or unbind) an egress acl table or acl group on a VLAN. Enable/Update + * Bind (or unbind) an egress ACL table or ACL group on a VLAN. Enable/Update * egress ACL table or ACL group filtering by assigning the list of valid * object id. Disable egress filtering by assigning SAI_NULL_OBJECT_ID * in the attribute value. @@ -271,7 +271,7 @@ typedef enum _sai_vlan_attr_t /** Custom range base value */ SAI_VLAN_ATTR_CUSTOM_RANGE_START = 0x10000000, - /** End oo custom range base */ + /** End of custom range base */ SAI_VLAN_ATTR_CUSTOM_RANGE_END } sai_vlan_attr_t; @@ -456,31 +456,31 @@ typedef sai_status_t (*sai_get_vlan_member_attribute_fn)( * @brief Get vlan statistics counters. * * @param[in] vlan_id VLAN id - * @param[in] counter_ids Specifies the array of counter ids * @param[in] number_of_counters Number of counters in the array + * @param[in] counter_ids Specifies the array of counter ids * @param[out] counters Array of resulting counter values. * * @return #SAI_STATUS_SUCCESS on success Failure status code on error */ typedef sai_status_t (*sai_get_vlan_stats_fn)( _In_ sai_object_id_t vlan_id, - _In_ const sai_vlan_stat_t *counter_ids, _In_ uint32_t number_of_counters, + _In_ const sai_vlan_stat_t *counter_ids, _Out_ uint64_t *counters); /** * @brief Clear vlan statistics counters. * * @param[in] vlan_id Vlan id - * @param[in] counter_ids Specifies the array of counter ids * @param[in] number_of_counters Number of counters in the array + * @param[in] counter_ids Specifies the array of counter ids * - * @return SAI_STATUS_SUCCESS on success Failure status code on error + * @return #SAI_STATUS_SUCCESS on success Failure status code on error */ typedef sai_status_t (*sai_clear_vlan_stats_fn)( _In_ sai_object_id_t vlan_id, - _In_ const sai_vlan_stat_t *counter_ids, - _In_ uint32_t number_of_counters); + _In_ uint32_t number_of_counters, + _In_ const sai_vlan_stat_t *counter_ids); /** * @brief VLAN methods table retrieved with sai_api_query() diff --git a/inc/saiwred.h b/inc/saiwred.h index c7986a2cb..401b5ce45 100644 --- a/inc/saiwred.h +++ b/inc/saiwred.h @@ -8,7 +8,7 @@ * 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, MERCHANTABLITY OR NON-INFRINGEMENT. + * 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. @@ -19,7 +19,7 @@ * * @file saiwred.h * - * @brief This module defines SAI QOS Wred interface + * @brief This module defines SAI QOS WRED interface */ #if !defined (__SAIWRED_H_) @@ -28,7 +28,7 @@ #include "saitypes.h" /** - * @defgroup SAIWRED SAI - Qos Wred specific API definitions + * @defgroup SAIWRED SAI - QOS WRED specific API definitions * * @{ */ @@ -242,7 +242,7 @@ typedef enum _sai_wred_attr_t /** * @brief Create WRED Profile * - * @param[out] wred_id Wred profile Id. + * @param[out] wred_id WRED profile Id. * @param[in] switch_id Switch Id * @param[in] attr_count Number of attributes * @param[in] attr_list Array of attributes @@ -258,7 +258,7 @@ typedef sai_status_t (*sai_create_wred_fn)( /** * @brief Remove WRED Profile * - * @param[in] wred_id Wred profile Id. + * @param[in] wred_id WRED profile Id. * * @return #SAI_STATUS_SUCCESS on success Failure status code on error */ @@ -266,9 +266,9 @@ typedef sai_status_t (*sai_remove_wred_fn)( _In_ sai_object_id_t wred_id); /** - * @brief Set attributes to Wred profile. + * @brief Set attributes to WRED profile. * - * @param[out] wred_id Wred profile Id. + * @param[out] wred_id WRED profile Id. * @param[in] attr Attribute * * @return #SAI_STATUS_SUCCESS on success Failure status code on error @@ -278,9 +278,9 @@ typedef sai_status_t (*sai_set_wred_attribute_fn)( _In_ const sai_attribute_t *attr); /** - * @brief Get Wred profile attribute + * @brief Get WRED profile attribute * - * @param[in] wred_id Wred Profile Id + * @param[in] wred_id WRED Profile Id * @param[in] attr_count Number of attributes * @param[inout] attr_list Array of attributes * diff --git a/meta/parse.pl b/meta/parse.pl index 284eb17db..126a1c6c8 100755 --- a/meta/parse.pl +++ b/meta/parse.pl @@ -8,6 +8,7 @@ use Getopt::Std; use Data::Dumper; use Term::ANSIColor; +#use Text::Aspell; my $errors = 0; my $warnings = 0; @@ -16,7 +17,10 @@ my %SAI_ENUMS = (); my %METADATA = (); my %STRUCTS = (); -my %options =(); +my %options = (); + +# pointers used in switch object for notifications +my @pointers = (); my @TESTNAMES= (); @@ -643,8 +647,8 @@ sub ProcessSingleEnum my @values = @{$enum->{values}}; - WriteSource "const char metadata_${typedef}_enum_name[] = \"$typedef\";"; - WriteSource "const $typedef metadata_${typedef}_enum_values[] = {"; + WriteSource "const char sai_metadata_${typedef}_enum_name[] = \"$typedef\";"; + WriteSource "const $typedef sai_metadata_${typedef}_enum_values[] = {"; for my $value (@values) { @@ -655,7 +659,7 @@ sub ProcessSingleEnum WriteSource "};"; - WriteSource "const char* metadata_${typedef}_enum_values_names[] = {"; + WriteSource "const char* sai_metadata_${typedef}_enum_values_names[] = {"; for my $value (@values) { @@ -665,7 +669,7 @@ sub ProcessSingleEnum WriteSource " NULL"; WriteSource "};"; - WriteSource "const char* metadata_${typedef}_enum_values_short_names[] = {"; + WriteSource "const char* sai_metadata_${typedef}_enum_values_short_names[] = {"; for my $value (@values) { @@ -679,7 +683,7 @@ sub ProcessSingleEnum my $count = $#values + 1; - WriteSource "const size_t metadata_${typedef}_enum_values_count = $count;"; + WriteSource "const size_t sai_metadata_${typedef}_enum_values_count = $count;"; return $count; } @@ -710,12 +714,12 @@ sub CreateMetadataHeaderAndSource WriteSource "#include \"saimetadata.h\""; WriteSource "#define DEFINE_ENUM_METADATA(x,count)\\"; - WriteSource "const sai_enum_metadata_t metadata_enum_ ## x = {\\"; - WriteSource " .name = metadata_ ## x ## _enum_name,\\"; + WriteSource "const sai_enum_metadata_t sai_metadata_enum_ ## x = {\\"; + WriteSource " .name = sai_metadata_ ## x ## _enum_name,\\"; WriteSource " .valuescount = count,\\"; - WriteSource " .values = (const int*)metadata_ ## x ## _enum_values,\\"; - WriteSource " .valuesnames = metadata_ ## x ## _enum_values_names,\\"; - WriteSource " .valuesshortnames = metadata_ ## x ## _enum_values_short_names,\\"; + WriteSource " .values = (const int*)sai_metadata_ ## x ## _enum_values,\\"; + WriteSource " .valuesnames = sai_metadata_ ## x ## _enum_values_names,\\"; + WriteSource " .valuesshortnames = sai_metadata_ ## x ## _enum_values_short_names,\\"; WriteSource "};"; for my $key (sort keys %SAI_ENUMS) @@ -728,14 +732,14 @@ sub CreateMetadataHeaderAndSource my $count = ProcessSingleEnum($key, $1, uc $2); - WriteHeader "extern const sai_enum_metadata_t metadata_enum_$1;"; + WriteHeader "extern const sai_enum_metadata_t sai_metadata_enum_$1;"; WriteSource "DEFINE_ENUM_METADATA($1, $count);"; } # all enums - WriteHeader "extern const sai_enum_metadata_t* metadata_all_enums[];"; - WriteSource "const sai_enum_metadata_t* metadata_all_enums[] = {"; + WriteHeader "extern const sai_enum_metadata_t* sai_metadata_all_enums[];"; + WriteSource "const sai_enum_metadata_t* sai_metadata_all_enums[] = {"; for my $key (sort keys %SAI_ENUMS) { @@ -747,7 +751,7 @@ sub CreateMetadataHeaderAndSource my $typedef = $1; - WriteSource " &metadata_enum_$typedef,"; + WriteSource " &sai_metadata_enum_$typedef,"; } WriteSource " NULL"; @@ -755,11 +759,11 @@ sub CreateMetadataHeaderAndSource my $count = keys %SAI_ENUMS; - WriteHeader "extern const size_t metadata_all_enums_count;"; - WriteSource "const size_t metadata_all_enums_count = $count;"; + WriteHeader "extern const size_t sai_metadata_all_enums_count;"; + WriteSource "const size_t sai_metadata_all_enums_count = $count;"; - WriteHeader "extern const sai_enum_metadata_t* metadata_attr_enums[];"; - WriteSource "const sai_enum_metadata_t* metadata_attr_enums[] = {"; + WriteHeader "extern const sai_enum_metadata_t* sai_metadata_attr_enums[];"; + WriteSource "const sai_enum_metadata_t* sai_metadata_attr_enums[] = {"; $count = 0; @@ -772,7 +776,7 @@ sub CreateMetadataHeaderAndSource my $typedef = $1; - WriteSource " &metadata_enum_$typedef,"; + WriteSource " &sai_metadata_enum_$typedef,"; $count++; } @@ -780,12 +784,12 @@ sub CreateMetadataHeaderAndSource WriteSource " NULL"; WriteSource "};"; - WriteHeader "extern const size_t metadata_attr_enums_count;"; - WriteSource "const size_t metadata_attr_enums_count = $count;"; + WriteHeader "extern const size_t sai_metadata_attr_enums_count;"; + WriteSource "const size_t sai_metadata_attr_enums_count = $count;"; # attr enums as object types for sanity check - WriteSource "const sai_object_type_t metadata_object_types[] = {"; + WriteSource "const sai_object_type_t sai_metadata_object_types[] = {"; for my $key (sort keys %SAI_ENUMS) { @@ -922,7 +926,7 @@ sub ProcessObjects return "NULL" if not defined $objects; - WriteSource "const sai_object_type_t metadata_${attr}_allowed_objects[] = {"; + WriteSource "const sai_object_type_t sai_metadata_${attr}_allowed_objects[] = {"; my @all = @{ $SAI_ENUMS{sai_object_type_t}{values} }; @@ -938,7 +942,7 @@ sub ProcessObjects WriteSource "};"; - return "metadata_${attr}_allowed_objects"; + return "sai_metadata_${attr}_allowed_objects"; } sub ProcessObjectsLen @@ -985,7 +989,7 @@ sub ProcessDefaultValue return "NULL" if not defined $default; - my $val = "const sai_attribute_value_t metadata_${attr}_default_value"; + my $val = "const sai_attribute_value_t sai_metadata_${attr}_default_value"; if ($default =~ /^(true|false)$/ and $type eq "bool") { @@ -1015,7 +1019,7 @@ sub ProcessDefaultValue { WriteSource "$val = { .$VALUE_TYPES{$1} = $default };"; - WriteSource "$2 var_$2 = NULL;"; + push @pointers,$2; } elsif ($default =~ /^(attrvalue|attrrange|vendor|empty|const|internal)/) { @@ -1036,7 +1040,7 @@ sub ProcessDefaultValue LogError "invalid default value '$default' on $attr ($type)"; } - return "&metadata_${attr}_default_value"; + return "&sai_metadata_${attr}_default_value"; } sub ProcessDefaultValueObjectType @@ -1091,10 +1095,10 @@ sub ProcessEnumMetadata return "NULL" if not defined $type; - return "&metadata_enum_$1" if $type =~ /^(sai_\w+_t)$/ and not defined $VALUE_TYPES{$type}; - return "&metadata_enum_$1" if $type =~ /^sai_acl_field_data_t (sai_\w+_t)$/ and not defined $ACL_FIELD_TYPES{$1}; - return "&metadata_enum_$1" if $type =~ /^sai_acl_action_data_t (sai_\w+_t)$/ and not defined $ACL_ACTION_TYPES{$1}; - return "&metadata_enum_$1" if $type =~ /^sai_s32_list_t (sai_\w+_t)$/; + return "&sai_metadata_enum_$1" if $type =~ /^(sai_\w+_t)$/ and not defined $VALUE_TYPES{$type}; + return "&sai_metadata_enum_$1" if $type =~ /^sai_acl_field_data_t (sai_\w+_t)$/ and not defined $ACL_FIELD_TYPES{$1}; + return "&sai_metadata_enum_$1" if $type =~ /^sai_acl_action_data_t (sai_\w+_t)$/ and not defined $ACL_ACTION_TYPES{$1}; + return "&sai_metadata_enum_$1" if $type =~ /^sai_s32_list_t (sai_\w+_t)$/; return "NULL"; } @@ -1163,7 +1167,7 @@ sub ProcessConditions return ""; } - WriteSource "const sai_attr_condition_t metadata_condition_${attr}_$count = {"; + WriteSource "const sai_attr_condition_t sai_metadata_condition_${attr}_$count = {"; if ($val eq "true" or $val eq "false") { @@ -1181,13 +1185,13 @@ sub ProcessConditions $count++; } - WriteSource "const sai_attr_condition_t* metadata_conditions_${attr}\[\] = {"; + WriteSource "const sai_attr_condition_t* sai_metadata_conditions_${attr}\[\] = {"; $count = 0; for my $cond (@conditions) { - WriteSource " &metadata_condition_${attr}_$count,"; + WriteSource " &sai_metadata_condition_${attr}_$count,"; $count++; } @@ -1196,7 +1200,7 @@ sub ProcessConditions WriteSource "};"; - return "metadata_conditions_${attr}"; + return "sai_metadata_conditions_${attr}"; } sub ProcessConditionsLen @@ -1251,7 +1255,7 @@ sub ProcessValidOnly return ""; } - WriteSource "const sai_attr_condition_t metadata_validonly_${attr}_$count = {"; + WriteSource "const sai_attr_condition_t sai_metadata_validonly_${attr}_$count = {"; if ($val eq "true" or $val eq "false") { @@ -1269,13 +1273,13 @@ sub ProcessValidOnly $count++; } - WriteSource "const sai_attr_condition_t* metadata_validonly_${attr}\[\] = {"; + WriteSource "const sai_attr_condition_t* sai_metadata_validonly_${attr}\[\] = {"; $count = 0; for my $cond (@conditions) { - WriteSource " &metadata_validonly_${attr}_$count,"; + WriteSource " &sai_metadata_validonly_${attr}_$count,"; $count++; } @@ -1284,7 +1288,7 @@ sub ProcessValidOnly WriteSource "};"; - return "metadata_validonly_${attr}"; + return "sai_metadata_validonly_${attr}"; } sub ProcessValidOnlyLen @@ -1397,7 +1401,7 @@ sub ProcessSingleObjectType my $isaclfield = ProcessIsAclField($attr); my $isaclaction = ProcessIsAclAction($attr); - WriteSource "const sai_attr_metadata_t metadata_attr_$attr = {"; + WriteSource "const sai_attr_metadata_t sai_metadata_attr_$attr = {"; WriteSource " .objecttype = $objecttype,"; WriteSource " .attrid = $attr,"; @@ -1410,6 +1414,7 @@ sub ProcessSingleObjectType WriteSource " .allowmixedobjecttypes = $allowmixed,"; WriteSource " .allowemptylist = $allowempty,"; WriteSource " .allownullobjectid = $allownull,"; + WriteSource " .isoidattribute = ($objectslen > 0),"; WriteSource " .defaultvaluetype = $defvaltype,"; WriteSource " .defaultvalue = $defval,"; WriteSource " .defaultvalueobjecttype = $defvalot,"; @@ -1547,7 +1552,7 @@ sub CreateMetadataForAttributes $SAI_ENUMS{$type}{values} = \@empty; } - WriteSource "const sai_attr_metadata_t* metadata_object_type_$type\[\] = {"; + WriteSource "const sai_attr_metadata_t* sai_metadata_object_type_$type\[\] = {"; my @values = @{ $SAI_ENUMS{$type}{values} }; @@ -1555,15 +1560,15 @@ sub CreateMetadataForAttributes { next if defined $METADATA{$type}{$value}{ignore}; - WriteSource " &metadata_attr_$value,"; + WriteSource " &sai_metadata_attr_$value,"; } WriteSource " NULL"; WriteSource "};"; } - WriteHeader "extern const sai_attr_metadata_t** metadata_attr_by_object_type[];"; - WriteSource "const sai_attr_metadata_t** metadata_attr_by_object_type[] = {"; + WriteHeader "extern const sai_attr_metadata_t** sai_metadata_attr_by_object_type[];"; + WriteSource "const sai_attr_metadata_t** sai_metadata_attr_by_object_type[] = {"; for my $ot (@objects) { @@ -1575,7 +1580,7 @@ sub CreateMetadataForAttributes my $type = "sai_" . lc($1) . "_attr_t"; - WriteSource " metadata_object_type_$type,"; + WriteSource " sai_metadata_object_type_$type,"; } WriteSource " NULL"; @@ -1583,8 +1588,8 @@ sub CreateMetadataForAttributes my $count = $#objects + 1; - WriteHeader "extern const size_t metadata_attr_by_object_type_count;"; - WriteSource "const size_t metadata_attr_by_object_type_count = $count;"; + WriteHeader "extern const size_t sai_metadata_attr_by_object_type_count;"; + WriteSource "const size_t sai_metadata_attr_by_object_type_count = $count;"; } sub CreateEnumHelperMethods @@ -1598,7 +1603,7 @@ sub CreateEnumHelperMethods WriteSource "const char* sai_metadata_get_$1_name("; WriteSource " _In_ $key value)"; WriteSource "{"; - WriteSource " return sai_metadata_get_enum_value_name(&metadata_enum_$key, value);"; + WriteSource " return sai_metadata_get_enum_value_name(&sai_metadata_enum_$key, value);"; WriteSource "}"; WriteHeader "extern const char* sai_metadata_get_$1_name("; @@ -1648,7 +1653,7 @@ sub ProcessStructObjects return "NULL" if not $type eq "sai_object_id_t"; - WriteSource "const sai_object_type_t metadata_struct_member_sai_${rawname}_t_${key}_allowed_objects[] = {"; + WriteSource "const sai_object_type_t sai_metadata_struct_member_sai_${rawname}_t_${key}_allowed_objects[] = {"; my $objects = $struct->{objects}; @@ -1659,7 +1664,7 @@ sub ProcessStructObjects WriteSource "};"; - return "metadata_struct_member_sai_${rawname}_t_${key}_allowed_objects"; + return "sai_metadata_struct_member_sai_${rawname}_t_${key}_allowed_objects"; } sub ProcessStructObjectLen @@ -1681,7 +1686,7 @@ sub ProcessStructEnumData { my $type = shift; - return "&metadata_enum_$type" if $type =~ /^sai_\w+_type_t$/; # enum + return "&sai_metadata_enum_$type" if $type =~ /^sai_\w+_type_t$/; # enum return "NULL"; } @@ -1701,7 +1706,7 @@ sub ProcessStructGetOid return "NULL" if $type ne "sai_object_id_t"; - my $fname = "struct_member_get_sai_${rawname}_t_${key}"; + my $fname = "sai_metadata_struct_member_get_sai_${rawname}_t_${key}"; WriteSource "sai_object_id_t $fname("; WriteSource " _In_ const sai_object_meta_key_t *object_meta_key)"; @@ -1718,7 +1723,7 @@ sub ProcessStructSetOid return "NULL" if $type ne "sai_object_id_t"; - my $fname = "struct_member_set_sai_${rawname}_t_${key}"; + my $fname = "sai_metadata_struct_member_set_sai_${rawname}_t_${key}"; WriteSource "void $fname("; WriteSource " _Inout_ sai_object_meta_key_t *object_meta_key,"; @@ -1749,7 +1754,7 @@ sub ProcessStructMembers my $getoid = ProcessStructGetOid($struct->{$key}{type}, $key, $rawname); my $setoid = ProcessStructSetOid($struct->{$key}{type}, $key, $rawname); - WriteSource "const sai_struct_member_info_t struct_member_sai_${rawname}_t_$key = {"; + WriteSource "const sai_struct_member_info_t sai_metadata_struct_member_sai_${rawname}_t_$key = {"; WriteSource " .membervaluetype = $valuetype,"; WriteSource " .membername = \"$key\","; @@ -1766,17 +1771,17 @@ sub ProcessStructMembers WriteSource "};"; } - WriteSource "const sai_struct_member_info_t* struct_members_sai_${rawname}_t[] = {"; + WriteSource "const sai_struct_member_info_t* sai_metadata_struct_members_sai_${rawname}_t[] = {"; for my $key (@keys) { - WriteSource " &struct_member_sai_${rawname}_t_$key,"; + WriteSource " &sai_metadata_struct_member_sai_${rawname}_t_$key,"; } WriteSource " NULL"; WriteSource "};"; - return "struct_members_sai_${rawname}_t"; + return "sai_metadata_struct_members_sai_${rawname}_t"; } sub ProcessStructMembersCount @@ -1828,7 +1833,7 @@ sub ProcessRevGraph { my ($depObjectType, $attrId) = split/,/,$dep; - my $membername = "metadata_${objectType}_rev_graph_member_$index"; + my $membername = "sai_metadata_${objectType}_rev_graph_member_$index"; push@membernames,$membername; @@ -1841,7 +1846,7 @@ sub ProcessRevGraph { # this is attribute - WriteSource " .attrmetadata = &metadata_attr_$attrId,"; + WriteSource " .attrmetadata = &sai_metadata_attr_$attrId,"; WriteSource " .structmember = NULL,"; } else @@ -1851,7 +1856,7 @@ sub ProcessRevGraph my $DEPOT = lc ($1) if $depObjectType =~ /SAI_OBJECT_TYPE_(\w+)/; WriteSource " .attrmetadata = NULL,"; - WriteSource " .structmember = &struct_member_sai_${DEPOT}_t_$attrId,"; + WriteSource " .structmember = &sai_metadata_struct_member_sai_${DEPOT}_t_$attrId,"; } WriteSource "};"; @@ -1859,7 +1864,7 @@ sub ProcessRevGraph $index++; } - WriteSource "const sai_rev_graph_member_t* metadata_${objectType}_rev_graph_members[] = {"; + WriteSource "const sai_rev_graph_member_t* sai_metadata_${objectType}_rev_graph_members[] = {"; for my $mn (@membernames) { @@ -1870,7 +1875,7 @@ sub ProcessRevGraph WriteSource "};"; - return "metadata_${objectType}_rev_graph_members"; + return "sai_metadata_${objectType}_rev_graph_members"; } sub CreateStructNonObjectId @@ -1889,7 +1894,7 @@ sub CreateStructNonObjectId my $type = "sai_" . lc($1) . "_attr_t"; - my $enum = "&metadata_enum_${type}"; + my $enum = "&sai_metadata_enum_${type}"; my $struct = $STRUCTS{$ot}; @@ -1903,7 +1908,7 @@ sub ProcessStructMembersName return "NULL" if not defined $struct; - return "struct_members_sai_${rawname}_t"; + return "sai_metadata_struct_members_sai_${rawname}_t"; } sub ProcessCreate @@ -1915,7 +1920,7 @@ sub ProcessCreate my $api = $OBJTOAPIMAP{$ot}; - WriteSource "sai_status_t sai_meta_generic_create_$ot("; + WriteSource "sai_status_t sai_metadata_generic_create_$ot("; WriteSource " _Inout_ sai_object_meta_key_t *meta_key,"; WriteSource " _In_ sai_object_id_t switch_id,"; WriteSource " _In_ uint32_t attr_count,"; @@ -1940,7 +1945,7 @@ sub ProcessCreate WriteSource "}"; - return "sai_meta_generic_create_$ot"; + return "sai_metadata_generic_create_$ot"; } sub ProcessRemove @@ -1952,7 +1957,7 @@ sub ProcessRemove my $api = $OBJTOAPIMAP{$ot}; - WriteSource "sai_status_t sai_meta_generic_remove_$ot("; + WriteSource "sai_status_t sai_metadata_generic_remove_$ot("; WriteSource " _In_ const sai_object_meta_key_t *meta_key)"; WriteSource "{"; @@ -1967,7 +1972,7 @@ sub ProcessRemove WriteSource "}"; - return "sai_meta_generic_remove_$ot"; + return "sai_metadata_generic_remove_$ot"; } sub ProcessSet @@ -1979,7 +1984,7 @@ sub ProcessSet my $api = $OBJTOAPIMAP{$ot}; - WriteSource "sai_status_t sai_meta_generic_set_$ot("; + WriteSource "sai_status_t sai_metadata_generic_set_$ot("; WriteSource " _In_ const sai_object_meta_key_t *meta_key,"; WriteSource " _In_ const sai_attribute_t *attr)"; WriteSource "{"; @@ -1995,7 +2000,7 @@ sub ProcessSet WriteSource "}"; - return "sai_meta_generic_set_$ot"; + return "sai_metadata_generic_set_$ot"; } sub ProcessGet @@ -2007,7 +2012,7 @@ sub ProcessGet my $api = $OBJTOAPIMAP{$ot}; - WriteSource "sai_status_t sai_meta_generic_get_$ot("; + WriteSource "sai_status_t sai_metadata_generic_get_$ot("; WriteSource " _In_ const sai_object_meta_key_t *meta_key,"; WriteSource " _In_ uint32_t attr_count,"; WriteSource " _Inout_ sai_attribute_t *attr_list)"; @@ -2024,7 +2029,7 @@ sub ProcessGet WriteSource "}"; - return "sai_meta_generic_get_$ot"; + return "sai_metadata_generic_get_$ot"; } sub CreateApis @@ -2042,7 +2047,7 @@ sub CreateApisQuery WriteHeader " _In_ sai_api_t sai_api_id,"; WriteHeader " _Out_ void** api_method_table);"; - WriteSource "int sai_meta_apis_query("; + WriteSource "int sai_metadata_apis_query("; WriteSource " _In_ const sai_api_query_fn api_query)"; WriteSource "{"; WriteSource " sai_status_t status = SAI_STATUS_SUCCESS;"; @@ -2071,7 +2076,7 @@ sub CreateApisQuery WriteSource "}"; - WriteHeader "extern int sai_meta_apis_query("; + WriteHeader "extern int sai_metadata_apis_query("; WriteHeader " _In_ const sai_api_query_fn api_query);"; } @@ -2094,7 +2099,7 @@ sub CreateObjectInfo my $start = "SAI_" . uc($1) . "_ATTR_START"; my $end = "SAI_" . uc($1) . "_ATTR_END"; - my $enum = "&metadata_enum_${type}"; + my $enum = "&sai_metadata_enum_${type}"; my $struct = $STRUCTS{$ot}; @@ -2125,16 +2130,17 @@ sub CreateObjectInfo $get = ProcessGet($struct, $ot); } - WriteHeader "extern const sai_object_type_info_t sai_object_type_info_$ot;"; + WriteHeader "extern const sai_object_type_info_t sai_metadata_object_type_info_$ot;"; - WriteSource "const sai_object_type_info_t sai_object_type_info_$ot = {"; + WriteSource "const sai_object_type_info_t sai_metadata_object_type_info_$ot = {"; WriteSource " .objecttype = $ot,"; WriteSource " .objecttypename = \"$ot\","; WriteSource " .attridstart = $start,"; WriteSource " .attridend = $end,"; WriteSource " .enummetadata = $enum,"; - WriteSource " .attrmetadata = metadata_object_type_$type,"; + WriteSource " .attrmetadata = sai_metadata_object_type_$type,"; WriteSource " .isnonobjectid = $isnonobjectid,"; + WriteSource " .isobjectid = !$isnonobjectid,"; WriteSource " .structmembers = $structmembers,"; WriteSource " .structmemberscount = $structmemberscount,"; WriteSource " .revgraphmembers = $revgraph,"; @@ -2145,9 +2151,9 @@ sub CreateObjectInfo WriteSource "};"; } - WriteHeader "extern const sai_object_type_info_t* sai_all_object_type_infos[];"; + WriteHeader "extern const sai_object_type_info_t* sai_metadata_all_object_type_infos[];"; - WriteSource "const sai_object_type_info_t* sai_all_object_type_infos[] = {"; + WriteSource "const sai_object_type_info_t* sai_metadata_all_object_type_infos[] = {"; for my $ot (@objects) { @@ -2163,7 +2169,7 @@ sub CreateObjectInfo next; } - WriteSource " &sai_object_type_info_$ot,"; + WriteSource " &sai_metadata_object_type_info_$ot,"; } WriteSource " NULL"; @@ -2183,6 +2189,7 @@ sub ReadHeaderFile { my $filename = shift; local $/ = undef; + open FILE, "$INCLUDEDIR/$filename" or die "Couldn't open file $INCLUDEDIR/$filename: $!"; binmode FILE; my $string = ; @@ -2230,6 +2237,19 @@ sub DefineTestName WriteTest "void $name(void)"; } +sub CreatePointersTest +{ + # we don't declare actual test, just global values + + for my $pointer (@pointers) + { + # make sure taht declared pointer is correct + # by testing if it will compile in test + + WriteTest "$pointer var_$pointer = NULL;"; + } +} + sub CreateNonObjectIdTest { DefineTestName "non_object_id_test"; @@ -2260,6 +2280,53 @@ sub CreateNonObjectIdTest WriteTest "}"; } +sub CreateCustomRangeTest +{ + DefineTestName "custom_range_test"; + + # purpose of this test is to make sure + # all objects define custom range start and end markers + + WriteTest "{"; + + my @all = @{ $SAI_ENUMS{sai_object_type_t}{values} }; + + for my $obj (@all) + { + next if $obj eq "SAI_OBJECT_TYPE_NULL"; + next if $obj eq "SAI_OBJECT_TYPE_MAX"; + + next if not $obj =~ /SAI_OBJECT_TYPE_(\w+)/; + + WriteTest " TEST_ASSERT_TRUE(SAI_$1_ATTR_CUSTOM_RANGE_START == 0x10000000, \"invalid custom range start for $1\");"; + WriteTest " TEST_ASSERT_TRUE(SAI_$1_ATTR_CUSTOM_RANGE_END > 0x10000000, \"invalid custom range end for $1\");"; + } + + WriteTest "}"; +} + +sub CreateEnumSizeCheckTest +{ + DefineTestName "enum_size_check_test"; + + WriteTest "{"; + + # purpose of this test is to check if all enums size is int32_t in this compiler + # since serialize/deserialize enums make assumption that enum base is int32_t + + for my $key (sort keys %SAI_ENUMS) + { + next if not $key =~ /^(sai_\w+_t)$/; + next if $key =~ /^(sai_null_attr_t)$/; + + WriteTest " if (sizeof($1) != sizeof(int32_t)) exit(1);"; + } + + WriteTest " if (sizeof(sai_status_t) != sizeof(int32_t)) exit(1);"; + + WriteTest "}"; +} + sub ExtractStructInfo { my $struct = shift; @@ -2430,14 +2497,14 @@ sub CreateListOfAllAttributes } } - WriteSource "const sai_attr_metadata_t* metadata_attr_sorted_by_id_name[] = {"; - WriteHeader "extern const sai_attr_metadata_t* metadata_attr_sorted_by_id_name[];"; + WriteSource "const sai_attr_metadata_t* sai_metadata_attr_sorted_by_id_name[] = {"; + WriteHeader "extern const sai_attr_metadata_t* sai_metadata_attr_sorted_by_id_name[];"; my @keys = sort keys %ATTRIBUTES; for my $attr (@keys) { - WriteSource " &metadata_attr_$attr,"; + WriteSource " &sai_metadata_attr_$attr,"; } my $count = @keys; @@ -2445,8 +2512,8 @@ sub CreateListOfAllAttributes WriteSource " NULL"; WriteSource "};"; - WriteSource "const size_t metadata_attr_sorted_by_id_name_count = $count;"; - WriteHeader "extern const size_t metadata_attr_sorted_by_id_name_count;"; + WriteSource "const size_t sai_metadata_attr_sorted_by_id_name_count = $count;"; + WriteHeader "extern const size_t sai_metadata_attr_sorted_by_id_name_count;"; } sub CheckWhiteSpaceInHeaders @@ -2552,6 +2619,39 @@ sub CheckApiDefines } } +sub CheckDoxygenStyle +{ + my ($header, $line, $n) = @_; + + return if (not $line =~ /\@(\w+)/); + + my $mark = $1; + + if ($mark eq "file" and not $line =~ /\@file\s+($header)/) + { + LogWarning "\@file should match format: sai\\w+.h: $header $n:$line"; + return; + } + + if ($mark eq "brief" and not $line =~ /\@brief\s+[A-Z]/) + { + LogWarning "\@brief should start with capital letter: $header $n:$line"; + return; + } + + if ($mark eq "return" and not $line =~ /\@return\s+#/) + { + LogWarning "\@return should start with #: $header $n:$line"; + return; + } + + if ($mark eq "param" and not $line =~ /\@param\[(in|out|inout)\]\s+([a-z]\w+)\s+([A-Z]\w+)/) + { + LogWarning "\@param should be in format \@param[in|out|inout] [A-Z]\\w+: $header $n:$line"; + return; + } +} + sub CheckHeadersStyle { # @@ -2566,6 +2666,32 @@ sub CheckHeadersStyle my @headers = GetHeaderFiles(); + my @magicWords = qw/SAI IP MAC L2 ACL L3 GRE ECMP EEE FDB FD FEC ICMP I2C + HW IEEE IP2ME L2MC LAG ARP ASIC BGP CAM CBS CB CIR CIDR CRC DLL CPU TTL + TOS ECN DSCP TC MACST MTU NPU PFC PBS PCI PIR QOS RFC RFP SDK RSPAN + ERSPAN SPAN SNMP SSH STP TCAM TCP UDP TPID UDF UOID VNI VR VRRP WCMP + WWW API CCITT RARP CFI MPLS IPMC RPF WRED XON XOFF NHLFE SG/; + + # we could put that to local dictionary file + + my @spellExceptions = qw/ http www apache MERCHANTABILITY Mellanox defgroup + Enum param attr VLAN IPv4 IPv6 Vlan inout policer Src Dst Decrement + lookups optimizations lookup bool EtherType tx rx validonly enum sai + loopback Multicast isvlan 6th nexthop nexthopgroup encap decap src dst + wildcard Wilcard const APIs multi multicast LAGs Linux mcast HQoS + childs callee Callee boolean attrvalue unicast Unicast untagged + Untagged Policer objlist BGPv6 allownull 0xFF Hostif samplepacket + Samplepacket pkts Loopback linklocal lossless Mbps vlan ucast + ingressing MCAST netdev AUTONEG decapsulation egressing functionalities + rv subnet subnets Uninitialize versa VRFs Netdevice netdevs PGs CRC32 + HQOS Wildcard VLANs VLAN2 SerDes FC Wakeup warmboot Inservice PVID PHY + /; + + my %exceptions = map { $_ => $_ } @spellExceptions; + + my %wordsToCheck = (); + my %wordsChecked = (); + for my $header (@headers) { my $data = ReadHeaderFile($header); @@ -2639,6 +2765,72 @@ sub CheckHeadersStyle LogWarning "$1 should be equal to $2" if (($1 ne $2) and not($1 =~ /^bulk/)) } + if ($line =~ /_(?:In|Out)\w+\s+(?:sai_)?uint32_t\s*\*?(\w+)/) + { + my $param = $1; + + my $pattern = '^(attr_count|object_count|number_of_counters|count)$'; + + if (not $param =~ /$pattern/) + { + LogWarning "param $1 should match $pattern $header:$n:$line"; + } + } + + my $pattern = join"|",@magicWords; + + while ($line =~ /\b($pattern)\b/igp) + { + my $pre = $`; + my $post = $'; + + # force special word to be capital + + my $word = $1; + + next if $word =~ /^($pattern)$/; + next if $line =~ /$word.h/; + next if not $line =~ /\*/; # must contain star, so will be comment + next if "$pre$word" =~ m!http://$word$!; + + LogWarning "Word '$word' should use capital letters $header $n:$line"; + } + + # perform aspell checking (move to separate method) + + if ($line =~ m!^\s*(\*|/\*\*)!) + { + while ($line =~ /\b([a-z0-9']+)\b/ig) + { + my $pre = $`; + my $post = $'; + my $word = $1; + + next if $word =~ /^($pattern)$/; # capital words + + # look into good and bad words hash to speed things up + + next if defined $exceptions{$word}; + next if $word =~/^sai\w+/i; + next if $word =~/0x\S+L/; + next if $word =~/\S+L/; + next if "$pre$word" =~/802.\d+\w+/; + + next if defined $wordsChecked{$word}; + + $wordsChecked{$word} = 1; + + $wordsToCheck{$word} = "$header $n:$line"; + } + } + + if ($line =~ /\\/ and not $line =~ /\\[0\[\]]/) + { + LogWarning "line contains \\ which should not be used in this way $header $n:$line"; + } + + CheckDoxygenStyle($header, $line, $n); + next if $line =~ /^ \*/; # doxygen comment next if $line =~ /^$/; # empty line next if $line =~ /^typedef /; # type definition @@ -2657,9 +2849,58 @@ sub CheckHeadersStyle next if $line =~ /^ {8}bool booldata/; # union bool next if $line =~ /^ {4}(true|false)/; # bool definition - LogWarning "header don't meet style requirements (most likely ident is not 4 or 8 spaces) $header $n:$line"; + LogWarning "Header doesn't meet style requirements (most likely ident is not 4 or 8 spaces) $header $n:$line"; } } + + if (not -e "/usr/bin/aspell") + { + LogInfo "ASPELL IS NOT PRESENT, will skip check"; + return; + } + + LogInfo "Running Aspell"; + + my @keys = sort keys %wordsToCheck; + + my $count = @keys; + + my $all = "@keys"; + + LogInfo "Words to check: $count"; + + my @result = `echo "$all" | /usr/bin/aspell -l en -a`; + + for my $res (@result) + { + next if not $res =~ /^\s*&\s*(\S+)/; + + my $word = $1; + + chomp $res; + + my $where = "??"; + + if (not defined $wordsToCheck{$word}) + { + for my $k (@keys) + { + if ($k =~/(^$word|$word$)/) + { + $where = $wordsToCheck{$k}; + last; + } + + $where = $wordsToCheck{$k} if ($k =~/$word/); + } + } + else + { + $where = $wordsToCheck{$word}; + } + + LogWarning "Word '$word' is misspelled $where"; + } } sub ExtractApiToObjectMap @@ -2872,8 +3113,8 @@ sub WriteLoggerVariables # but now seems to be unnecessary # - WriteSource "volatile sai_log_level_t sai_meta_log_level = SAI_LOG_LEVEL_NOTICE;"; - WriteSource "volatile sai_meta_log_fn sai_meta_log = NULL;"; + WriteSource "volatile sai_log_level_t sai_metadata_log_level = SAI_LOG_LEVEL_NOTICE;"; + WriteSource "volatile sai_metadata_log_fn sai_metadata_log = NULL;"; } my %ProcessedItems = (); @@ -3001,6 +3242,12 @@ sub CheckAttributeValueUnion CreateNonObjectIdTest(); +CreateCustomRangeTest(); + +CreatePointersTest(); + +CreateEnumSizeCheckTest(); + WriteTestMain(); WriteLoggerVariables(); diff --git a/meta/saidepgraphgen.cpp b/meta/saidepgraphgen.cpp index adbdad3d0..7c242ed8f 100644 --- a/meta/saidepgraphgen.cpp +++ b/meta/saidepgraphgen.cpp @@ -12,7 +12,7 @@ extern "C" { } // node name -#define NN(x) (metadata_enum_sai_object_type_t.valuesshortnames[(x)]) +#define NN(x) (sai_metadata_enum_sai_object_type_t.valuesshortnames[(x)]) std::set source; std::set target; @@ -109,9 +109,9 @@ void process_object_type_attributes( void process_object_types() { - for (int i = 0; metadata_attr_by_object_type[i] != NULL; ++i) + for (int i = 0; sai_metadata_attr_by_object_type[i] != NULL; ++i) { - const sai_attr_metadata_t** meta = metadata_attr_by_object_type[i]; + const sai_attr_metadata_t** meta = sai_metadata_attr_by_object_type[i]; process_object_type_attributes(meta, (sai_object_type_t)i); } @@ -119,7 +119,7 @@ void process_object_types() void process_colors() { - for (int i = 0; metadata_attr_by_object_type[i] != NULL; ++i) + for (int i = 0; sai_metadata_attr_by_object_type[i] != NULL; ++i) { sai_object_type_t ot = (sai_object_type_t)i; @@ -154,7 +154,7 @@ void process_colors() for (size_t i = SAI_OBJECT_TYPE_NULL; i < SAI_OBJECT_TYPE_MAX; ++i) { - const sai_object_type_info_t* oi = sai_all_object_type_infos[i]; + const sai_object_type_info_t* oi = sai_metadata_all_object_type_infos[i]; if (oi == NULL) { @@ -179,7 +179,7 @@ void process_nonobjectid_connections() for (size_t i = SAI_OBJECT_TYPE_NULL; i < SAI_OBJECT_TYPE_MAX; ++i) { - const sai_object_type_info_t* oi = sai_all_object_type_infos[i]; + const sai_object_type_info_t* oi = sai_metadata_all_object_type_infos[i]; if (oi == NULL) { diff --git a/meta/saimetadatalogger.h b/meta/saimetadatalogger.h index 0e67458fc..c93e416bc 100644 --- a/meta/saimetadatalogger.h +++ b/meta/saimetadatalogger.h @@ -8,7 +8,7 @@ * 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, MERCHANTABLITY OR NON-INFRINGEMENT. + * 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. @@ -17,16 +17,16 @@ * assistance with these files: Intel Corporation, Mellanox Technologies Ltd, * Dell Products, L.P., Facebook, Inc * - * @file saimetadatatypes.h + * @file saimetadatalogger.h * - * @brief This module defines SAI Metadata Types + * @brief This module defines SAI Metadata Logger */ #ifndef __SAI_METADATA_LOGGER_H__ #define __SAI_METADATA_LOGGER_H__ /** - * @defgroup SAIMETADATALOGGER SAI Metadata Types Definitions + * @defgroup SAIMETADATALOGGER SAI Metadata Logger Definitions * * @{ */ @@ -34,10 +34,10 @@ /** * @brief Log level function definition. * - * User can sepcify his own function thah will be called when message log level - * will be greater or equal to #sai_meta_log_level. + * User can specify his own function that will be called when message log level + * will be greater or equal to #sai_metadata_log_level. */ -typedef void (*sai_meta_log_fn)( +typedef void (*sai_metadata_log_fn)( _In_ sai_log_level_t log_level, _In_ const char *file, _In_ int line, @@ -50,16 +50,16 @@ typedef void (*sai_meta_log_fn)( * * TODO: add a set function to update this? */ -extern volatile sai_meta_log_fn sai_meta_log; +extern volatile sai_metadata_log_fn sai_metadata_log; /** - * @brief Log level for sai metadat macros. + * @brief Log level for sai metadata macros. * * Log level can be changed by user at any time. * * TODO: add a set function to update this? */ -extern volatile sai_log_level_t sai_meta_log_level; +extern volatile sai_log_level_t sai_metadata_log_level; /** * @brief Helper log macro definition @@ -68,12 +68,12 @@ extern volatile sai_log_level_t sai_meta_log_level; * function will validate parameters at compilation time. */ #define SAI_META_LOG(loglevel,format,...)\ - if (loglevel >= sai_meta_log_level)\ + if (loglevel >= sai_metadata_log_level)\ {\ - if (sai_meta_log == NULL) /* or syslog? */ \ + if (sai_metadata_log == NULL) /* or syslog? */ \ fprintf(stderr, "%s:%d %s: " format "\n", __FILE__, __LINE__, __func__, ##__VA_ARGS__);\ else\ - sai_meta_log(loglevel, __FILE__, __LINE__, __func__, format, ##__VA_ARGS__);\ + sai_metadata_log(loglevel, __FILE__, __LINE__, __func__, format, ##__VA_ARGS__);\ } /* diff --git a/meta/saimetadatatypes.h b/meta/saimetadatatypes.h index a89952c25..ae7a35f82 100644 --- a/meta/saimetadatatypes.h +++ b/meta/saimetadatatypes.h @@ -8,7 +8,7 @@ * 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, MERCHANTABLITY OR NON-INFRINGEMENT. + * 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. @@ -135,7 +135,7 @@ typedef enum _sai_attr_value_type_t { SAI_ATTR_VALUE_TYPE_IP_ADDRESS, /** - * @brief Attribute value is ip prefix + * @brief Attribute value is IP prefix */ SAI_ATTR_VALUE_TYPE_IP_PREFIX, @@ -195,122 +195,122 @@ typedef enum _sai_attr_value_type_t { SAI_ATTR_VALUE_TYPE_VLAN_LIST, /** - * @brief Attribute value is acl field bool. + * @brief Attribute value is ACL field bool. */ SAI_ATTR_VALUE_TYPE_ACL_FIELD_DATA_BOOL, /** - * @brief Attribute value is acl field 8 bit unsigned integer. + * @brief Attribute value is ACL field 8 bit unsigned integer. */ SAI_ATTR_VALUE_TYPE_ACL_FIELD_DATA_UINT8, /** - * @brief Attribute value is acl field 8 bit signed integer. + * @brief Attribute value is ACL field 8 bit signed integer. */ SAI_ATTR_VALUE_TYPE_ACL_FIELD_DATA_INT8, /** - * @brief Attribute value is acl field 16 bit unsigned integer. + * @brief Attribute value is ACL field 16 bit unsigned integer. */ SAI_ATTR_VALUE_TYPE_ACL_FIELD_DATA_UINT16, /** - * @brief Attribute value is acl field 16 bit signed integer. + * @brief Attribute value is ACL field 16 bit signed integer. */ SAI_ATTR_VALUE_TYPE_ACL_FIELD_DATA_INT16, /** - * @brief Attribute value is acl field 32 bit unsigned integer. + * @brief Attribute value is ACL field 32 bit unsigned integer. */ SAI_ATTR_VALUE_TYPE_ACL_FIELD_DATA_UINT32, /** - * @brief Attribute value is acl field 32 bit signed integer. + * @brief Attribute value is ACL field 32 bit signed integer. */ SAI_ATTR_VALUE_TYPE_ACL_FIELD_DATA_INT32, /** - * @brief Attribute value is acl field mac address. + * @brief Attribute value is ACL field mac address. */ SAI_ATTR_VALUE_TYPE_ACL_FIELD_DATA_MAC, /** - * @brief Attribute value is acl field IPv4. + * @brief Attribute value is ACL field IPv4. */ SAI_ATTR_VALUE_TYPE_ACL_FIELD_DATA_IPV4, /** - * @brief Attribute value is acl field IPv6. + * @brief Attribute value is ACL field IPv6. */ SAI_ATTR_VALUE_TYPE_ACL_FIELD_DATA_IPV6, /** - * @brief Attribute value is acl field object id. + * @brief Attribute value is ACL field object id. */ SAI_ATTR_VALUE_TYPE_ACL_FIELD_DATA_OBJECT_ID, /** - * @brief Attribute value is acl field object list. + * @brief Attribute value is ACL field object list. */ SAI_ATTR_VALUE_TYPE_ACL_FIELD_DATA_OBJECT_LIST, /** - * @brief Attribute value is acl field list of 8 bit unsigned integers. + * @brief Attribute value is ACL field list of 8 bit unsigned integers. */ SAI_ATTR_VALUE_TYPE_ACL_FIELD_DATA_UINT8_LIST, /** - * @brief Attribute value is acl action 8 bit unsigned integer. + * @brief Attribute value is ACL action 8 bit unsigned integer. */ SAI_ATTR_VALUE_TYPE_ACL_ACTION_DATA_UINT8, /** - * @brief Attribute value is acl action 8 bit signed integer. + * @brief Attribute value is ACL action 8 bit signed integer. */ SAI_ATTR_VALUE_TYPE_ACL_ACTION_DATA_INT8, /** - * @brief Attribute value is acl action 16 bit unsigned integer. + * @brief Attribute value is ACL action 16 bit unsigned integer. */ SAI_ATTR_VALUE_TYPE_ACL_ACTION_DATA_UINT16, /** - * @brief Attribute value is acl action 16 bit signed integer. + * @brief Attribute value is ACL action 16 bit signed integer. */ SAI_ATTR_VALUE_TYPE_ACL_ACTION_DATA_INT16, /** - * @brief Attribute value is acl action 32 bit unsigned integer. + * @brief Attribute value is ACL action 32 bit unsigned integer. */ SAI_ATTR_VALUE_TYPE_ACL_ACTION_DATA_UINT32, /** - * @brief Attribute value is acl action 32 bit signed integer. + * @brief Attribute value is ACL action 32 bit signed integer. */ SAI_ATTR_VALUE_TYPE_ACL_ACTION_DATA_INT32, /** - * @brief Attribute value is acl action mac address. + * @brief Attribute value is ACL action mac address. */ SAI_ATTR_VALUE_TYPE_ACL_ACTION_DATA_MAC, /** - * @brief Attribute value is acl action IPv4. + * @brief Attribute value is ACL action IPv4. */ SAI_ATTR_VALUE_TYPE_ACL_ACTION_DATA_IPV4, /** - * @brief Attribute value is acl action IPV6. + * @brief Attribute value is ACL action IPV6. */ SAI_ATTR_VALUE_TYPE_ACL_ACTION_DATA_IPV6, /** - * @brief Attribute value is acl action object id. + * @brief Attribute value is ACL action object id. */ SAI_ATTR_VALUE_TYPE_ACL_ACTION_DATA_OBJECT_ID, /** - * @brief Attribute value is acl action object list. + * @brief Attribute value is ACL action object list. */ SAI_ATTR_VALUE_TYPE_ACL_ACTION_DATA_OBJECT_LIST, @@ -325,7 +325,7 @@ typedef enum _sai_attr_value_type_t { SAI_ATTR_VALUE_TYPE_TUNNEL_MAP_LIST, /** - * @brief Attribute value is acl capability. + * @brief Attribute value is ACL capability. */ SAI_ATTR_VALUE_TYPE_ACL_CAPABILITY, @@ -359,7 +359,7 @@ typedef enum _sai_attr_flags_t { * @brief Create and set flag. * * Attribute with this flag can be created and after creation value may be - * modified using SET api. Can be bombined with MANDATORY flag. If + * modified using SET api. Can be combined with MANDATORY flag. If * attribute is not combined with MANDATORY flag then DEFAULT value must be * provided for this attribute. */ @@ -413,37 +413,37 @@ typedef enum _sai_attr_flags_t { } sai_attr_flags_t; /** - * @def Defines helper to chek if mandatory on create falg is set. + * @def Defines helper to check if mandatory on create flag is set. */ #define HAS_FLAG_MANDATORY_ON_CREATE(x) (((x) & SAI_ATTR_FLAGS_MANDATORY_ON_CREATE) == SAI_ATTR_FLAGS_MANDATORY_ON_CREATE) /** - * @def Defines helper to chek if create only falg is set. + * @def Defines helper to check if create only flag is set. */ #define HAS_FLAG_CREATE_ONLY(x) (((x) & SAI_ATTR_FLAGS_CREATE_ONLY) == SAI_ATTR_FLAGS_CREATE_ONLY) /** - * @def Defines helper to chek if create and set falg is set. + * @def Defines helper to check if create and set flag is set. */ #define HAS_FLAG_CREATE_AND_SET(x) (((x) & SAI_ATTR_FLAGS_CREATE_AND_SET) == SAI_ATTR_FLAGS_CREATE_AND_SET) /** - * @def Defines helper to chek if read only falg is set. + * @def Defines helper to check if read only flag is set. */ #define HAS_FLAG_READ_ONLY(x) (((x) & SAI_ATTR_FLAGS_READ_ONLY) == SAI_ATTR_FLAGS_READ_ONLY) /** - * @def Defines helper to chek if key falg is set. + * @def Defines helper to check if key flag is set. */ #define HAS_FLAG_KEY(x) (((x) & SAI_ATTR_FLAGS_KEY) == SAI_ATTR_FLAGS_KEY) /** - * @def Defines helper to chek if dynamic falg is set. + * @def Defines helper to check if dynamic flag is set. */ #define HAS_FLAG_DYNAMIC(x) (((x) & SAI_ATTR_FLAGS_DYNAMIC) == SAI_ATTR_FLAGS_DYNAMIC) /** - * @def Defines helper to chek if special falg is set. + * @def Defines helper to check if special flag is set. */ #define HAS_FLAG_SPECIAL(x) (((x) & SAI_ATTR_FLAGS_SPECIAL) == SAI_ATTR_FLAGS_SPECIAL) @@ -468,8 +468,8 @@ typedef enum _sai_default_value_type_t { /** * @brief Value must be in range provided by other attribute. * - * Usually value is provieded by switch object. - * Range can be obtined by GET api. + * Usually value is provided by switch object. + * Range can be obtained by GET api. * Usually default value is minimum of range. */ SAI_DEFAULT_VALUE_TYPE_ATTR_RANGE, @@ -518,7 +518,7 @@ typedef enum _sai_default_value_type_t { typedef enum _sai_attr_condition_type_t { /** - * @brief This attribute is not conditional atttribute + * @brief This attribute is not conditional attribute */ SAI_ATTR_CONDITION_TYPE_NONE = 0, @@ -529,7 +529,7 @@ typedef enum _sai_attr_condition_type_t SAI_ATTR_CONDITION_TYPE_OR, /** - * @brief All condictions must meet for this attribute + * @brief All conditions must meet for this attribute * to be mandatory on create. */ SAI_ATTR_CONDITION_TYPE_AND, @@ -657,6 +657,11 @@ typedef struct _sai_attr_metadata_t */ bool allownullobjectid; + /** + * @brief Determines whether object contains OIDs. + */ + bool isoidattribute; + /** * @brief Specifies default value type. * @@ -675,8 +680,8 @@ typedef struct _sai_attr_metadata_t * If creation flag is CREATE_ONLY or CREATE_AND_SET * then default value must be provided for attribute. * - * @note Default value may not apply for acl field - * or acl entry, need special care. + * @note Default value may not apply for ACL field + * or ACL entry, need special care. */ const sai_attribute_value_t* const defaultvalue; @@ -697,7 +702,7 @@ typedef struct _sai_attr_metadata_t sai_attr_id_t defaultvalueattrid; /** - * @brief Indicates wheter attribute is enum value. + * @brief Indicates whether attribute is enum value. * * Attribute type must be set as INT32. * @@ -707,7 +712,7 @@ typedef struct _sai_attr_metadata_t bool isenum; /** - * @brief Indicates wheter attribute is enum list value. + * @brief Indicates whether attribute is enum list value. * * Attribute value must must be set INT32 LIST. * @@ -743,7 +748,7 @@ typedef struct _sai_attr_metadata_t size_t conditionslength; /** - * @brief Indicates wheter attribute is conditional. + * @brief Indicates whether attribute is conditional. */ bool isconditional; @@ -761,7 +766,7 @@ typedef struct _sai_attr_metadata_t * * If conditions are specified (OR condition assumed) * then this attribute is only valid when different - * atribute has condition value set. Valid only + * attribute has condition value set. Valid only * attribute (against we check) can be dynamic so * this attribute can't be marked as MANDATORY on * create since default value will be required. @@ -778,13 +783,13 @@ typedef struct _sai_attr_metadata_t size_t validonlylength; /** - * @brief When calling GET api result will be put + * @brief When calling GET API result will be put * in local db for future use (extra logic). * * This flag must be taken with care, since when set * on dynamic attribute it may provide inconsistent data. * - * Value should be updated after successfull set or remove. + * Value should be updated after successful set or remove. */ bool getsave; @@ -798,15 +803,15 @@ typedef struct _sai_attr_metadata_t /** * @brief Determines whether attribute is ACL field * - * This will become handy for fast detrmination whether + * This will become handy for fast determination whether * default value is present. */ bool isaclfield; - /* + /** * @brief Determines whether attribute is ACL action * - * This will become handy for fast detrmination whether + * This will become handy for fast determination whether * default value is present. */ bool isaclaction; @@ -814,7 +819,7 @@ typedef struct _sai_attr_metadata_t } sai_attr_metadata_t; /* - * TODO since non object id members can have different type and can be localed + * TODO since non object id members can have different type and can be located * at different object_key union position, we need to find a way to extract * those for automatic serialize/deserialize for example extracting value as * sai_attribute_value_t and pointing to right serialize/deserialize functions. @@ -823,14 +828,14 @@ typedef struct _sai_attr_metadata_t */ /** - * @brief Function definition for getting OID from non obeject + * @brief Function definition for getting OID from non object * id struct member. */ typedef sai_object_id_t (*sai_meta_get_struct_member_oid_fn)( _In_ const sai_object_meta_key_t *object_meta_key); /** - * @brief Function definition for setting OID from non obeject + * @brief Function definition for setting OID from non object * id struct member. */ typedef void (*sai_meta_set_struct_member_oid_fn)( @@ -844,7 +849,7 @@ typedef void (*sai_meta_set_struct_member_oid_fn)( typedef struct _sai_struct_member_info_t { /** - * @brief Member vlaue type + * @brief Member value type */ sai_attr_value_type_t membervaluetype; @@ -872,7 +877,7 @@ typedef struct _sai_struct_member_info_t size_t allowedobjecttypeslength; /** - * @brief Indicates wheter member is enum value. + * @brief Indicates whether member is enum value. * * Type must be set as INT32. * @@ -920,7 +925,7 @@ typedef struct _sai_rev_graph_member_t /** * @brief Defines attribute metadata for object type * - * This can be NULL if dependency objec type + * This can be NULL if dependency object type * is non object id type and dependency is on * defined struct. */ @@ -939,20 +944,20 @@ typedef struct _sai_rev_graph_member_t } sai_rev_graph_member_t; /* - * Generic QUAD api definitions. All apis can be called using this quad genric + * Generic QUAD API definitions. All APIs can be called using this quad generic * functions. * * When creating switch object or non object id switch_id parameter is ignored, * and can be NULL. Currently objecttype inside sai_object_meta_key_t is * ignored and can be skipped. * - * This generic quad api will help us later to call any api, without doind any - * switch cases for calling differen signature functions including non object + * This generic quad API will help us later to call any api, without doing any + * switch cases for calling different signature functions including non object * id structs. Also later we will generate automatic serialize and deserialize * methods for non object id which will deserialize data to object union in * sai_object_meta_key_t to right place. * - * TODO add medatada init function which will populate global api function + * TODO add metadata init function which will populate global API function * pointers which will be used when calling each api. */ @@ -1012,10 +1017,15 @@ typedef struct _sai_object_type_info_t /** * @brief Indicates if object is using struct - * instead od actual object id + * instead of actual object id */ bool isnonobjectid; + /** + * @brief Indicates if object is oid object id + */ + bool isobjectid; + /** * @brief Defines all struct members */ diff --git a/meta/saimetadatautils.c b/meta/saimetadatautils.c index a5eaea973..fc3090782 100644 --- a/meta/saimetadatautils.c +++ b/meta/saimetadatautils.c @@ -57,7 +57,7 @@ const sai_attr_metadata_t* sai_metadata_get_attr_metadata( if ((objecttype > SAI_OBJECT_TYPE_NULL) && (objecttype < SAI_OBJECT_TYPE_MAX)) { - const sai_attr_metadata_t** md = metadata_attr_by_object_type[objecttype]; + const sai_attr_metadata_t** md = sai_metadata_attr_by_object_type[objecttype]; size_t index = 0; @@ -84,13 +84,13 @@ const sai_attr_metadata_t* sai_metadata_get_attr_metadata_by_attr_id_name( /* use binary search */ ssize_t first = 0; - ssize_t last = (ssize_t)(metadata_attr_sorted_by_id_name_count - 1); + ssize_t last = (ssize_t)(sai_metadata_attr_sorted_by_id_name_count - 1); while (first <= last) { ssize_t middle = (first + last) / 2; - int res = strcmp(attr_id_name, metadata_attr_sorted_by_id_name[middle]->attridname); + int res = strcmp(attr_id_name, sai_metadata_attr_sorted_by_id_name[middle]->attridname); if (res > 0) { @@ -104,7 +104,7 @@ const sai_attr_metadata_t* sai_metadata_get_attr_metadata_by_attr_id_name( { /* found */ - return metadata_attr_sorted_by_id_name[middle]; + return sai_metadata_attr_sorted_by_id_name[middle]; } } @@ -113,32 +113,6 @@ const sai_attr_metadata_t* sai_metadata_get_attr_metadata_by_attr_id_name( return NULL; } -bool sai_metadata_is_acl_field_or_action( - _In_ const sai_attr_metadata_t* metadata) -{ - if (metadata == NULL) - { - return false; - } - - if (metadata->objecttype == SAI_OBJECT_TYPE_ACL_ENTRY) - { - if (metadata->attrid >= SAI_ACL_ENTRY_ATTR_FIELD_START && - metadata->attrid <= SAI_ACL_ENTRY_ATTR_FIELD_END) - { - return true; - } - - if (metadata->attrid >= SAI_ACL_ENTRY_ATTR_ACTION_START && - metadata->attrid <= SAI_ACL_ENTRY_ATTR_ACTION_END) - { - return true; - } - } - - return false; -} - const char* sai_metadata_get_enum_value_name( _In_ const sai_enum_metadata_t* metadata, _In_ int value) @@ -183,3 +157,20 @@ const sai_attribute_t* sai_metadata_get_attr_by_id( return NULL; } + +const sai_object_type_info_t* sai_metadata_get_object_type_info( + _In_ sai_object_type_t object_type) +{ + if (sai_metadata_is_object_type_valid(object_type)) + { + return sai_metadata_all_object_type_infos[object_type]; + } + + return NULL; +} + +bool sai_metadata_is_object_type_valid( + _In_ sai_object_type_t object_type) +{ + return object_type > SAI_OBJECT_TYPE_NULL && object_type < SAI_OBJECT_TYPE_MAX; +} diff --git a/meta/saimetadatautils.h b/meta/saimetadatautils.h index 97343c837..c94011abc 100644 --- a/meta/saimetadatautils.h +++ b/meta/saimetadatautils.h @@ -8,7 +8,7 @@ * 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, MERCHANTABLITY OR NON-INFRINGEMENT. + * 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. @@ -57,23 +57,13 @@ extern bool sai_metadata_is_allowed_enum_value( _In_ const sai_attr_metadata_t* metadata, _In_ int value); -/** - * @brief Is attribute ACL field or action - * - * @param[in] metadata Attribute metadata - * - * @return True if is ACL field or action, false otherwise - */ -extern bool sai_metadata_is_acl_field_or_action( - _In_ const sai_attr_metadata_t* metadata); - /** * @brief Gets attribute metadata based on object type and attribute id * * @param[in] objecttype Object type * @param[in] attrid Attribute Id * - * @return Poionter to object metadata or NULL in case of failure + * @return Pointer to object metadata or NULL in case of failure */ extern const sai_attr_metadata_t* sai_metadata_get_attr_metadata( _In_ sai_object_type_t objecttype, @@ -84,7 +74,7 @@ extern const sai_attr_metadata_t* sai_metadata_get_attr_metadata( * * @param[in] attr_id_name Attribute id name * - * @return Poionter to object metadata or NULL in case of failure + * @return Pointer to object metadata or NULL in case of failure */ extern const sai_attr_metadata_t* sai_metadata_get_attr_metadata_by_attr_id_name( _In_ const char *attr_id_name); @@ -93,7 +83,7 @@ extern const sai_attr_metadata_t* sai_metadata_get_attr_metadata_by_attr_id_name * @brief Gets string representation of enum value * * @param[in] metadata Enum metadata - * @param[in] value Enum value to bo converted to string + * @param[in] value Enum value to be converted to string * * @return String representation of enum value or NULL if value was not found */ @@ -102,19 +92,38 @@ extern const char* sai_metadata_get_enum_value_name( _In_ int value); /** - * @brief Gets attribute from attribute list by attribyte id + * @brief Gets attribute from attribute list by attribute id * * @param[in] id Attribute id to be found * @param[in] attr_count Total number of attributes - * @param[in] attr_list List of attributest to search + * @param[in] attr_list List of attributes to search * - * @return Attriute pointer with requested ID or NULL if not found + * @return Attribute pointer with requested ID or NULL if not found */ extern const sai_attribute_t* sai_metadata_get_attr_by_id( _In_ sai_attr_id_t id, _In_ uint32_t attr_count, _In_ const sai_attribute_t *attr_list); +/** + * @brief Gets object type info + * + * @param[in] object_type Object type + * + * @return Object type info struct or NULL if not found + */ +extern const sai_object_type_info_t* sai_metadata_get_object_type_info( + _In_ sai_object_type_t object_type); + +/** + * @brief Checks if object type is valid + * + * @param[in] object_type Object type + * + * @return true if object type is valid, false otherwise + */ +extern bool sai_metadata_is_object_type_valid( + _In_ sai_object_type_t object_type); /** * @} */ diff --git a/meta/saisanitycheck.c b/meta/saisanitycheck.c index 34dd1457c..dc29fc1ac 100644 --- a/meta/saisanitycheck.c +++ b/meta/saisanitycheck.c @@ -74,11 +74,11 @@ void check_all_enums_name_pointers() size_t i = 0; - META_ASSERT_TRUE(metadata_all_enums_count > 100, "we need to have some enums"); + META_ASSERT_TRUE(sai_metadata_all_enums_count > 100, "we need to have some enums"); - for (; i < metadata_all_enums_count; ++i) + for (; i < sai_metadata_all_enums_count; ++i) { - const sai_enum_metadata_t* emd = metadata_all_enums[i]; + const sai_enum_metadata_t* emd = sai_metadata_all_enums[i]; META_ASSERT_NOT_NULL(emd); @@ -136,9 +136,9 @@ void check_all_enums_values() size_t i = 0; - for (; i < metadata_all_enums_count; ++i) + for (; i < sai_metadata_all_enums_count; ++i) { - const sai_enum_metadata_t* emd = metadata_all_enums[i]; + const sai_enum_metadata_t* emd = sai_metadata_all_enums[i]; META_LOG_INFO("enum: %s", emd->name); @@ -201,17 +201,17 @@ void check_sai_status() META_LOG_ENTER(); META_ASSERT_TRUE(SAI_STATUS_SUCCESS == 0, "success must be zero"); - META_ASSERT_TRUE(metadata_enum_sai_status_t.valuescount > 1, "there must be error codes"); + META_ASSERT_TRUE(sai_metadata_enum_sai_status_t.valuescount > 1, "there must be error codes"); size_t i = 0; int last = 1; - for (; i < metadata_enum_sai_status_t.valuescount; ++i) + for (; i < sai_metadata_enum_sai_status_t.valuescount; ++i) { - META_LOG_INFO("status: %s", metadata_enum_sai_status_t.valuesnames[i]); + META_LOG_INFO("status: %s", sai_metadata_enum_sai_status_t.valuesnames[i]); - int value = metadata_enum_sai_status_t.values[i]; + int value = sai_metadata_enum_sai_status_t.values[i]; if (i == 0) { @@ -230,17 +230,17 @@ void check_object_type() { META_LOG_ENTER(); - META_ASSERT_TRUE(SAI_OBJECT_TYPE_NULL == 0, "sai object type null mustbe zero"); + META_ASSERT_TRUE(SAI_OBJECT_TYPE_NULL == 0, "sai object type null must be zero"); size_t i = 0; int last = -1; /* will enforce NULL be first */ - for (; i < metadata_enum_sai_object_type_t.valuescount; ++i) + for (; i < sai_metadata_enum_sai_object_type_t.valuescount; ++i) { - META_LOG_INFO("object_type: %s", metadata_enum_sai_object_type_t.valuesnames[i]); + META_LOG_INFO("object_type: %s", sai_metadata_enum_sai_object_type_t.valuesnames[i]); - int value = metadata_enum_sai_object_type_t.values[i]; + int value = sai_metadata_enum_sai_object_type_t.values[i]; META_ASSERT_TRUE(value == last + 1, "object type values must be consecutive numbers"); @@ -252,17 +252,17 @@ void check_attr_by_object_type() { META_LOG_ENTER(); - META_ASSERT_TRUE(metadata_attr_by_object_type_count == SAI_OBJECT_TYPE_MAX, "invalid object type count in metadata"); + META_ASSERT_TRUE(sai_metadata_attr_by_object_type_count == SAI_OBJECT_TYPE_MAX, "invalid object type count in metadata"); size_t i = 0; - for (; i < metadata_attr_by_object_type_count; ++i) + for (; i < sai_metadata_attr_by_object_type_count; ++i) { META_LOG_INFO("processing %zu, %s", i, sai_metadata_get_object_type_name((sai_object_type_t)i)); - META_ASSERT_NOT_NULL(metadata_attr_by_object_type[i]); + META_ASSERT_NOT_NULL(sai_metadata_attr_by_object_type[i]); - const sai_attr_metadata_t ** ot = metadata_attr_by_object_type[i]; + const sai_attr_metadata_t ** ot = sai_metadata_attr_by_object_type[i]; size_t index = 0; @@ -283,7 +283,7 @@ void check_attr_by_object_type() META_LOG_INFO("attr index %zu for %s", index, sai_metadata_get_object_type_name((sai_object_type_t)i)); } - META_ASSERT_NULL(metadata_attr_by_object_type[i]); + META_ASSERT_NULL(sai_metadata_attr_by_object_type[i]); } void check_attr_object_type( @@ -303,7 +303,33 @@ void check_attr_value_type_range( { META_LOG_ENTER(); - META_ASSERT_NOT_NULL(sai_metadata_get_enum_value_name(&metadata_enum_sai_attr_value_type_t, md->attrvaluetype)); + META_ASSERT_NOT_NULL(sai_metadata_get_enum_value_name(&sai_metadata_enum_sai_attr_value_type_t, md->attrvaluetype)); +} + +bool sai_metadata_is_acl_field_or_action( + _In_ const sai_attr_metadata_t* metadata) +{ + if (metadata == NULL) + { + return false; + } + + if (metadata->objecttype == SAI_OBJECT_TYPE_ACL_ENTRY) + { + if (metadata->attrid >= SAI_ACL_ENTRY_ATTR_FIELD_START && + metadata->attrid <= SAI_ACL_ENTRY_ATTR_FIELD_END) + { + return true; + } + + if (metadata->attrid >= SAI_ACL_ENTRY_ATTR_ACTION_START && + metadata->attrid <= SAI_ACL_ENTRY_ATTR_ACTION_END) + { + return true; + } + } + + return false; } void check_attr_flags( @@ -569,6 +595,15 @@ void check_attr_allowed_object_types( return; } + if (md->isoidattribute) + { + META_ASSERT_TRUE(md->allowedobjecttypeslength > 0, "object len should be at least 1"); + } + else + { + META_ASSERT_TRUE(md->allowedobjecttypeslength == 0, "object len should be 0"); + } + switch (md->attrvaluetype) { case SAI_ATTR_VALUE_TYPE_ACL_FIELD_DATA_OBJECT_LIST: @@ -601,7 +636,7 @@ void check_attr_allowed_object_types( META_ASSERT_FAIL(md, "invalid allowed object type: %d", ot); } - const sai_object_type_info_t* info = sai_all_object_type_infos[ot]; + const sai_object_type_info_t* info = sai_metadata_all_object_type_infos[ot]; META_ASSERT_NOT_NULL(info); @@ -610,7 +645,9 @@ void check_attr_allowed_object_types( META_ASSERT_FAIL(md, "non object id can't be used as object id: %d", ot); } - if (ot == SAI_OBJECT_TYPE_SWITCH) + if (ot == SAI_OBJECT_TYPE_SWITCH || + ot == SAI_OBJECT_TYPE_FDB_FLUSH || + ot == SAI_OBJECT_TYPE_HOSTIF_PACKET) { /* switch object type is ment to be used only in non object id struct types */ @@ -664,7 +701,7 @@ void check_attr_default_required( /* * Const on list, this is exception for UDF object since * it's default value is 2 bytes 0xFF,0xFF and it's special - * calse. + * case. */ break; @@ -871,7 +908,7 @@ void check_attr_default_value_type( case SAI_DEFAULT_VALUE_TYPE_NONE: case SAI_DEFAULT_VALUE_TYPE_CONST: - /* check conditions/cretion flags? */ + /* check conditions/creation flags? */ break; case SAI_DEFAULT_VALUE_TYPE_ATTR_VALUE: @@ -1036,7 +1073,7 @@ void check_attr_conditions( META_ASSERT_FAIL(md, "marked as conditional, but invalid creation flags: 0x%u", md->flags); } - /* condition must be the same object type as attribue we check */ + /* condition must be the same object type as attribute we check */ size_t index = 0; @@ -1090,7 +1127,7 @@ void check_attr_conditions( if (cmd->conditiontype != SAI_ATTR_CONDITION_TYPE_NONE) { - META_ASSERT_FAIL(md, "conditional attibute is also conditional, not allowed"); + META_ASSERT_FAIL(md, "conditional attribute is also conditional, not allowed"); } switch ((int)cmd->flags) @@ -1159,12 +1196,12 @@ void check_attr_validonly( case SAI_ATTR_FLAGS_CREATE_ONLY: /* - * In generral valid only attribute should be used only on + * In general valid only attribute should be used only on * CREATE_AND_SET flags, since when attribute is CREATE_ONLY it has - * default value and it can't be changed anywa, and entire purpose + * default value and it can't be changed anyway, and entire purpose * of valid only attribute is to allow change during runtime. * - * Wthen attribute CREATE_ONLY is marked as valid only is more like + * When attribute CREATE_ONLY is marked as valid only is more like * indication that this value will be used in that specific case * but you won't be able to change it anyway. */ @@ -1196,10 +1233,10 @@ void check_attr_validonly( * provided for CONST only. */ - META_ASSERT_FAIL(md, "expected default value on vlaid only attribute, but none provided"); + META_ASSERT_FAIL(md, "expected default value on valid only attribute, but none provided"); } - /* condition must be the same object type as attribue we check */ + /* condition must be the same object type as attribute we check */ size_t index = 0; @@ -1266,15 +1303,22 @@ void check_attr_validonly( * assumption. */ } + else if (md->objecttype == SAI_OBJECT_TYPE_MIRROR_SESSION && + (md->attrid == SAI_MIRROR_SESSION_ATTR_VLAN_TPID || md->attrid == SAI_MIRROR_SESSION_ATTR_VLAN_ID || + md->attrid == SAI_MIRROR_SESSION_ATTR_VLAN_PRI || md->attrid == SAI_MIRROR_SESSION_ATTR_VLAN_CFI)) + { + /* Vlan header attributes are depending on VLAN_HEADER_VALID which is + * also valid only for ERSPAN. */ + } else { - META_ASSERT_FAIL(md, "validonly attibute is also validonly attribute, not allowed"); + META_ASSERT_FAIL(md, "validonly attribute is also validonly attribute, not allowed"); } } if (cmd->conditiontype != SAI_ATTR_CONDITION_TYPE_NONE) { - META_ASSERT_FAIL(md, "conditional attibute is also conditional, not allowed"); + META_ASSERT_FAIL(md, "conditional attribute is also conditional, not allowed"); } switch ((int)cmd->flags) @@ -1465,7 +1509,8 @@ void check_attr_key( case SAI_ATTR_VALUE_TYPE_OBJECT_ID: - if (md->objecttype == SAI_OBJECT_TYPE_QUEUE && md->attrid == SAI_QUEUE_ATTR_PORT) + if ((md->objecttype == SAI_OBJECT_TYPE_QUEUE && md->attrid == SAI_QUEUE_ATTR_PORT) || + (md->objecttype == SAI_OBJECT_TYPE_INGRESS_PRIORITY_GROUP && md->attrid == SAI_INGRESS_PRIORITY_GROUP_ATTR_PORT)) { /* * This is also special case, OBJECT_ID at should not be a @@ -1638,7 +1683,7 @@ void check_attr_vlan( md->attrvaluetype != SAI_ATTR_VALUE_TYPE_ACL_FIELD_DATA_UINT16 && md->attrvaluetype != SAI_ATTR_VALUE_TYPE_ACL_ACTION_DATA_UINT16) { - META_ASSERT_FAIL(md, "marked as vlan, but fiels has wrong attr value type"); + META_ASSERT_FAIL(md, "marked as vlan, but has wrong attr value type"); } } } @@ -1752,7 +1797,7 @@ void check_attr_reverse_graph( sai_object_type_t depobjecttype = md->allowedobjecttypes[index]; - const sai_object_type_info_t *oi = sai_all_object_type_infos[depobjecttype]; + const sai_object_type_info_t *oi = sai_metadata_all_object_type_infos[depobjecttype]; META_ASSERT_NOT_NULL(oi->revgraphmembers); @@ -1813,8 +1858,8 @@ void check_attr_reverse_graph( rm->attrmetadata->attrid == md->attrid) { META_LOG_INFO("dep %s ot %s attr %s\n", - metadata_enum_sai_object_type_t.valuesnames[depobjecttype], - metadata_enum_sai_object_type_t.valuesnames[md->objecttype], + sai_metadata_enum_sai_object_type_t.valuesnames[depobjecttype], + sai_metadata_enum_sai_object_type_t.valuesnames[md->objecttype], md->attridname); defined = true; @@ -1928,7 +1973,7 @@ void check_attr_existing_objects( META_LOG_ENTER(); /* - * Purpose of this test it to find attributes on objects exisring already + * Purpose of this test it to find attributes on objects existing already * on the switch with attributes that are mandatory on create and create * and set. Those attributes can be changed by user fro previous value, * and this causes problem for comparison logic to bring those objects to @@ -1936,7 +1981,7 @@ void check_attr_existing_objects( * somewhere. */ - if (sai_all_object_type_infos[md->objecttype]->isnonobjectid) + if (sai_metadata_all_object_type_infos[md->objecttype]->isnonobjectid) { return; } @@ -1945,7 +1990,7 @@ void check_attr_existing_objects( { /* * Those objects are not existing on the switch by default user needs - * to crete them. + * to create them. */ case SAI_OBJECT_TYPE_SAMPLEPACKET: @@ -1982,7 +2027,7 @@ void check_attr_existing_objects( /* * If attribute is mandatory on create and create and set then there is no * default value on created object, and user can change it's value so in - * comparison logic we will need to mantain this state somewhere as + * comparison logic we will need to maintain this state somewhere as * default. */ @@ -2018,7 +2063,7 @@ void check_attr_existing_objects( /* * When type is object id we need to store it's previous value - * since we will not be albe to bring it to default. + * since we will not be able to bring it to default. */ META_WARN_LOG("Default value needs to be stored %s", md->attridname); @@ -2045,6 +2090,18 @@ void check_attr_sai_pointer( if (md->objecttype == SAI_OBJECT_TYPE_SWITCH) { + if (md->attrvaluetype == SAI_ATTR_VALUE_TYPE_POINTER) + { + /* + * Make sure that all pointers are CREATE_AND_SET. + */ + + if (md->flags != SAI_ATTR_FLAGS_CREATE_AND_SET) + { + META_ASSERT_FAIL(md, "all pointers should be CREATE_AND_SET"); + } + } + return; } @@ -2113,7 +2170,7 @@ void check_object_infos() for (; i <= SAI_OBJECT_TYPE_MAX; ++i) { - const sai_object_type_info_t* info = sai_all_object_type_infos[i]; + const sai_object_type_info_t* info = sai_metadata_all_object_type_infos[i]; if (info == NULL) { @@ -2144,7 +2201,7 @@ void check_object_infos() const sai_attr_metadata_t* am = meta[index]; META_ASSERT_TRUE((int)am->attrid >= 0, "attribute must be non negative"); - META_ASSERT_TRUE(last < (int)am->attrid, "attributes are not incresing"); + META_ASSERT_TRUE(last < (int)am->attrid, "attributes are not increasing"); if (last + 1 != (int)am->attrid) { @@ -2191,7 +2248,7 @@ void check_non_object_id_object_types() for (; i <= SAI_OBJECT_TYPE_MAX; ++i) { - const sai_object_type_info_t* info = sai_all_object_type_infos[i]; + const sai_object_type_info_t* info = sai_metadata_all_object_type_infos[i]; if (info == NULL) { @@ -2283,7 +2340,12 @@ void check_non_object_id_object_types() { sai_object_type_t ot = m->allowedobjecttypes[k]; - if (ot >= SAI_OBJECT_TYPE_NULL && ot <= SAI_OBJECT_TYPE_MAX) + if (ot == SAI_OBJECT_TYPE_FDB_FLUSH || ot == SAI_OBJECT_TYPE_HOSTIF_PACKET) + { + META_FAIL("fdb flush or hostif packet can't be used as object in nonobjectid struct"); + } + + if (ot > SAI_OBJECT_TYPE_NULL && ot < SAI_OBJECT_TYPE_MAX) { if (ot == SAI_OBJECT_TYPE_SWITCH) { @@ -2293,11 +2355,18 @@ void check_non_object_id_object_types() */ member_supports_switch_id++; + + if (strcmp("switch_id", m->membername) != 0) + { + META_FAIL("struct member %s supports object type SWITCH, should be named switch_id", m->membername); + } + + META_ASSERT_TRUE(m->allowedobjecttypeslength == 1, "switch_id member should only support object type SWITCH"); } /* non object id struct can't contain object id which is also non object id */ - const sai_object_type_info_t* sinfo = sai_all_object_type_infos[ot]; + const sai_object_type_info_t* sinfo = sai_metadata_all_object_type_infos[ot]; META_ASSERT_NOT_NULL(sinfo); @@ -2337,7 +2406,7 @@ void check_non_object_id_object_attrs() for (; i <= SAI_OBJECT_TYPE_MAX; ++i) { - const sai_object_type_info_t* info = sai_all_object_type_infos[i]; + const sai_object_type_info_t* info = sai_metadata_all_object_type_infos[i]; if (info == NULL || !info->isnonobjectid) { @@ -2380,12 +2449,12 @@ void check_attr_sorted_by_id_name() const char *last = "AAA"; - META_ASSERT_TRUE(metadata_attr_sorted_by_id_name_count > 500, + META_ASSERT_TRUE(sai_metadata_attr_sorted_by_id_name_count > 500, "there should be at least 500 attributes in total"); - for (; i < metadata_attr_sorted_by_id_name_count; ++i) + for (; i < sai_metadata_attr_sorted_by_id_name_count; ++i) { - const sai_attr_metadata_t *am = metadata_attr_sorted_by_id_name[i]; + const sai_attr_metadata_t *am = sai_metadata_attr_sorted_by_id_name[i]; META_ASSERT_NOT_NULL(am); @@ -2401,13 +2470,13 @@ void check_attr_sorted_by_id_name() last = name; } - META_ASSERT_NULL(metadata_attr_sorted_by_id_name[i]); + META_ASSERT_NULL(sai_metadata_attr_sorted_by_id_name[i]); /* check search */ - for (i = 0; i < metadata_attr_sorted_by_id_name_count; ++i) + for (i = 0; i < sai_metadata_attr_sorted_by_id_name_count; ++i) { - const sai_attr_metadata_t *am = metadata_attr_sorted_by_id_name[i]; + const sai_attr_metadata_t *am = sai_metadata_attr_sorted_by_id_name[i]; META_LOG_INFO("search for %s", am->attridname); @@ -2436,20 +2505,20 @@ void list_loop( META_LOG_ENTER(); META_WARN_LOG("LOOP DETECTED on object type: %s", - metadata_enum_sai_object_type_t.valuesnames[info->objecttype]); + sai_metadata_enum_sai_object_type_t.valuesnames[info->objecttype]); for (; levelidx < level; ++levelidx) { sai_object_type_t ot = visited[levelidx]; - const char* ot_name = metadata_enum_sai_object_type_t.valuesnames[ot]; + const char* ot_name = sai_metadata_enum_sai_object_type_t.valuesnames[ot]; const sai_attr_metadata_t* m = sai_metadata_get_attr_metadata(ot, attributes[levelidx]); META_WARN_LOG(" %s: %s", ot_name, m->attridname); } - META_WARN_LOG(" -> %s", metadata_enum_sai_object_type_t.valuesnames[info->objecttype]); + META_WARN_LOG(" -> %s", sai_metadata_enum_sai_object_type_t.valuesnames[info->objecttype]); if (level >= 0) { @@ -2536,7 +2605,7 @@ void check_objects_for_loops_recursive( for (; j < m->allowedobjecttypeslength; ++j) { - const sai_object_type_info_t* next = sai_all_object_type_infos[ m->allowedobjecttypes[j] ]; + const sai_object_type_info_t* next = sai_metadata_all_object_type_infos[ m->allowedobjecttypes[j] ]; check_objects_for_loops_recursive(next, visited, attributes, level + 1); } @@ -2568,7 +2637,7 @@ void check_objects_for_loops_recursive( for (; k < m->allowedobjecttypeslength; k++) { - const sai_object_type_info_t* next = sai_all_object_type_infos[ m->allowedobjecttypes[k] ]; + const sai_object_type_info_t* next = sai_metadata_all_object_type_infos[ m->allowedobjecttypes[k] ]; check_objects_for_loops_recursive(next, visited, attributes, level + 1); } @@ -2592,7 +2661,7 @@ void check_objects_for_loops() for (; i <= SAI_OBJECT_TYPE_MAX; ++i) { - const sai_object_type_info_t* info = sai_all_object_type_infos[i]; + const sai_object_type_info_t* info = sai_metadata_all_object_type_infos[i]; if (info == NULL) { @@ -2640,7 +2709,7 @@ void check_read_only_attributes() for (; i <= SAI_OBJECT_TYPE_MAX; ++i) { - const sai_object_type_info_t* info = sai_all_object_type_infos[i]; + const sai_object_type_info_t* info = sai_metadata_all_object_type_infos[i]; if (info == NULL) { @@ -2680,7 +2749,7 @@ void check_read_only_attributes() */ META_WARN_LOG("object %s has only READ_ONLY attributes", - metadata_enum_sai_object_type_t.valuesnames[i]); + sai_metadata_enum_sai_object_type_t.valuesnames[i]); } } } @@ -2691,17 +2760,17 @@ void check_mixed_object_list_types() /* * Purpose of this check is to find out if any of object id lists supports - * multiple object types at the same time. For now this abbility will not + * multiple object types at the same time. For now this ability will not * be supported. */ - META_ASSERT_TRUE(metadata_attr_sorted_by_id_name_count > 500, "there should be at least 500 attributes in total"); + META_ASSERT_TRUE(sai_metadata_attr_sorted_by_id_name_count > 500, "there should be at least 500 attributes in total"); size_t idx = 0; - for (; idx < metadata_attr_sorted_by_id_name_count; ++idx) + for (; idx < sai_metadata_attr_sorted_by_id_name_count; ++idx) { - const sai_attr_metadata_t* meta = metadata_attr_sorted_by_id_name[idx]; + const sai_attr_metadata_t* meta = sai_metadata_attr_sorted_by_id_name[idx]; switch (meta->attrvaluetype) { @@ -2727,6 +2796,16 @@ void check_mixed_object_list_types() } else { + if (meta->objecttype == SAI_OBJECT_TYPE_ACL_ENTRY && + meta->attrid == SAI_ACL_ENTRY_ATTR_ACTION_REDIRECT_LIST) + { + /* + * We make exception for this attribute. + */ + + break; + } + /* * For non read only attributes, there should be a good * reason why object list should support mixed object @@ -2783,7 +2862,7 @@ void check_api_names() * Purpose of this check is to find out if all api names correspond to * actual object names and follow convention name and the same signature * except some special objects. Currently this test is performed here - * manually, but it could be coverted to automatic generated test using + * manually, but it could be converted to automatic generated test using * parse.pl script. * * NOTE: Currently all new objects needs to be added here manually. @@ -2860,7 +2939,7 @@ void check_api_names() /* * hostif packet is special since its not a real object but represents - * attruibutes received from host interface. + * attributes received from host interface. */ checked[(int)SAI_OBJECT_TYPE_HOSTIF_PACKET] = SAI_OBJECT_TYPE_HOSTIF_PACKET; @@ -2871,7 +2950,7 @@ void check_api_names() /* * fdb flush is special since its not a real object but represents - * attruibutes that are passed when flushng fdb entries + * attributes that are passed when flushing fdb entries */ checked[(int)SAI_OBJECT_TYPE_FDB_FLUSH] = SAI_OBJECT_TYPE_FDB_FLUSH; @@ -2986,7 +3065,7 @@ void check_api_names() if (checked[index] != (sai_object_type_t)index) { META_FAIL("object %s (%d) was not added to check", - metadata_enum_sai_object_type_t.valuesnames[index], index); + sai_metadata_enum_sai_object_type_t.valuesnames[index], index); } } } @@ -3003,7 +3082,7 @@ void check_single_non_object_id_for_rev_graph( * member. */ - const sai_object_type_info_t *oi = sai_all_object_type_infos[depobjecttype]; + const sai_object_type_info_t *oi = sai_metadata_all_object_type_infos[depobjecttype]; META_ASSERT_NOT_NULL(oi->revgraphmembers); @@ -3036,7 +3115,7 @@ void check_single_non_object_id_for_rev_graph( META_ASSERT_NOT_NULL(rm->structmember); /* - * This graph entry is struct memner, maybe this i the + * This graph entry is struct member, maybe this i the * one we are looking for, since graph can have multiple * entries for the same object. */ @@ -3064,8 +3143,8 @@ void check_single_non_object_id_for_rev_graph( if (rm->structmember->allowedobjecttypes[i] == depobjecttype) { META_LOG_INFO("dep %s ot %s attr %s\n", - metadata_enum_sai_object_type_t.valuesnames[depobjecttype], - metadata_enum_sai_object_type_t.valuesnames[objecttype], + sai_metadata_enum_sai_object_type_t.valuesnames[depobjecttype], + sai_metadata_enum_sai_object_type_t.valuesnames[objecttype], sm->membername); defined = true; @@ -3116,7 +3195,7 @@ void check_reverse_graph_for_non_object_id() { sai_object_type_t objecttype = (sai_object_type_t)i; - const sai_object_type_info_t* info = sai_all_object_type_infos[i]; + const sai_object_type_info_t* info = sai_metadata_all_object_type_infos[i]; if (info == NULL || !info->isnonobjectid) { @@ -3174,7 +3253,7 @@ void check_vlan_attributes() * iterating each time. */ - const sai_attr_metadata_t** const meta = sai_object_type_info_SAI_OBJECT_TYPE_VLAN.attrmetadata; + const sai_attr_metadata_t** const meta = sai_metadata_object_type_info_SAI_OBJECT_TYPE_VLAN.attrmetadata; size_t index = 0; @@ -3241,8 +3320,8 @@ void check_acl_table_fields_and_acl_entry_fields() * find both attribute fields start for entry and table */ - const sai_attr_metadata_t **meta_acl_table = sai_object_type_info_SAI_OBJECT_TYPE_ACL_TABLE.attrmetadata; - const sai_attr_metadata_t **meta_acl_entry = sai_object_type_info_SAI_OBJECT_TYPE_ACL_ENTRY.attrmetadata; + const sai_attr_metadata_t **meta_acl_table = sai_metadata_object_type_info_SAI_OBJECT_TYPE_ACL_TABLE.attrmetadata; + const sai_attr_metadata_t **meta_acl_entry = sai_metadata_object_type_info_SAI_OBJECT_TYPE_ACL_ENTRY.attrmetadata; int acl_table_field_index = 0; @@ -3368,7 +3447,7 @@ void check_acl_entry_actions() * find both attribute fields start for entry and table */ - const sai_attr_metadata_t **meta_acl_entry = sai_object_type_info_SAI_OBJECT_TYPE_ACL_ENTRY.attrmetadata; + const sai_attr_metadata_t **meta_acl_entry = sai_metadata_object_type_info_SAI_OBJECT_TYPE_ACL_ENTRY.attrmetadata; size_t index = 0; @@ -3407,7 +3486,7 @@ void check_acl_entry_actions() META_ASSERT_FAIL(meta, "acl entry action flags should be CREATE_AND_SET"); } - const char* enum_name = metadata_enum_sai_acl_action_type_t.valuesnames[enum_index]; + const char* enum_name = sai_metadata_enum_sai_acl_action_type_t.valuesnames[enum_index]; META_ASSERT_NOT_NULL(enum_name); @@ -3435,7 +3514,7 @@ void check_acl_entry_actions() enum_index++; } - META_ASSERT_TRUE(enum_index == metadata_enum_sai_acl_action_type_t.valuescount, + META_ASSERT_TRUE(enum_index == sai_metadata_enum_sai_acl_action_type_t.valuescount, "number of acl entry action mismatch vs number of enums in sai_acl_action_type_t"); } @@ -3450,7 +3529,7 @@ void check_switch_create_only_objects() * other object so setting that object on create will be impossible. */ - const sai_attr_metadata_t** const meta = sai_object_type_info_SAI_OBJECT_TYPE_SWITCH.attrmetadata; + const sai_attr_metadata_t** const meta = sai_metadata_object_type_info_SAI_OBJECT_TYPE_SWITCH.attrmetadata; size_t index = 0; @@ -3458,7 +3537,7 @@ void check_switch_create_only_objects() { const sai_attr_metadata_t *md = meta[index]; - if (HAS_FLAG_CREATE_ONLY(md->flags) && md->allowedobjecttypeslength > 0) + if (HAS_FLAG_CREATE_ONLY(md->flags) && md->isoidattribute) { META_ASSERT_FAIL(md, "attribute is create_only and it's an object id, this is not allowed"); } @@ -3492,19 +3571,33 @@ void check_quad_api_pointers( } } +void check_object_id_non_object_id( + _In_ const sai_object_type_info_t *oi) +{ + META_LOG_ENTER(); + + /* + * Purpose of this test is to check whether isobjectid and isnonobject id + * have opposite values. + */ + + META_ASSERT_TRUE(oi->isnonobjectid == !oi->isobjectid, "non object id object id not match"); +} + void check_single_object_info( _In_ const sai_object_type_info_t *oi) { META_LOG_ENTER(); check_quad_api_pointers(oi); + check_object_id_non_object_id(oi); } void check_api_max() { META_LOG_ENTER(); - META_ASSERT_TRUE(metadata_enum_sai_api_t.valuescount == SAI_API_MAX, + META_ASSERT_TRUE(sai_metadata_enum_sai_api_t.valuescount == SAI_API_MAX, "SAI_API_MAX should be equal to number of SAI_API*"); } @@ -3522,9 +3615,9 @@ int main(int argc, char **argv) size_t i = 0; - for (; i < metadata_attr_by_object_type_count; ++i) + for (; i < sai_metadata_attr_by_object_type_count; ++i) { - check_single_object_type_attributes(metadata_attr_by_object_type[i]); + check_single_object_type_attributes(sai_metadata_attr_by_object_type[i]); } check_object_infos(); @@ -3547,7 +3640,7 @@ int main(int argc, char **argv) for (; i < SAI_OBJECT_TYPE_MAX; ++i) { - check_single_object_info(sai_all_object_type_infos[i]); + check_single_object_info(sai_metadata_all_object_type_infos[i]); } SAI_META_LOG_DEBUG("log test"); diff --git a/test/saithrift/tests/switch.py b/test/saithrift/tests/switch.py index 9d872c5d6..05b15e680 100644 --- a/test/saithrift/tests/switch.py +++ b/test/saithrift/tests/switch.py @@ -48,7 +48,6 @@ def __init__(self): switch_inited=0 port_list = {} sai_port_list = [] -front_port_list = [] table_attr_list = [] router_mac='00:77:66:55:44:00' rewrite_mac1='00:77:66:55:44:01' @@ -70,6 +69,10 @@ def switch_init(client): ret = client.sai_thrift_get_vlan_id(default_vlan.oid) assert (ret.status == SAI_STATUS_SUCCESS), "Failed obtain default vlan id" default_vlan.vid = ret.data.u16 + + for interface,front in interface_to_front_mapping.iteritems(): + sai_port_id = client.sai_thrift_get_port_id_by_front_port(front); + port_list[int(interface)]=sai_port_id switch_attr_list = client.sai_thrift_get_switch_attribute() attr_list = switch_attr_list.attr_list @@ -78,10 +81,11 @@ def switch_init(client): print "max ports: " + attribute.value.u32 elif attribute.id == SAI_SWITCH_ATTR_PORT_LIST: for port_id in attribute.value.objlist.object_id_list: - attr_value = sai_thrift_attribute_value_t(booldata=1) - attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_ADMIN_STATE, value=attr_value) - client.sai_thrift_set_port_attribute(port_id, attr) - sai_port_list.append(port_id) + if port_id in port_list.values(): + attr_value = sai_thrift_attribute_value_t(booldata=1) + attr = sai_thrift_attribute_t(id=SAI_PORT_ATTR_ADMIN_STATE, value=attr_value) + client.sai_thrift_set_port_attribute(port_id, attr) + sai_port_list.append(port_id) else: print "unknown switch attribute" attr_value = sai_thrift_attribute_value_t(mac=router_mac) @@ -106,13 +110,6 @@ def switch_init(client): if not all_ports_are_up: raise RuntimeError('Not all of the ports are up') - thrift_attr = client.sai_thrift_get_port_list_by_front_port() - if thrift_attr.id == SAI_SWITCH_ATTR_PORT_LIST: - for port_id in thrift_attr.value.objlist.object_id_list: - front_port_list.append(port_id) - for interface,front in interface_to_front_mapping.iteritems(): - sai_port_id = client.sai_thrift_get_port_id_by_front_port(front); - port_list[int(interface)]=sai_port_id switch_inited = 1 def sai_thrift_get_cpu_port_id(client):