Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SAI Proposal for Counter enhancement. #1941

Merged
merged 1 commit into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,484 changes: 1,484 additions & 0 deletions doc/SAI-Counter-enhancement-hld.md

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions inc/saibfd.h
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,28 @@ typedef enum _sai_bfd_session_attr_t
*/
SAI_BFD_SESSION_ATTR_SRV6_SIDLIST_ID,

/**
* @brief Set BFD session statistics counting mode
*
* @type sai_stats_count_mode_t
* @flags CREATE_AND_SET
* @default SAI_STATS_COUNT_MODE_PACKET_AND_BYTE
*/
SAI_BFD_SESSION_ATTR_STATS_COUNT_MODE,

/**
* @brief Attach counter object list
*
* Counter object should be of type Selective.
* Fill (#SAI_COUNTER_ATTR_TYPE with #SAI_COUNTER_TYPE_SELECTIVE).
*
* @type sai_object_list_t
* @flags CREATE_AND_SET
* @objects SAI_OBJECT_TYPE_COUNTER
* @default empty
*/
SAI_BFD_SESSION_ATTR_SELECTIVE_COUNTER_LIST,

/**
* @brief End of attributes
*/
Expand Down
44 changes: 44 additions & 0 deletions inc/saibridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,28 @@ typedef enum _sai_bridge_port_attr_t
*/
SAI_BRIDGE_PORT_ATTR_ISOLATION_GROUP,

/**
* @brief Set bridge port statistics counting mode
*
* @type sai_stats_count_mode_t
* @flags CREATE_AND_SET
* @default SAI_STATS_COUNT_MODE_PACKET_AND_BYTE
*/
SAI_BRIDGE_PORT_ATTR_STATS_COUNT_MODE,

/**
* @brief Attach counter object list
*
* Counter object should be of type Selective.
* Fill (#SAI_COUNTER_ATTR_TYPE with #SAI_COUNTER_TYPE_SELECTIVE).
*
* @type sai_object_list_t
* @flags CREATE_AND_SET
* @objects SAI_OBJECT_TYPE_COUNTER
* @default empty
*/
SAI_BRIDGE_PORT_ATTR_SELECTIVE_COUNTER_LIST,

/**
* @brief End of attributes
*/
Expand Down Expand Up @@ -563,6 +585,28 @@ typedef enum _sai_bridge_attr_t
*/
SAI_BRIDGE_ATTR_BROADCAST_FLOOD_GROUP,

/**
* @brief Set bridge statistics counting mode
*
* @type sai_stats_count_mode_t
* @flags CREATE_AND_SET
* @default SAI_STATS_COUNT_MODE_PACKET_AND_BYTE
*/
SAI_BRIDGE_ATTR_STATS_COUNT_MODE,

/**
* @brief Attach counter object list
*
* Counter object should be of type Selective.
* Fill (#SAI_COUNTER_ATTR_TYPE with #SAI_COUNTER_TYPE_SELECTIVE).
*
* @type sai_object_list_t
* @flags CREATE_AND_SET
* @objects SAI_OBJECT_TYPE_COUNTER
* @default empty
*/
SAI_BRIDGE_ATTR_SELECTIVE_COUNTER_LIST,

/**
* @brief End of attributes
*/
Expand Down
44 changes: 44 additions & 0 deletions inc/saibuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,28 @@ typedef enum _sai_ingress_priority_group_attr_t
*/
SAI_INGRESS_PRIORITY_GROUP_ATTR_INDEX,

/**
* @brief Set ingress priority group statistics counting mode
*
* @type sai_stats_count_mode_t
* @flags CREATE_AND_SET
* @default SAI_STATS_COUNT_MODE_PACKET_AND_BYTE
*/
SAI_INGRESS_PRIORITY_GROUP_ATTR_STATS_COUNT_MODE,

/**
* @brief Attach counter object list
*
* Counter object should be of type Selective.
* Fill (#SAI_COUNTER_ATTR_TYPE with #SAI_COUNTER_TYPE_SELECTIVE).
*
* @type sai_object_list_t
* @flags CREATE_AND_SET
* @objects SAI_OBJECT_TYPE_COUNTER
* @default empty
*/
SAI_INGRESS_PRIORITY_GROUP_ATTR_SELECTIVE_COUNTER_LIST,

/**
* @brief End of attributes
*/
Expand Down Expand Up @@ -347,6 +369,28 @@ typedef enum _sai_buffer_pool_attr_t
*/
SAI_BUFFER_POOL_ATTR_WRED_PROFILE_ID,

/**
* @brief Set buffer pool statistics counting mode
*
* @type sai_stats_count_mode_t
* @flags CREATE_AND_SET
* @default SAI_STATS_COUNT_MODE_PACKET_AND_BYTE
*/
SAI_BUFFER_POOL_ATTR_STATS_COUNT_MODE,

/**
* @brief Attach counter object list
*
* Counter object should be of type Selective.
* Fill (#SAI_COUNTER_ATTR_TYPE with #SAI_COUNTER_TYPE_SELECTIVE).
*
* @type sai_object_list_t
* @flags CREATE_AND_SET
* @objects SAI_OBJECT_TYPE_COUNTER
* @default empty
*/
SAI_BUFFER_POOL_ATTR_SELECTIVE_COUNTER_LIST,

/**
* @brief End of attributes
*/
Expand Down
42 changes: 42 additions & 0 deletions inc/saicounter.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ typedef enum _sai_counter_type_t
/** Regular */
SAI_COUNTER_TYPE_REGULAR,

/** Selective Counter */
SAI_COUNTER_TYPE_SELECTIVE,

} sai_counter_type_t;

/**
Expand Down Expand Up @@ -78,6 +81,45 @@ typedef enum _sai_counter_attr_t
*/
SAI_COUNTER_ATTR_LABEL,

/**
* @brief Enable/disable packet count
*
* @type bool
* @flags CREATE_ONLY
* @default true
*/
SAI_COUNTER_ATTR_ENABLE_PACKET_COUNT,

/**
* @brief Enable/disable byte count
*
* @type bool
* @flags CREATE_ONLY
* @default true
*/
SAI_COUNTER_ATTR_ENABLE_BYTE_COUNT,

/**
* @brief Object Type of the stat-id
*
* @type sai_object_type_t
* @flags MANDATORY_ON_CREATE | CREATE_ONLY
* @condition SAI_COUNTER_ATTR_TYPE == SAI_COUNTER_TYPE_SELECTIVE
*/
SAI_COUNTER_ATTR_OBJECT_TYPE,

/**
* @brief Stat id list
*
* List of statistics enum mapped to this counter
*
* @type sai_s32_list_t
kcudnik marked this conversation as resolved.
Show resolved Hide resolved
* @flags CREATE_AND_SET
* @default empty
* @validonly SAI_COUNTER_ATTR_TYPE == SAI_COUNTER_TYPE_SELECTIVE
*/
SAI_COUNTER_ATTR_STAT_ID_LIST,

/**
* @brief End of attributes
*/
Expand Down
22 changes: 22 additions & 0 deletions inc/saiicmpecho.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,28 @@ typedef enum _sai_icmp_echo_session_attr_t
*/
SAI_ICMP_ECHO_SESSION_ATTR_STATE,

/**
* @brief Set ICMP echo session statistics counting mode
*
* @type sai_stats_count_mode_t
* @flags CREATE_AND_SET
* @default SAI_STATS_COUNT_MODE_PACKET_AND_BYTE
*/
SAI_ICMP_ECHO_SESSION_ATTR_STATS_COUNT_MODE,

/**
* @brief Attach counter object list
*
* Counter object should be of type Selective.
* Fill (#SAI_COUNTER_ATTR_TYPE with #SAI_COUNTER_TYPE_SELECTIVE).
*
* @type sai_object_list_t
* @flags CREATE_AND_SET
* @objects SAI_OBJECT_TYPE_COUNTER
* @default empty
*/
SAI_ICMP_ECHO_SESSION_ATTR_SELECTIVE_COUNTER_LIST,

/**
* @brief End of attributes
*/
Expand Down
44 changes: 44 additions & 0 deletions inc/saiipsec.h
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,28 @@ typedef enum _sai_ipsec_port_attr_t
*/
SAI_IPSEC_PORT_ATTR_SWITCH_SWITCHING_MODE,

/**
* @brief Set IPSEC port statistics counting mode
*
* @type sai_stats_count_mode_t
* @flags CREATE_AND_SET
* @default SAI_STATS_COUNT_MODE_PACKET_AND_BYTE
*/
SAI_IPSEC_PORT_ATTR_STATS_COUNT_MODE,

/**
* @brief Attach counter object list
*
* Counter object should be of type Selective.
* Fill (#SAI_COUNTER_ATTR_TYPE with #SAI_COUNTER_TYPE_SELECTIVE).
*
* @type sai_object_list_t
* @flags CREATE_AND_SET
* @objects SAI_OBJECT_TYPE_COUNTER
* @default empty
*/
SAI_IPSEC_PORT_ATTR_SELECTIVE_COUNTER_LIST,

/**
* @brief End of IPsec Port attributes
*/
Expand Down Expand Up @@ -631,6 +653,28 @@ typedef enum _sai_ipsec_sa_attr_t
*/
SAI_IPSEC_SA_ATTR_MINIMUM_INGRESS_ESN,

/**
* @brief Set IPSEC SA statistics counting mode
*
* @type sai_stats_count_mode_t
* @flags CREATE_AND_SET
* @default SAI_STATS_COUNT_MODE_PACKET_AND_BYTE
*/
SAI_IPSEC_SA_ATTR_STATS_COUNT_MODE,

/**
* @brief Attach counter object list
*
* Counter object should be of type Selective.
* Fill (#SAI_COUNTER_ATTR_TYPE with #SAI_COUNTER_TYPE_SELECTIVE).
*
* @type sai_object_list_t
* @flags CREATE_AND_SET
* @objects SAI_OBJECT_TYPE_COUNTER
* @default empty
*/
SAI_IPSEC_SA_ATTR_SELECTIVE_COUNTER_LIST,

/**
* @brief End of IPsec Security Association attributes
*/
Expand Down
44 changes: 44 additions & 0 deletions inc/saimacsec.h
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,28 @@ typedef enum _sai_macsec_port_attr_t
*/
SAI_MACSEC_PORT_ATTR_SWITCH_SWITCHING_MODE,

/**
* @brief Set MACSEC port statistics counting mode
*
* @type sai_stats_count_mode_t
* @flags CREATE_AND_SET
* @default SAI_STATS_COUNT_MODE_PACKET_AND_BYTE
*/
SAI_MACSEC_PORT_ATTR_STATS_COUNT_MODE,

/**
* @brief Attach counter object list
*
* Counter object should be of type Selective.
* Fill (#SAI_COUNTER_ATTR_TYPE with #SAI_COUNTER_TYPE_SELECTIVE).
*
* @type sai_object_list_t
* @flags CREATE_AND_SET
* @objects SAI_OBJECT_TYPE_COUNTER
* @default empty
*/
SAI_MACSEC_PORT_ATTR_SELECTIVE_COUNTER_LIST,

/**
* @brief End of MACsec Port attributes
*/
Expand Down Expand Up @@ -458,6 +480,28 @@ typedef enum _sai_macsec_flow_attr_t
*/
SAI_MACSEC_FLOW_ATTR_SC_LIST,

/**
* @brief Set MACSEC flow statistics counting mode
*
* @type sai_stats_count_mode_t
* @flags CREATE_AND_SET
* @default SAI_STATS_COUNT_MODE_PACKET_AND_BYTE
*/
SAI_MACSEC_FLOW_ATTR_STATS_COUNT_MODE,

/**
* @brief Attach counter object list
*
* Counter object should be of type Selective.
* Fill (#SAI_COUNTER_ATTR_TYPE with #SAI_COUNTER_TYPE_SELECTIVE).
*
* @type sai_object_list_t
* @flags CREATE_AND_SET
* @objects SAI_OBJECT_TYPE_COUNTER
* @default empty
*/
SAI_MACSEC_FLOW_ATTR_SELECTIVE_COUNTER_LIST,

/**
* @brief End of MACsec Flow attributes
*/
Expand Down
22 changes: 22 additions & 0 deletions inc/saipolicer.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,28 @@ typedef enum _sai_policer_attr_t
*/
SAI_POLICER_ATTR_OBJECT_STAGE = 0x0000000b,

/**
* @brief Set policer statistics counting mode
*
* @type sai_stats_count_mode_t
* @flags CREATE_AND_SET
* @default SAI_STATS_COUNT_MODE_PACKET_AND_BYTE
*/
SAI_POLICER_ATTR_STATS_COUNT_MODE,

/**
* @brief Attach counter object list
*
* Counter object should be of type Selective.
* Fill (#SAI_COUNTER_ATTR_TYPE with #SAI_COUNTER_TYPE_SELECTIVE).
*
* @type sai_object_list_t
* @flags CREATE_AND_SET
* @objects SAI_OBJECT_TYPE_COUNTER
* @default empty
*/
SAI_POLICER_ATTR_SELECTIVE_COUNTER_LIST,

/**
* @brief End of attributes
*/
Expand Down
Loading
Loading