diff --git a/experimental/saiexperimentaldashinboundrouting.h b/experimental/saiexperimentaldashinboundrouting.h index 041253be0..473ab0650 100644 --- a/experimental/saiexperimentaldashinboundrouting.h +++ b/experimental/saiexperimentaldashinboundrouting.h @@ -111,7 +111,27 @@ typedef enum _sai_inbound_routing_entry_attr_t SAI_INBOUND_ROUTING_ENTRY_ATTR_ACTION = SAI_INBOUND_ROUTING_ENTRY_ATTR_START, /** - * @brief Action vxlan_decap_pa_validate parameter SRC_VNET_ID + * @brief Action tunnel_decap, tunnel_decap_pa_validate parameter METER_CLASS_OR + * + * @type sai_uint32_t + * @flags CREATE_AND_SET + * @default 0 + * @validonly SAI_INBOUND_ROUTING_ENTRY_ATTR_ACTION == SAI_INBOUND_ROUTING_ENTRY_ACTION_VXLAN_DECAP or SAI_INBOUND_ROUTING_ENTRY_ATTR_ACTION == SAI_INBOUND_ROUTING_ENTRY_ACTION_VXLAN_DECAP_PA_VALIDATE + */ + SAI_INBOUND_ROUTING_ENTRY_ATTR_METER_CLASS_OR, + + /** + * @brief Action tunnel_decap, tunnel_decap_pa_validate parameter METER_CLASS_AND + * + * @type sai_uint32_t + * @flags CREATE_AND_SET + * @default 4294967295 + * @validonly SAI_INBOUND_ROUTING_ENTRY_ATTR_ACTION == SAI_INBOUND_ROUTING_ENTRY_ACTION_VXLAN_DECAP or SAI_INBOUND_ROUTING_ENTRY_ATTR_ACTION == SAI_INBOUND_ROUTING_ENTRY_ACTION_VXLAN_DECAP_PA_VALIDATE + */ + SAI_INBOUND_ROUTING_ENTRY_ATTR_METER_CLASS_AND, + + /** + * @brief Action tunnel_decap_pa_validate parameter SRC_VNET_ID * * @type sai_object_id_t * @flags CREATE_AND_SET diff --git a/experimental/saiexperimentaldashmeter.h b/experimental/saiexperimentaldashmeter.h index 098535e20..6802baa98 100644 --- a/experimental/saiexperimentaldashmeter.h +++ b/experimental/saiexperimentaldashmeter.h @@ -57,28 +57,11 @@ typedef enum _sai_meter_bucket_attr_t /** * @brief Exact matched key meter_class * - * @type sai_uint16_t + * @type sai_uint32_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 */ @@ -92,6 +75,19 @@ typedef enum _sai_meter_bucket_attr_t } sai_meter_bucket_attr_t; +/** + * @brief Counter IDs for meter_bucket in sai_get_meter_bucket_stats() call + */ +typedef enum _sai_meter_bucket_stat_t +{ + /** DASH METER_BUCKET OUTBOUND_BYTES stat count */ + SAI_METER_BUCKET_STAT_OUTBOUND_BYTES, + + /** DASH METER_BUCKET INBOUND_BYTES stat count */ + SAI_METER_BUCKET_STAT_INBOUND_BYTES, + +} sai_meter_bucket_stat_t; + /** * @brief Attribute ID for dash_meter_meter_policy */ @@ -164,9 +160,8 @@ typedef enum _sai_meter_rule_attr_t /** * @brief Action set_policy_meter_class parameter METER_CLASS * - * @type sai_uint16_t + * @type sai_uint32_t * @flags CREATE_AND_SET - * @isvlan false * @default 0 */ SAI_METER_RULE_ATTR_METER_CLASS, @@ -253,6 +248,54 @@ typedef sai_status_t (*sai_get_meter_bucket_attribute_fn)( _In_ uint32_t attr_count, _Inout_ sai_attribute_t *attr_list); +/** + * @brief Get meter_bucket statistics counters. Deprecated for backward compatibility. + * + * @param[in] meter_bucket_id Entry id + * @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_meter_bucket_stats_fn)( + _In_ sai_object_id_t meter_bucket_id, + _In_ uint32_t number_of_counters, + _In_ const sai_stat_id_t *counter_ids, + _Out_ uint64_t *counters); + +/** + * @brief Get meter_bucket statistics counters extended. + * + * @param[in] meter_bucket_id Entry id + * @param[in] number_of_counters Number of counters in the array + * @param[in] counter_ids Specifies the array of counter ids + * @param[in] mode Statistics mode + * @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_meter_bucket_stats_ext_fn)( + _In_ sai_object_id_t meter_bucket_id, + _In_ uint32_t number_of_counters, + _In_ const sai_stat_id_t *counter_ids, + _In_ sai_stats_mode_t mode, + _Out_ uint64_t *counters); + +/** + * @brief Clear meter_bucket statistics counters. + * + * @param[in] meter_bucket_id Entry id + * @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_meter_bucket_stats_fn)( + _In_ sai_object_id_t meter_bucket_id, + _In_ uint32_t number_of_counters, + _In_ const sai_stat_id_t *counter_ids); + /** * @brief Create dash_meter_meter_policy * @@ -363,6 +406,9 @@ typedef struct _sai_dash_meter_api_t 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_get_meter_bucket_stats_fn get_meter_bucket_stats; + sai_get_meter_bucket_stats_ext_fn get_meter_bucket_stats_ext; + sai_clear_meter_bucket_stats_fn clear_meter_bucket_stats; sai_bulk_object_create_fn create_meter_buckets; sai_bulk_object_remove_fn remove_meter_buckets; diff --git a/experimental/saiexperimentaldashoutboundcatopa.h b/experimental/saiexperimentaldashoutboundcatopa.h index 29d56f7a0..3fea47413 100644 --- a/experimental/saiexperimentaldashoutboundcatopa.h +++ b/experimental/saiexperimentaldashoutboundcatopa.h @@ -122,25 +122,14 @@ 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, set_private_link_mapping parameter METER_CLASS + * @brief Action set_tunnel_mapping, set_private_link_mapping parameter METER_CLASS_OR * - * @type sai_uint16_t + * @type sai_uint32_t * @flags CREATE_AND_SET - * @isvlan false * @default 0 * @validonly SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_ACTION == SAI_OUTBOUND_CA_TO_PA_ENTRY_ACTION_SET_TUNNEL_MAPPING or SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_ACTION == SAI_OUTBOUND_CA_TO_PA_ENTRY_ACTION_SET_PRIVATE_LINK_MAPPING */ - SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_METER_CLASS, - - /** - * @brief Action set_tunnel_mapping, set_private_link_mapping parameter METER_CLASS_OVERRIDE - * - * @type bool - * @flags CREATE_AND_SET - * @default false - * @validonly SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_ACTION == SAI_OUTBOUND_CA_TO_PA_ENTRY_ACTION_SET_TUNNEL_MAPPING or SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_ACTION == SAI_OUTBOUND_CA_TO_PA_ENTRY_ACTION_SET_PRIVATE_LINK_MAPPING - */ - SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_METER_CLASS_OVERRIDE, + SAI_OUTBOUND_CA_TO_PA_ENTRY_ATTR_METER_CLASS_OR, /** * @brief Action set_private_link_mapping parameter OVERLAY_SIP diff --git a/experimental/saiexperimentaldashoutboundrouting.h b/experimental/saiexperimentaldashoutboundrouting.h index 18b57fd94..623f55cdd 100644 --- a/experimental/saiexperimentaldashoutboundrouting.h +++ b/experimental/saiexperimentaldashoutboundrouting.h @@ -110,25 +110,24 @@ 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 + * @brief Action route_vnet, route_vnet_direct, route_direct, route_service_tunnel parameter METER_CLASS_OR * - * @type bool + * @type sai_uint32_t * @flags CREATE_AND_SET - * @default 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_POLICY_EN, + SAI_OUTBOUND_ROUTING_ENTRY_ATTR_METER_CLASS_OR, /** - * @brief Action route_vnet, route_vnet_direct, route_direct, route_service_tunnel parameter METER_CLASS + * @brief Action route_vnet, route_vnet_direct, route_direct, route_service_tunnel parameter METER_CLASS_AND * - * @type sai_uint16_t + * @type sai_uint32_t * @flags CREATE_AND_SET - * @isvlan false - * @default 0 + * @default 4294967295 * @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, + SAI_OUTBOUND_ROUTING_ENTRY_ATTR_METER_CLASS_AND, /** * @brief Action route_vnet_direct parameter OVERLAY_IP diff --git a/experimental/saiswitchextensions.h b/experimental/saiswitchextensions.h index 0bd28a7ad..e34508ec0 100644 --- a/experimental/saiswitchextensions.h +++ b/experimental/saiswitchextensions.h @@ -37,6 +37,14 @@ typedef enum _sai_switch_attr_extensions_t { SAI_SWITCH_ATTR_EXTENSIONS_RANGE_START = SAI_SWITCH_ATTR_END, + /** + * @brief Maximum number of meter buckets per ENI. + * + * @type sai_uint32_t + * @flags READ_ONLY + */ + SAI_SWITCH_ATTR_DASH_CAPS_MAX_METER_BUCKET_COUNT_PER_ENI = SAI_SWITCH_ATTR_EXTENSIONS_RANGE_START, + SAI_SWITCH_ATTR_EXTENSIONS_RANGE_END } sai_switch_attr_extensions_t;