SAI Metadata
Loading...
Searching...
No Matches
SAI - QOS Policer specific API definitions

Classes

struct  _sai_policer_api_t
 Policer methods table retrieved with sai_api_query() More...
 

Typedefs

typedef enum _sai_meter_type_t sai_meter_type_t
 Enum defining types of meters.
 
typedef enum _sai_policer_mode_t sai_policer_mode_t
 Enum defining mode of the policer object.
 
typedef enum _sai_policer_color_source_t sai_policer_color_source_t
 Enum defining Policer color source.
 
typedef enum _sai_policer_attr_t sai_policer_attr_t
 Enum defining Policer Attributes.
 
typedef enum _sai_policer_stat_t sai_policer_stat_t
 Enum defining policer statistics.
 
typedef sai_status_t(* sai_create_policer_fn) (_Out_ sai_object_id_t *policer_id, _In_ sai_object_id_t switch_id, _In_ uint32_t attr_count, _In_ const sai_attribute_t *attr_list)
 Create Policer.
 
typedef sai_status_t(* sai_remove_policer_fn) (_In_ sai_object_id_t policer_id)
 Delete policer.
 
typedef sai_status_t(* sai_set_policer_attribute_fn) (_In_ sai_object_id_t policer_id, _In_ const sai_attribute_t *attr)
 Set Policer attribute.
 
typedef sai_status_t(* sai_get_policer_attribute_fn) (_In_ sai_object_id_t policer_id, _In_ uint32_t attr_count, _Inout_ sai_attribute_t *attr_list)
 Get Policer attribute.
 
typedef sai_status_t(* sai_get_policer_stats_fn) (_In_ sai_object_id_t policer_id, _In_ uint32_t number_of_counters, _In_ const sai_stat_id_t *counter_ids, _Out_ uint64_t *counters)
 Get Policer Statistics. Deprecated for backward compatibility.
 
typedef sai_status_t(* sai_get_policer_stats_ext_fn) (_In_ sai_object_id_t policer_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)
 Get Policer Statistics extended.
 
typedef sai_status_t(* sai_clear_policer_stats_fn) (_In_ sai_object_id_t policer_id, _In_ uint32_t number_of_counters, _In_ const sai_stat_id_t *counter_ids)
 Clear Policer statistics counters.
 
typedef struct _sai_policer_api_t sai_policer_api_t
 Policer methods table retrieved with sai_api_query()
 

Enumerations

enum  _sai_meter_type_t { SAI_METER_TYPE_PACKETS = 0x00000000 , SAI_METER_TYPE_BYTES = 0x00000001 , SAI_METER_TYPE_CUSTOM_RANGE_BASE = 0x10000000 }
 Enum defining types of meters. More...
 
enum  _sai_policer_mode_t { SAI_POLICER_MODE_SR_TCM = 0x00000000 , SAI_POLICER_MODE_TR_TCM = 0x00000001 , SAI_POLICER_MODE_STORM_CONTROL = 0x00000002 , SAI_POLICER_MODE_CUSTOM_RANGE_BASE = 0x10000000 }
 Enum defining mode of the policer object. More...
 
enum  _sai_policer_color_source_t { SAI_POLICER_COLOR_SOURCE_BLIND = 0x00000000 , SAI_POLICER_COLOR_SOURCE_AWARE = 0x00000001 , SAI_POLICER_COLOR_SOURCE_CUSTOM_RANGE_BASE = 0x10000000 }
 Enum defining Policer color source. More...
 
enum  _sai_policer_attr_t {
  SAI_POLICER_ATTR_START = 0x00000000 , SAI_POLICER_ATTR_METER_TYPE = SAI_POLICER_ATTR_START , SAI_POLICER_ATTR_MODE = 0x00000001 , SAI_POLICER_ATTR_COLOR_SOURCE = 0x00000002 ,
  SAI_POLICER_ATTR_CBS = 0x00000003 , SAI_POLICER_ATTR_CIR = 0x00000004 , SAI_POLICER_ATTR_PBS = 0x00000005 , SAI_POLICER_ATTR_PIR = 0x00000006 ,
  SAI_POLICER_ATTR_GREEN_PACKET_ACTION = 0x00000007 , SAI_POLICER_ATTR_YELLOW_PACKET_ACTION = 0x00000008 , SAI_POLICER_ATTR_RED_PACKET_ACTION = 0x00000009 , SAI_POLICER_ATTR_ENABLE_COUNTER_PACKET_ACTION_LIST = 0x0000000a ,
  SAI_POLICER_ATTR_OBJECT_STAGE = 0x0000000b , SAI_POLICER_ATTR_END , SAI_POLICER_ATTR_CUSTOM_RANGE_START = 0x10000000 , SAI_POLICER_ATTR_CUSTOM_RANGE_END
}
 Enum defining Policer Attributes. More...
 
enum  _sai_policer_stat_t {
  SAI_POLICER_STAT_PACKETS = 0x00000000 , SAI_POLICER_STAT_ATTR_BYTES = 0x00000001 , SAI_POLICER_STAT_GREEN_PACKETS = 0x00000002 , SAI_POLICER_STAT_GREEN_BYTES = 0x00000003 ,
  SAI_POLICER_STAT_YELLOW_PACKETS = 0x00000004 , SAI_POLICER_STAT_YELLOW_BYTES = 0x00000005 , SAI_POLICER_STAT_RED_PACKETS = 0x00000006 , SAI_POLICER_STAT_RED_BYTES = 0x00000007 ,
  SAI_POLICER_STAT_CUSTOM_RANGE_BASE = 0x10000000
}
 Enum defining policer statistics. More...
 

Detailed Description

Typedef Documentation

◆ sai_clear_policer_stats_fn

typedef sai_status_t(* sai_clear_policer_stats_fn) (_In_ sai_object_id_t policer_id, _In_ uint32_t number_of_counters, _In_ const sai_stat_id_t *counter_ids)

Clear Policer statistics counters.

Parameters
[in]policer_idPolicer id
[in]number_of_countersNumber of counters in the array
[in]counter_idsSpecifies the array of counter ids
Returns
SAI_STATUS_SUCCESS on success, failure status code on error

Definition at line 354 of file saipolicer.h.

◆ sai_create_policer_fn

typedef sai_status_t(* sai_create_policer_fn) (_Out_ sai_object_id_t *policer_id, _In_ sai_object_id_t switch_id, _In_ uint32_t attr_count, _In_ const sai_attribute_t *attr_list)

Create Policer.

Parameters
[out]policer_idThe policer id
[in]switch_idSwitch id
[in]attr_countNumber of attributes
[in]attr_listArray of attributes
Returns
SAI_STATUS_SUCCESS on success, failure status code on error

Definition at line 269 of file saipolicer.h.

◆ sai_get_policer_attribute_fn

typedef sai_status_t(* sai_get_policer_attribute_fn) (_In_ sai_object_id_t policer_id, _In_ uint32_t attr_count, _Inout_ sai_attribute_t *attr_list)

Get Policer attribute.

Parameters
[in]policer_idPolicer id
[in]attr_countNumber of attributes
[in,out]attr_listArray of attributes
Returns
SAI_STATUS_SUCCESS on success, failure status code on error

Definition at line 306 of file saipolicer.h.

◆ sai_get_policer_stats_ext_fn

typedef sai_status_t(* sai_get_policer_stats_ext_fn) (_In_ sai_object_id_t policer_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)

Get Policer Statistics extended.

Parameters
[in]policer_idPolicer id
[in]number_of_countersNumber of counters in the array
[in]counter_idsArray of counter ids
[in]modeStatistics mode
[out]countersArray of resulting counter values.
Returns
SAI_STATUS_SUCCESS on success, failure status code on error

Definition at line 338 of file saipolicer.h.

◆ sai_get_policer_stats_fn

typedef sai_status_t(* sai_get_policer_stats_fn) (_In_ sai_object_id_t policer_id, _In_ uint32_t number_of_counters, _In_ const sai_stat_id_t *counter_ids, _Out_ uint64_t *counters)

Get Policer Statistics. Deprecated for backward compatibility.

Parameters
[in]policer_idPolicer id
[in]number_of_countersNumber of counters in the array
[in]counter_idsArray of counter ids
[out]countersArray of resulting counter values.
Returns
SAI_STATUS_SUCCESS on success, failure status code on error

Definition at line 321 of file saipolicer.h.

◆ sai_remove_policer_fn

typedef sai_status_t(* sai_remove_policer_fn) (_In_ sai_object_id_t policer_id)

Delete policer.

Parameters
[in]policer_idPolicer id
Returns
SAI_STATUS_SUCCESS on success, failure status code on error

Definition at line 282 of file saipolicer.h.

◆ sai_set_policer_attribute_fn

typedef sai_status_t(* sai_set_policer_attribute_fn) (_In_ sai_object_id_t policer_id, _In_ const sai_attribute_t *attr)

Set Policer attribute.

Parameters
[in]policer_idPolicer id
[in]attrAttribute
Returns
SAI_STATUS_SUCCESS on success, failure status code on error

Definition at line 293 of file saipolicer.h.

Enumeration Type Documentation

◆ _sai_meter_type_t

Enum defining types of meters.

Enumerator
SAI_METER_TYPE_PACKETS 

Metering is done based on packets

SAI_METER_TYPE_BYTES 

Metering is done based on bytes

SAI_METER_TYPE_CUSTOM_RANGE_BASE 

Custom range base value

Definition at line 39 of file saipolicer.h.

◆ _sai_policer_attr_t

Enum defining Policer Attributes.

Enumerator
SAI_POLICER_ATTR_START 

Start of attributes.

SAI_POLICER_ATTR_METER_TYPE 

Policer Meter Type.

Value Type:
sai_meter_type_t
Flags:
MANDATORY_ON_CREATE | CREATE_ONLY
SAI_POLICER_ATTR_MODE 

Policer mode.

Value Type:
sai_policer_mode_t
Flags:
MANDATORY_ON_CREATE | CREATE_ONLY
SAI_POLICER_ATTR_COLOR_SOURCE 

Policer Color Source.

Value Type:
sai_policer_color_source_t
Flags:
CREATE_ONLY
Default value:
SAI_POLICER_COLOR_SOURCE_AWARE
SAI_POLICER_ATTR_CBS 

Committed burst size bytes/packets based on SAI_POLICER_ATTR_METER_TYPE.

Value Type:
sai_uint64_t
Flags:
CREATE_AND_SET
Default value:
0
SAI_POLICER_ATTR_CIR 

Committed information rate BPS/PPS based on SAI_POLICER_ATTR_METER_TYPE.

Value Type:
sai_uint64_t
Flags:
CREATE_AND_SET
Default value:
0
SAI_POLICER_ATTR_PBS 

Peak burst size bytes/packets based on SAI_POLICER_ATTR_METER_TYPE.

Value Type:
sai_uint64_t
Flags:
CREATE_AND_SET
Default value:
0
SAI_POLICER_ATTR_PIR 

Peak information rate BPS/PPS based on SAI_POLICER_ATTR_METER_TYPE.

Value Type:
sai_uint64_t
Flags:
CREATE_AND_SET
Default value:
0
Valid only when:
SAI_POLICER_ATTR_MODE == SAI_POLICER_MODE_TR_TCM
SAI_POLICER_ATTR_GREEN_PACKET_ACTION 

Action to take for Green color packets.

Value Type:
sai_packet_action_t
Flags:
CREATE_AND_SET
Default value:
SAI_PACKET_ACTION_FORWARD
SAI_POLICER_ATTR_YELLOW_PACKET_ACTION 

Action to take for Yellow color packets.

Value Type:
sai_packet_action_t
Flags:
CREATE_AND_SET
Default value:
SAI_PACKET_ACTION_FORWARD
SAI_POLICER_ATTR_RED_PACKET_ACTION 

Action to take for RED color packets.

For storm control action should be used as red packet action.

Value Type:
sai_packet_action_t
Flags:
CREATE_AND_SET
Default value:
SAI_PACKET_ACTION_FORWARD
SAI_POLICER_ATTR_ENABLE_COUNTER_PACKET_ACTION_LIST 

Enable/disable counter.

Default disabled. Modify list needs full new set.

Value Type:
sai_s32_list_t sai_packet_action_t
Flags:
CREATE_AND_SET
Default value:
empty
SAI_POLICER_ATTR_OBJECT_STAGE 

Policer pool stage.

Value Type:
sai_object_stage_t
Flags:
CREATE_ONLY
Default value:
SAI_OBJECT_STAGE_BOTH
SAI_POLICER_ATTR_END 

End of attributes.

SAI_POLICER_ATTR_CUSTOM_RANGE_START 

Custom range base value

SAI_POLICER_ATTR_CUSTOM_RANGE_END 

End of custom range base

Definition at line 90 of file saipolicer.h.

◆ _sai_policer_color_source_t

Enum defining Policer color source.

Enumerator
SAI_POLICER_COLOR_SOURCE_BLIND 

Previous coloring schemes are ignored

SAI_POLICER_COLOR_SOURCE_AWARE 

Previous coloring schemes are used

SAI_POLICER_COLOR_SOURCE_CUSTOM_RANGE_BASE 

Custom range base value

Definition at line 74 of file saipolicer.h.

◆ _sai_policer_mode_t

Enum defining mode of the policer object.

Enumerator
SAI_POLICER_MODE_SR_TCM 

RFC 2697, Single Rate Three color marker, CIR, CBS and PBS, G, Y and R

SAI_POLICER_MODE_TR_TCM 

RFC 2698, Two Rate Three color marker, CIR, CBS, PIR and PBS, G, Y and R

SAI_POLICER_MODE_STORM_CONTROL 

Storm control mode. Single Rate Two color CIR, CBS, G and R

SAI_POLICER_MODE_CUSTOM_RANGE_BASE 

Custom range base value

Definition at line 55 of file saipolicer.h.

◆ _sai_policer_stat_t

Enum defining policer statistics.

Enumerator
SAI_POLICER_STAT_PACKETS 

Get/set packet count [uint64_t]

SAI_POLICER_STAT_ATTR_BYTES 

Get/set byte count [uint64_t]

SAI_POLICER_STAT_GREEN_PACKETS 

Get/set green packet count [uint64_t]

SAI_POLICER_STAT_GREEN_BYTES 

Get/set green byte count [uint64_t]

SAI_POLICER_STAT_YELLOW_PACKETS 

Get/set yellow packet count [uint64_t]

SAI_POLICER_STAT_YELLOW_BYTES 

Get/set yellow byte count [uint64_t]

SAI_POLICER_STAT_RED_PACKETS 

Get/set red packet count [uint64_t]

SAI_POLICER_STAT_RED_BYTES 

Get/set red byte count [uint64_t]

SAI_POLICER_STAT_CUSTOM_RANGE_BASE 

Custom range base value

Definition at line 228 of file saipolicer.h.