Skip to content

Commit

Permalink
Add occupancy and watermark counters in cells
Browse files Browse the repository at this point in the history
Add occcupancy and watermark counters for
priority group and queue objects in shared buffer cells
to report them as they are in counted in the ASIC.
Also add a companion read-only attribute to
get the cell size of a shared buffer in a switch.

Signed-off-by: Marian Pritsak <[email protected]>
  • Loading branch information
marian-pritsak committed Oct 8, 2024
1 parent 41089b0 commit b49742c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
6 changes: 6 additions & 0 deletions inc/saibuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,12 @@ typedef enum _sai_ingress_priority_group_stat_t
/** Get dropped packets count [uint64_t] */
SAI_INGRESS_PRIORITY_GROUP_STAT_DROPPED_PACKETS = 0x00000008,

/** Get current pg occupancy in cells [uint64_t] */
SAI_INGRESS_PRIORITY_GROUP_STAT_CURR_OCCUPANCY_CELLS = 0x00000009,

/** Get watermark pg occupancy in cells [uint64_t] */
SAI_INGRESS_PRIORITY_GROUP_STAT_WATERMARK_CELLS = 0x0000000a,

/** Custom range base value */
SAI_INGRESS_PRIORITY_GROUP_STAT_CUSTOM_RANGE_BASE = 0x10000000

Expand Down
6 changes: 6 additions & 0 deletions inc/saiqueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,12 @@ typedef enum _sai_queue_stat_t
/** Queue delay watermark in nanoseconds [uint64_t] */
SAI_QUEUE_STAT_DELAY_WATERMARK_NS = 0x00000027,

/** Get current queue occupancy in cells [uint64_t] */
SAI_QUEUE_STAT_CURR_OCCUPANCY_CELLS = 0x00000028,

/** Get watermark queue occupancy in cells [uint64_t] */
SAI_QUEUE_STAT_WATERMARK_CELLS = 0x00000029,

/** Custom range base value */
SAI_QUEUE_STAT_CUSTOM_RANGE_BASE = 0x10000000

Expand Down
12 changes: 12 additions & 0 deletions inc/saiswitch.h
Original file line number Diff line number Diff line change
Expand Up @@ -3070,6 +3070,18 @@ typedef enum _sai_switch_attr_t
*/
SAI_SWITCH_ATTR_SELECTIVE_COUNTER_LIST,

/**
* @brief Size of a shared buffer cell
*
* Some counters related to shared buffer may be
* reported in cells instead of bytes for an
* improved performance.
*
* @type sai_uint32_t
* @flags READ_ONLY
*/
SAI_SWITCH_ATTR_SHARED_BUFFER_CELL_SIZE,

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

0 comments on commit b49742c

Please sign in to comment.