From a8aeb84db1ed47aabd2d0ec52bd7c4f9fe2302c8 Mon Sep 17 00:00:00 2001 From: kcudnik Date: Tue, 1 Aug 2023 18:47:01 +0200 Subject: [PATCH] [DASH] Update dash headers to most recent --- experimental/saiexperimentaldashacl.h | 56 ++- experimental/saiexperimentaldasheni.h | 22 + .../saiexperimentaldashinboundrouting.h | 9 + experimental/saiexperimentaldashmeter.h | 386 ++++++++++++++++++ .../saiexperimentaldashoutboundcatopa.h | 28 ++ .../saiexperimentaldashoutboundrouting.h | 32 +- .../saiexperimentaldashpavalidation.h | 9 + experimental/saiexperimentaldashtag.h | 367 +++++++++++++++++ experimental/saiexperimentaldashvip.h | 9 + experimental/saiextensions.h | 6 + experimental/saitypesextensions.h | 10 + inc/saiobject.h | 8 + 12 files changed, 931 insertions(+), 11 deletions(-) create mode 100644 experimental/saiexperimentaldashmeter.h create mode 100644 experimental/saiexperimentaldashtag.h diff --git a/experimental/saiexperimentaldashacl.h b/experimental/saiexperimentaldashacl.h index 02ff77fe7..d80761ab9 100644 --- a/experimental/saiexperimentaldashacl.h +++ b/experimental/saiexperimentaldashacl.h @@ -64,6 +64,7 @@ typedef enum _sai_dash_acl_group_attr_t * @type sai_ip_addr_family_t * @flags CREATE_AND_SET * @default SAI_IP_ADDR_FAMILY_IPV4 + * @isresourcetype true */ SAI_DASH_ACL_GROUP_ATTR_IP_ADDR_FAMILY = SAI_DASH_ACL_GROUP_ATTR_START, @@ -105,46 +106,81 @@ typedef enum _sai_dash_acl_rule_attr_t * @type sai_object_id_t * @flags MANDATORY_ON_CREATE | CREATE_ONLY * @objects SAI_OBJECT_TYPE_DASH_ACL_GROUP + * @isresourcetype true */ SAI_DASH_ACL_RULE_ATTR_DASH_ACL_GROUP_ID, /** - * @brief List matched key dip + * @brief Ternary matched key dst_tag * - * @type sai_ip_prefix_list_t + * @type sai_uint32_t + * @flags MANDATORY_ON_CREATE | CREATE_ONLY + */ + SAI_DASH_ACL_RULE_ATTR_DST_TAG, + + /** + * @brief Ternary matched mask dst_tag + * + * @type sai_uint32_t + * @flags MANDATORY_ON_CREATE | CREATE_ONLY + */ + SAI_DASH_ACL_RULE_ATTR_DST_TAG_MASK, + + /** + * @brief Ternary matched key src_tag + * + * @type sai_uint32_t + * @flags MANDATORY_ON_CREATE | CREATE_ONLY + */ + SAI_DASH_ACL_RULE_ATTR_SRC_TAG, + + /** + * @brief Ternary matched mask src_tag + * + * @type sai_uint32_t + * @flags MANDATORY_ON_CREATE | CREATE_ONLY + */ + SAI_DASH_ACL_RULE_ATTR_SRC_TAG_MASK, + + /** + * @brief Optional matched key dip + * + * @type sai_ip_address_t * @flags MANDATORY_ON_CREATE | CREATE_ONLY */ SAI_DASH_ACL_RULE_ATTR_DIP, /** - * @brief List matched key sip + * @brief Optional matched key sip * - * @type sai_ip_prefix_list_t + * @type sai_ip_address_t * @flags MANDATORY_ON_CREATE | CREATE_ONLY */ SAI_DASH_ACL_RULE_ATTR_SIP, /** - * @brief List matched key protocol + * @brief Optional matched key protocol * - * @type sai_u8_list_t + * @type sai_uint8_t * @flags MANDATORY_ON_CREATE | CREATE_ONLY */ SAI_DASH_ACL_RULE_ATTR_PROTOCOL, /** - * @brief Range_list matched key src_port + * @brief Optional matched key src_port * - * @type sai_u16_range_list_t + * @type sai_uint16_t * @flags MANDATORY_ON_CREATE | CREATE_ONLY + * @isvlan false */ SAI_DASH_ACL_RULE_ATTR_SRC_PORT, /** - * @brief Range_list matched key dst_port + * @brief Optional matched key dst_port * - * @type sai_u16_range_list_t + * @type sai_uint16_t * @flags MANDATORY_ON_CREATE | CREATE_ONLY + * @isvlan false */ SAI_DASH_ACL_RULE_ATTR_DST_PORT, diff --git a/experimental/saiexperimentaldasheni.h b/experimental/saiexperimentaldasheni.h index 414cf15d8..d79660408 100644 --- a/experimental/saiexperimentaldasheni.h +++ b/experimental/saiexperimentaldasheni.h @@ -161,6 +161,28 @@ typedef enum _sai_eni_attr_t */ SAI_ENI_ATTR_VNET_ID, + /** + * @brief Action set_eni_attrs parameter V4_METER_POLICY_ID + * + * @type sai_object_id_t + * @flags CREATE_AND_SET + * @objects SAI_OBJECT_TYPE_METER_POLICY + * @allownull true + * @default SAI_NULL_OBJECT_ID + */ + SAI_ENI_ATTR_V4_METER_POLICY_ID, + + /** + * @brief Action set_eni_attrs parameter V6_METER_POLICY_ID + * + * @type sai_object_id_t + * @flags CREATE_AND_SET + * @objects SAI_OBJECT_TYPE_METER_POLICY + * @allownull true + * @default SAI_NULL_OBJECT_ID + */ + SAI_ENI_ATTR_V6_METER_POLICY_ID, + /** * @brief Action set_eni_attrs parameter INBOUND_V4_STAGE1_DASH_ACL_GROUP_ID * diff --git a/experimental/saiexperimentaldashinboundrouting.h b/experimental/saiexperimentaldashinboundrouting.h index 5e7a2f7a0..ba9c20542 100644 --- a/experimental/saiexperimentaldashinboundrouting.h +++ b/experimental/saiexperimentaldashinboundrouting.h @@ -116,6 +116,15 @@ typedef enum _sai_inbound_routing_entry_attr_t */ SAI_INBOUND_ROUTING_ENTRY_ATTR_SRC_VNET_ID, + /** + * @brief IP address family for resource accounting + * + * @type sai_ip_addr_family_t + * @flags READ_ONLY + * @isresourcetype true + */ + SAI_INBOUND_ROUTING_ENTRY_ATTR_IP_ADDR_FAMILY, + /** * @brief End of attributes */ diff --git a/experimental/saiexperimentaldashmeter.h b/experimental/saiexperimentaldashmeter.h new file mode 100644 index 000000000..34cee7d85 --- /dev/null +++ b/experimental/saiexperimentaldashmeter.h @@ -0,0 +1,386 @@ +/** + * Copyright (c) 2014 Microsoft Open Technologies, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT + * LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS + * FOR A PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT. + * + * See the Apache Version 2.0 License for specific language governing + * permissions and limitations under the License. + * + * Microsoft would like to thank the following companies for their review and + * assistance with these files: Intel Corporation, Mellanox Technologies Ltd, + * Dell Products, L.P., Facebook, Inc., Marvell International Ltd. + * + * @file saiexperimentaldashmeter.h + * + * @brief This module defines SAI P4 extension interface + */ + +#if !defined (__SAIEXPERIMENTALDASHMETER_H_) +#define __SAIEXPERIMENTALDASHMETER_H_ + +#include + +/** + * @defgroup SAIEXPERIMENTALDASH_METER SAI - Extension specific API definitions + * + * @{ + */ + +/** + * @brief Attribute ID for dash_meter_meter_bucket + */ +typedef enum _sai_meter_bucket_attr_t +{ + /** + * @brief Start of attributes + */ + SAI_METER_BUCKET_ATTR_START, + + /** + * @brief Exact matched key eni_id + * + * @type sai_object_id_t + * @flags MANDATORY_ON_CREATE | CREATE_ONLY + * @objects SAI_OBJECT_TYPE_ENI + */ + SAI_METER_BUCKET_ATTR_ENI_ID = SAI_METER_BUCKET_ATTR_START, + + /** + * @brief Exact matched key meter_class + * + * @type sai_uint16_t + * @flags MANDATORY_ON_CREATE | CREATE_ONLY + * @isvlan false + */ + SAI_METER_BUCKET_ATTR_METER_CLASS, + + /** + * @brief Action meter_bucket_action parameter OUTBOUND_BYTES_COUNTER + * + * @type sai_uint64_t + * @flags READ_ONLY + */ + SAI_METER_BUCKET_ATTR_OUTBOUND_BYTES_COUNTER, + + /** + * @brief Action meter_bucket_action parameter INBOUND_BYTES_COUNTER + * + * @type sai_uint64_t + * @flags READ_ONLY + */ + SAI_METER_BUCKET_ATTR_INBOUND_BYTES_COUNTER, + + /** + * @brief End of attributes + */ + SAI_METER_BUCKET_ATTR_END, + + /** Custom range base value */ + SAI_METER_BUCKET_ATTR_CUSTOM_RANGE_START = 0x10000000, + + /** End of custom range base */ + SAI_METER_BUCKET_ATTR_CUSTOM_RANGE_END, + +} sai_meter_bucket_attr_t; + +/** + * @brief Attribute ID for dash_meter_meter_policy + */ +typedef enum _sai_meter_policy_attr_t +{ + /** + * @brief Start of attributes + */ + SAI_METER_POLICY_ATTR_START, + + /** + * @brief Action check_ip_addr_family parameter IP_ADDR_FAMILY + * + * @type sai_ip_addr_family_t + * @flags CREATE_AND_SET + * @default SAI_IP_ADDR_FAMILY_IPV4 + * @isresourcetype true + */ + SAI_METER_POLICY_ATTR_IP_ADDR_FAMILY = SAI_METER_POLICY_ATTR_START, + + /** + * @brief End of attributes + */ + SAI_METER_POLICY_ATTR_END, + + /** Custom range base value */ + SAI_METER_POLICY_ATTR_CUSTOM_RANGE_START = 0x10000000, + + /** End of custom range base */ + SAI_METER_POLICY_ATTR_CUSTOM_RANGE_END, + +} sai_meter_policy_attr_t; + +/** + * @brief Attribute ID for dash_meter_meter_rule + */ +typedef enum _sai_meter_rule_attr_t +{ + /** + * @brief Start of attributes + */ + SAI_METER_RULE_ATTR_START, + + /** + * @brief Exact matched key meter_policy_id + * + * @type sai_object_id_t + * @flags MANDATORY_ON_CREATE | CREATE_ONLY + * @objects SAI_OBJECT_TYPE_METER_POLICY + * @isresourcetype true + */ + SAI_METER_RULE_ATTR_METER_POLICY_ID = SAI_METER_RULE_ATTR_START, + + /** + * @brief Ternary matched key dip + * + * @type sai_ip_address_t + * @flags MANDATORY_ON_CREATE | CREATE_ONLY + */ + SAI_METER_RULE_ATTR_DIP, + + /** + * @brief Ternary matched mask dip + * + * @type sai_ip_address_t + * @flags MANDATORY_ON_CREATE | CREATE_ONLY + */ + SAI_METER_RULE_ATTR_DIP_MASK, + + /** + * @brief Action set_policy_meter_class parameter METER_CLASS + * + * @type sai_uint16_t + * @flags CREATE_AND_SET + * @isvlan false + * @default 0 + */ + SAI_METER_RULE_ATTR_METER_CLASS, + + /** + * @brief Rule priority in table + * + * @type sai_uint32_t + * @flags MANDATORY_ON_CREATE | CREATE_ONLY + */ + SAI_METER_RULE_ATTR_PRIORITY, + + /** + * @brief IP address family for resource accounting + * + * @type sai_ip_addr_family_t + * @flags READ_ONLY + * @isresourcetype true + */ + SAI_METER_RULE_ATTR_IP_ADDR_FAMILY, + + /** + * @brief End of attributes + */ + SAI_METER_RULE_ATTR_END, + + /** Custom range base value */ + SAI_METER_RULE_ATTR_CUSTOM_RANGE_START = 0x10000000, + + /** End of custom range base */ + SAI_METER_RULE_ATTR_CUSTOM_RANGE_END, + +} sai_meter_rule_attr_t; + +/** + * @brief Create dash_meter_meter_bucket + * + * @param[out] meter_bucket_id Entry id + * @param[in] switch_id Switch id + * @param[in] attr_count Number of attributes + * @param[in] attr_list Array of attributes + * + * @return #SAI_STATUS_SUCCESS on success Failure status code on error + */ +typedef sai_status_t (*sai_create_meter_bucket_fn)( + _Out_ sai_object_id_t *meter_bucket_id, + _In_ sai_object_id_t switch_id, + _In_ uint32_t attr_count, + _In_ const sai_attribute_t *attr_list); + +/** + * @brief Remove dash_meter_meter_bucket + * + * @param[in] meter_bucket_id Entry id + * + * @return #SAI_STATUS_SUCCESS on success Failure status code on error + */ +typedef sai_status_t (*sai_remove_meter_bucket_fn)( + _In_ sai_object_id_t meter_bucket_id); + +/** + * @brief Set attribute for dash_meter_meter_bucket + * + * @param[in] meter_bucket_id Entry id + * @param[in] attr Attribute + * + * @return #SAI_STATUS_SUCCESS on success Failure status code on error + */ +typedef sai_status_t (*sai_set_meter_bucket_attribute_fn)( + _In_ sai_object_id_t meter_bucket_id, + _In_ const sai_attribute_t *attr); + +/** + * @brief Get attribute for dash_meter_meter_bucket + * + * @param[in] meter_bucket_id Entry id + * @param[in] attr_count Number of attributes + * @param[inout] attr_list Array of attributes + * + * @return #SAI_STATUS_SUCCESS on success Failure status code on error + */ +typedef sai_status_t (*sai_get_meter_bucket_attribute_fn)( + _In_ sai_object_id_t meter_bucket_id, + _In_ uint32_t attr_count, + _Inout_ sai_attribute_t *attr_list); + +/** + * @brief Create dash_meter_meter_policy + * + * @param[out] meter_policy_id Entry id + * @param[in] switch_id Switch id + * @param[in] attr_count Number of attributes + * @param[in] attr_list Array of attributes + * + * @return #SAI_STATUS_SUCCESS on success Failure status code on error + */ +typedef sai_status_t (*sai_create_meter_policy_fn)( + _Out_ sai_object_id_t *meter_policy_id, + _In_ sai_object_id_t switch_id, + _In_ uint32_t attr_count, + _In_ const sai_attribute_t *attr_list); + +/** + * @brief Remove dash_meter_meter_policy + * + * @param[in] meter_policy_id Entry id + * + * @return #SAI_STATUS_SUCCESS on success Failure status code on error + */ +typedef sai_status_t (*sai_remove_meter_policy_fn)( + _In_ sai_object_id_t meter_policy_id); + +/** + * @brief Set attribute for dash_meter_meter_policy + * + * @param[in] meter_policy_id Entry id + * @param[in] attr Attribute + * + * @return #SAI_STATUS_SUCCESS on success Failure status code on error + */ +typedef sai_status_t (*sai_set_meter_policy_attribute_fn)( + _In_ sai_object_id_t meter_policy_id, + _In_ const sai_attribute_t *attr); + +/** + * @brief Get attribute for dash_meter_meter_policy + * + * @param[in] meter_policy_id Entry id + * @param[in] attr_count Number of attributes + * @param[inout] attr_list Array of attributes + * + * @return #SAI_STATUS_SUCCESS on success Failure status code on error + */ +typedef sai_status_t (*sai_get_meter_policy_attribute_fn)( + _In_ sai_object_id_t meter_policy_id, + _In_ uint32_t attr_count, + _Inout_ sai_attribute_t *attr_list); + +/** + * @brief Create dash_meter_meter_rule + * + * @param[out] meter_rule_id Entry id + * @param[in] switch_id Switch id + * @param[in] attr_count Number of attributes + * @param[in] attr_list Array of attributes + * + * @return #SAI_STATUS_SUCCESS on success Failure status code on error + */ +typedef sai_status_t (*sai_create_meter_rule_fn)( + _Out_ sai_object_id_t *meter_rule_id, + _In_ sai_object_id_t switch_id, + _In_ uint32_t attr_count, + _In_ const sai_attribute_t *attr_list); + +/** + * @brief Remove dash_meter_meter_rule + * + * @param[in] meter_rule_id Entry id + * + * @return #SAI_STATUS_SUCCESS on success Failure status code on error + */ +typedef sai_status_t (*sai_remove_meter_rule_fn)( + _In_ sai_object_id_t meter_rule_id); + +/** + * @brief Set attribute for dash_meter_meter_rule + * + * @param[in] meter_rule_id Entry id + * @param[in] attr Attribute + * + * @return #SAI_STATUS_SUCCESS on success Failure status code on error + */ +typedef sai_status_t (*sai_set_meter_rule_attribute_fn)( + _In_ sai_object_id_t meter_rule_id, + _In_ const sai_attribute_t *attr); + +/** + * @brief Get attribute for dash_meter_meter_rule + * + * @param[in] meter_rule_id Entry id + * @param[in] attr_count Number of attributes + * @param[inout] attr_list Array of attributes + * + * @return #SAI_STATUS_SUCCESS on success Failure status code on error + */ +typedef sai_status_t (*sai_get_meter_rule_attribute_fn)( + _In_ sai_object_id_t meter_rule_id, + _In_ uint32_t attr_count, + _Inout_ sai_attribute_t *attr_list); + +typedef struct _sai_dash_meter_api_t +{ + sai_create_meter_bucket_fn create_meter_bucket; + sai_remove_meter_bucket_fn remove_meter_bucket; + sai_set_meter_bucket_attribute_fn set_meter_bucket_attribute; + sai_get_meter_bucket_attribute_fn get_meter_bucket_attribute; + sai_bulk_object_create_fn create_meter_buckets; + sai_bulk_object_remove_fn remove_meter_buckets; + + sai_create_meter_policy_fn create_meter_policy; + sai_remove_meter_policy_fn remove_meter_policy; + sai_set_meter_policy_attribute_fn set_meter_policy_attribute; + sai_get_meter_policy_attribute_fn get_meter_policy_attribute; + sai_bulk_object_create_fn create_meter_policys; + sai_bulk_object_remove_fn remove_meter_policys; + + sai_create_meter_rule_fn create_meter_rule; + sai_remove_meter_rule_fn remove_meter_rule; + sai_set_meter_rule_attribute_fn set_meter_rule_attribute; + sai_get_meter_rule_attribute_fn get_meter_rule_attribute; + sai_bulk_object_create_fn create_meter_rules; + sai_bulk_object_remove_fn remove_meter_rules; + +} sai_dash_meter_api_t; + +/** + * @} + */ +#endif /** __SAIEXPERIMENTALDASHMETER_H_ */ diff --git a/experimental/saiexperimentaldashoutboundcatopa.h b/experimental/saiexperimentaldashoutboundcatopa.h index 77f79ee80..cec14a294 100644 --- a/experimental/saiexperimentaldashoutboundcatopa.h +++ b/experimental/saiexperimentaldashoutboundcatopa.h @@ -96,6 +96,25 @@ typedef enum _sai_outbound_ca_to_pa_entry_attr_t */ SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_USE_DST_VNET_VNI, + /** + * @brief Action set_tunnel_mapping parameter METER_CLASS + * + * @type sai_uint16_t + * @flags CREATE_AND_SET + * @isvlan false + * @default 0 + */ + SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_METER_CLASS, + + /** + * @brief Action set_tunnel_mapping parameter METER_CLASS_OVERRIDE + * + * @type bool + * @flags CREATE_AND_SET + * @default false + */ + SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_METER_CLASS_OVERRIDE, + /** * @brief Attach a counter * @@ -109,6 +128,15 @@ typedef enum _sai_outbound_ca_to_pa_entry_attr_t */ SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_COUNTER_ID, + /** + * @brief IP address family for resource accounting + * + * @type sai_ip_addr_family_t + * @flags READ_ONLY + * @isresourcetype true + */ + SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_IP_ADDR_FAMILY, + /** * @brief End of attributes */ diff --git a/experimental/saiexperimentaldashoutboundrouting.h b/experimental/saiexperimentaldashoutboundrouting.h index 8d8e1815b..414445ec5 100644 --- a/experimental/saiexperimentaldashoutboundrouting.h +++ b/experimental/saiexperimentaldashoutboundrouting.h @@ -107,6 +107,27 @@ typedef enum _sai_outbound_routing_entry_attr_t */ SAI_OUTBOUND_ROUTING_ENTRY_ATTR_DST_VNET_ID, + /** + * @brief Action route_vnet, route_vnet_direct, route_direct, route_service_tunnel parameter METER_POLICY_EN + * + * @type bool + * @flags CREATE_AND_SET + * @default false + * @validonly SAI_OUTBOUND_ROUTING_ENTRY_ATTR_ACTION == SAI_OUTBOUND_ROUTING_ENTRY_ACTION_ROUTE_VNET or SAI_OUTBOUND_ROUTING_ENTRY_ATTR_ACTION == SAI_OUTBOUND_ROUTING_ENTRY_ACTION_ROUTE_VNET_DIRECT or SAI_OUTBOUND_ROUTING_ENTRY_ATTR_ACTION == SAI_OUTBOUND_ROUTING_ENTRY_ACTION_ROUTE_DIRECT or SAI_OUTBOUND_ROUTING_ENTRY_ATTR_ACTION == SAI_OUTBOUND_ROUTING_ENTRY_ACTION_ROUTE_SERVICE_TUNNEL + */ + SAI_OUTBOUND_ROUTING_ENTRY_ATTR_METER_POLICY_EN, + + /** + * @brief Action route_vnet, route_vnet_direct, route_direct, route_service_tunnel parameter METER_CLASS + * + * @type sai_uint16_t + * @flags CREATE_AND_SET + * @isvlan false + * @default 0 + * @validonly SAI_OUTBOUND_ROUTING_ENTRY_ATTR_ACTION == SAI_OUTBOUND_ROUTING_ENTRY_ACTION_ROUTE_VNET or SAI_OUTBOUND_ROUTING_ENTRY_ATTR_ACTION == SAI_OUTBOUND_ROUTING_ENTRY_ACTION_ROUTE_VNET_DIRECT or SAI_OUTBOUND_ROUTING_ENTRY_ATTR_ACTION == SAI_OUTBOUND_ROUTING_ENTRY_ACTION_ROUTE_DIRECT or SAI_OUTBOUND_ROUTING_ENTRY_ATTR_ACTION == SAI_OUTBOUND_ROUTING_ENTRY_ACTION_ROUTE_SERVICE_TUNNEL + */ + SAI_OUTBOUND_ROUTING_ENTRY_ATTR_METER_CLASS, + /** * @brief Action route_vnet_direct parameter OVERLAY_IP * @@ -182,7 +203,7 @@ typedef enum _sai_outbound_routing_entry_attr_t * * @type sai_dash_encapsulation_t * @flags CREATE_AND_SET - * @default SAI_DASH_ENCAPSULATION_VXLAN + * @default SAI_DASH_ENCAPSULATION_INVALID * @validonly SAI_OUTBOUND_ROUTING_ENTRY_ATTR_ACTION == SAI_OUTBOUND_ROUTING_ENTRY_ACTION_ROUTE_SERVICE_TUNNEL */ SAI_OUTBOUND_ROUTING_ENTRY_ATTR_DASH_ENCAPSULATION, @@ -210,6 +231,15 @@ typedef enum _sai_outbound_routing_entry_attr_t */ SAI_OUTBOUND_ROUTING_ENTRY_ATTR_COUNTER_ID, + /** + * @brief IP address family for resource accounting + * + * @type sai_ip_addr_family_t + * @flags READ_ONLY + * @isresourcetype true + */ + SAI_OUTBOUND_ROUTING_ENTRY_ATTR_IP_ADDR_FAMILY, + /** * @brief End of attributes */ diff --git a/experimental/saiexperimentaldashpavalidation.h b/experimental/saiexperimentaldashpavalidation.h index 8343069c1..58ffb52d6 100644 --- a/experimental/saiexperimentaldashpavalidation.h +++ b/experimental/saiexperimentaldashpavalidation.h @@ -87,6 +87,15 @@ typedef enum _sai_pa_validation_entry_attr_t */ SAI_PA_VALIDATION_ENTRY_ATTR_ACTION = SAI_PA_VALIDATION_ENTRY_ATTR_START, + /** + * @brief IP address family for resource accounting + * + * @type sai_ip_addr_family_t + * @flags READ_ONLY + * @isresourcetype true + */ + SAI_PA_VALIDATION_ENTRY_ATTR_IP_ADDR_FAMILY, + /** * @brief End of attributes */ diff --git a/experimental/saiexperimentaldashtag.h b/experimental/saiexperimentaldashtag.h new file mode 100644 index 000000000..f16d02cae --- /dev/null +++ b/experimental/saiexperimentaldashtag.h @@ -0,0 +1,367 @@ +/** + * Copyright (c) 2014 Microsoft Open Technologies, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. You may obtain + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT + * LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS + * FOR A PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT. + * + * See the Apache Version 2.0 License for specific language governing + * permissions and limitations under the License. + * + * Microsoft would like to thank the following companies for their review and + * assistance with these files: Intel Corporation, Mellanox Technologies Ltd, + * Dell Products, L.P., Facebook, Inc., Marvell International Ltd. + * + * @file saiexperimentaldashtag.h + * + * @brief This module defines SAI P4 extension interface + */ + +#if !defined (__SAIEXPERIMENTALDASHTAG_H_) +#define __SAIEXPERIMENTALDASHTAG_H_ + +#include + +/** + * @defgroup SAIEXPERIMENTALDASH_TAG SAI - Extension specific API definitions + * + * @{ + */ + +/** + * @brief Entry for dst_tag_entry + */ +typedef struct _sai_dst_tag_entry_t +{ + /** + * @brief Switch ID + * + * @objects SAI_OBJECT_TYPE_SWITCH + */ + sai_object_id_t switch_id; + + /** + * @brief LPM matched key dip + */ + sai_ip_prefix_t dip; + +} sai_dst_tag_entry_t; + +/** + * @brief Attribute ID for dash_tag_dst_tag_entry + */ +typedef enum _sai_dst_tag_entry_attr_t +{ + /** + * @brief Start of attributes + */ + SAI_DST_TAG_ENTRY_ATTR_START, + + /** + * @brief Action set_dst_tag parameter TAG_MAP + * + * @type sai_uint32_t + * @flags CREATE_AND_SET + * @default 0 + */ + SAI_DST_TAG_ENTRY_ATTR_TAG_MAP = SAI_DST_TAG_ENTRY_ATTR_START, + + /** + * @brief IP address family for resource accounting + * + * @type sai_ip_addr_family_t + * @flags READ_ONLY + * @isresourcetype true + */ + SAI_DST_TAG_ENTRY_ATTR_IP_ADDR_FAMILY, + + /** + * @brief End of attributes + */ + SAI_DST_TAG_ENTRY_ATTR_END, + + /** Custom range base value */ + SAI_DST_TAG_ENTRY_ATTR_CUSTOM_RANGE_START = 0x10000000, + + /** End of custom range base */ + SAI_DST_TAG_ENTRY_ATTR_CUSTOM_RANGE_END, + +} sai_dst_tag_entry_attr_t; + +/** + * @brief Entry for src_tag_entry + */ +typedef struct _sai_src_tag_entry_t +{ + /** + * @brief Switch ID + * + * @objects SAI_OBJECT_TYPE_SWITCH + */ + sai_object_id_t switch_id; + + /** + * @brief LPM matched key sip + */ + sai_ip_prefix_t sip; + +} sai_src_tag_entry_t; + +/** + * @brief Attribute ID for dash_tag_src_tag_entry + */ +typedef enum _sai_src_tag_entry_attr_t +{ + /** + * @brief Start of attributes + */ + SAI_SRC_TAG_ENTRY_ATTR_START, + + /** + * @brief Action set_src_tag parameter TAG_MAP + * + * @type sai_uint32_t + * @flags CREATE_AND_SET + * @default 0 + */ + SAI_SRC_TAG_ENTRY_ATTR_TAG_MAP = SAI_SRC_TAG_ENTRY_ATTR_START, + + /** + * @brief IP address family for resource accounting + * + * @type sai_ip_addr_family_t + * @flags READ_ONLY + * @isresourcetype true + */ + SAI_SRC_TAG_ENTRY_ATTR_IP_ADDR_FAMILY, + + /** + * @brief End of attributes + */ + SAI_SRC_TAG_ENTRY_ATTR_END, + + /** Custom range base value */ + SAI_SRC_TAG_ENTRY_ATTR_CUSTOM_RANGE_START = 0x10000000, + + /** End of custom range base */ + SAI_SRC_TAG_ENTRY_ATTR_CUSTOM_RANGE_END, + +} sai_src_tag_entry_attr_t; + +/** + * @brief Create dash_tag_dst_tag_entry + * + * @param[in] dst_tag_entry Entry + * @param[in] attr_count Number of attributes + * @param[in] attr_list Array of attributes + * + * @return #SAI_STATUS_SUCCESS on success Failure status code on error + */ +typedef sai_status_t (*sai_create_dst_tag_entry_fn)( + _In_ const sai_dst_tag_entry_t *dst_tag_entry, + _In_ uint32_t attr_count, + _In_ const sai_attribute_t *attr_list); + +/** + * @brief Remove dash_tag_dst_tag_entry + * + * @param[in] dst_tag_entry Entry + * + * @return #SAI_STATUS_SUCCESS on success Failure status code on error + */ +typedef sai_status_t (*sai_remove_dst_tag_entry_fn)( + _In_ const sai_dst_tag_entry_t *dst_tag_entry); + +/** + * @brief Set attribute for dash_tag_dst_tag_entry + * + * @param[in] dst_tag_entry Entry + * @param[in] attr Attribute + * + * @return #SAI_STATUS_SUCCESS on success Failure status code on error + */ +typedef sai_status_t (*sai_set_dst_tag_entry_attribute_fn)( + _In_ const sai_dst_tag_entry_t *dst_tag_entry, + _In_ const sai_attribute_t *attr); + +/** + * @brief Get attribute for dash_tag_dst_tag_entry + * + * @param[in] dst_tag_entry Entry + * @param[in] attr_count Number of attributes + * @param[inout] attr_list Array of attributes + * + * @return #SAI_STATUS_SUCCESS on success Failure status code on error + */ +typedef sai_status_t (*sai_get_dst_tag_entry_attribute_fn)( + _In_ const sai_dst_tag_entry_t *dst_tag_entry, + _In_ uint32_t attr_count, + _Inout_ sai_attribute_t *attr_list); + +/** + * @brief Bulk create dash_tag_dst_tag_entry + * + * @param[in] object_count Number of objects to create + * @param[in] dst_tag_entry List of object to create + * @param[in] attr_count List of attr_count. Caller passes the number + * of attribute for each object to create. + * @param[in] attr_list List of attributes for every object. + * @param[in] mode Bulk operation error handling mode. + * @param[out] object_statuses List of status for every object. Caller needs to + * allocate the buffer + * + * @return #SAI_STATUS_SUCCESS on success when all objects are created or + * #SAI_STATUS_FAILURE when any of the objects fails to create. When there is + * failure, Caller is expected to go through the list of returned statuses to + * find out which fails and which succeeds. + */ +typedef sai_status_t (*sai_bulk_create_dst_tag_entry_fn)( + _In_ uint32_t object_count, + _In_ const sai_dst_tag_entry_t *dst_tag_entry, + _In_ const uint32_t *attr_count, + _In_ const sai_attribute_t **attr_list, + _In_ sai_bulk_op_error_mode_t mode, + _Out_ sai_status_t *object_statuses); + +/** + * @brief Bulk remove dash_tag_dst_tag_entry + * + * @param[in] object_count Number of objects to remove + * @param[in] dst_tag_entry List of objects to remove + * @param[in] mode Bulk operation error handling mode. + * @param[out] object_statuses List of status for every object. Caller needs to + * allocate the buffer + * + * @return #SAI_STATUS_SUCCESS on success when all objects are removed or + * #SAI_STATUS_FAILURE when any of the objects fails to remove. When there is + * failure, Caller is expected to go through the list of returned statuses to + * find out which fails and which succeeds. + */ +typedef sai_status_t (*sai_bulk_remove_dst_tag_entry_fn)( + _In_ uint32_t object_count, + _In_ const sai_dst_tag_entry_t *dst_tag_entry, + _In_ sai_bulk_op_error_mode_t mode, + _Out_ sai_status_t *object_statuses); + +/** + * @brief Create dash_tag_src_tag_entry + * + * @param[in] src_tag_entry Entry + * @param[in] attr_count Number of attributes + * @param[in] attr_list Array of attributes + * + * @return #SAI_STATUS_SUCCESS on success Failure status code on error + */ +typedef sai_status_t (*sai_create_src_tag_entry_fn)( + _In_ const sai_src_tag_entry_t *src_tag_entry, + _In_ uint32_t attr_count, + _In_ const sai_attribute_t *attr_list); + +/** + * @brief Remove dash_tag_src_tag_entry + * + * @param[in] src_tag_entry Entry + * + * @return #SAI_STATUS_SUCCESS on success Failure status code on error + */ +typedef sai_status_t (*sai_remove_src_tag_entry_fn)( + _In_ const sai_src_tag_entry_t *src_tag_entry); + +/** + * @brief Set attribute for dash_tag_src_tag_entry + * + * @param[in] src_tag_entry Entry + * @param[in] attr Attribute + * + * @return #SAI_STATUS_SUCCESS on success Failure status code on error + */ +typedef sai_status_t (*sai_set_src_tag_entry_attribute_fn)( + _In_ const sai_src_tag_entry_t *src_tag_entry, + _In_ const sai_attribute_t *attr); + +/** + * @brief Get attribute for dash_tag_src_tag_entry + * + * @param[in] src_tag_entry Entry + * @param[in] attr_count Number of attributes + * @param[inout] attr_list Array of attributes + * + * @return #SAI_STATUS_SUCCESS on success Failure status code on error + */ +typedef sai_status_t (*sai_get_src_tag_entry_attribute_fn)( + _In_ const sai_src_tag_entry_t *src_tag_entry, + _In_ uint32_t attr_count, + _Inout_ sai_attribute_t *attr_list); + +/** + * @brief Bulk create dash_tag_src_tag_entry + * + * @param[in] object_count Number of objects to create + * @param[in] src_tag_entry List of object to create + * @param[in] attr_count List of attr_count. Caller passes the number + * of attribute for each object to create. + * @param[in] attr_list List of attributes for every object. + * @param[in] mode Bulk operation error handling mode. + * @param[out] object_statuses List of status for every object. Caller needs to + * allocate the buffer + * + * @return #SAI_STATUS_SUCCESS on success when all objects are created or + * #SAI_STATUS_FAILURE when any of the objects fails to create. When there is + * failure, Caller is expected to go through the list of returned statuses to + * find out which fails and which succeeds. + */ +typedef sai_status_t (*sai_bulk_create_src_tag_entry_fn)( + _In_ uint32_t object_count, + _In_ const sai_src_tag_entry_t *src_tag_entry, + _In_ const uint32_t *attr_count, + _In_ const sai_attribute_t **attr_list, + _In_ sai_bulk_op_error_mode_t mode, + _Out_ sai_status_t *object_statuses); + +/** + * @brief Bulk remove dash_tag_src_tag_entry + * + * @param[in] object_count Number of objects to remove + * @param[in] src_tag_entry List of objects to remove + * @param[in] mode Bulk operation error handling mode. + * @param[out] object_statuses List of status for every object. Caller needs to + * allocate the buffer + * + * @return #SAI_STATUS_SUCCESS on success when all objects are removed or + * #SAI_STATUS_FAILURE when any of the objects fails to remove. When there is + * failure, Caller is expected to go through the list of returned statuses to + * find out which fails and which succeeds. + */ +typedef sai_status_t (*sai_bulk_remove_src_tag_entry_fn)( + _In_ uint32_t object_count, + _In_ const sai_src_tag_entry_t *src_tag_entry, + _In_ sai_bulk_op_error_mode_t mode, + _Out_ sai_status_t *object_statuses); + +typedef struct _sai_dash_tag_api_t +{ + sai_create_dst_tag_entry_fn create_dst_tag_entry; + sai_remove_dst_tag_entry_fn remove_dst_tag_entry; + sai_set_dst_tag_entry_attribute_fn set_dst_tag_entry_attribute; + sai_get_dst_tag_entry_attribute_fn get_dst_tag_entry_attribute; + sai_bulk_create_dst_tag_entry_fn create_dst_tag_entries; + sai_bulk_remove_dst_tag_entry_fn remove_dst_tag_entries; + + sai_create_src_tag_entry_fn create_src_tag_entry; + sai_remove_src_tag_entry_fn remove_src_tag_entry; + sai_set_src_tag_entry_attribute_fn set_src_tag_entry_attribute; + sai_get_src_tag_entry_attribute_fn get_src_tag_entry_attribute; + sai_bulk_create_src_tag_entry_fn create_src_tag_entries; + sai_bulk_remove_src_tag_entry_fn remove_src_tag_entries; + +} sai_dash_tag_api_t; + +/** + * @} + */ +#endif /** __SAIEXPERIMENTALDASHTAG_H_ */ diff --git a/experimental/saiexperimentaldashvip.h b/experimental/saiexperimentaldashvip.h index c11f0aa68..2d1d1aedb 100644 --- a/experimental/saiexperimentaldashvip.h +++ b/experimental/saiexperimentaldashvip.h @@ -80,6 +80,15 @@ typedef enum _sai_vip_entry_attr_t */ SAI_VIP_ENTRY_ATTR_ACTION = SAI_VIP_ENTRY_ATTR_START, + /** + * @brief IP address family for resource accounting + * + * @type sai_ip_addr_family_t + * @flags READ_ONLY + * @isresourcetype true + */ + SAI_VIP_ENTRY_ATTR_IP_ADDR_FAMILY, + /** * @brief End of attributes */ diff --git a/experimental/saiextensions.h b/experimental/saiextensions.h index db989c391..34d0793be 100644 --- a/experimental/saiextensions.h +++ b/experimental/saiextensions.h @@ -32,6 +32,8 @@ #include "saiswitchextensions.h" /* new experimental object type includes */ +#include "saiexperimentaldashmeter.h" +#include "saiexperimentaldashtag.h" #include "saiexperimentaldashvip.h" #include "saiexperimentaldashpavalidation.h" #include "saiexperimentaldashvnet.h" @@ -72,6 +74,10 @@ typedef enum _sai_api_extensions_t SAI_API_DASH_VIP, + SAI_API_DASH_TAG, + + SAI_API_DASH_METER, + /* Add new experimental APIs above this line */ SAI_API_EXTENSIONS_RANGE_END diff --git a/experimental/saitypesextensions.h b/experimental/saitypesextensions.h index b6a4e1282..e9f00cb7a 100644 --- a/experimental/saitypesextensions.h +++ b/experimental/saitypesextensions.h @@ -64,6 +64,16 @@ typedef enum _sai_object_type_extensions_t SAI_OBJECT_TYPE_VIP_ENTRY, + SAI_OBJECT_TYPE_DST_TAG_ENTRY, + + SAI_OBJECT_TYPE_SRC_TAG_ENTRY, + + SAI_OBJECT_TYPE_METER_BUCKET, + + SAI_OBJECT_TYPE_METER_POLICY, + + SAI_OBJECT_TYPE_METER_RULE, + /* Add new experimental object types above this line */ SAI_OBJECT_TYPE_EXTENSIONS_RANGE_END diff --git a/inc/saiobject.h b/inc/saiobject.h index 8ee253aac..f4eaca50b 100644 --- a/inc/saiobject.h +++ b/inc/saiobject.h @@ -37,6 +37,8 @@ #include /* new experimental object type includes */ +#include +#include #include #include #include @@ -114,6 +116,12 @@ typedef union _sai_object_key_entry_t /** @validonly object_type == SAI_OBJECT_TYPE_VIP_ENTRY */ sai_vip_entry_t vip_entry; + /** @validonly object_type == SAI_OBJECT_TYPE_DST_TAG_ENTRY */ + sai_dst_tag_entry_t dst_tag_entry; + + /** @validonly object_type == SAI_OBJECT_TYPE_SRC_TAG_ENTRY */ + sai_src_tag_entry_t src_tag_entry; + /* Add new experimental entries above this line */ } sai_object_key_entry_t;