Skip to content

Commit

Permalink
Add port FEC histogram counter support.
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Beresford <mberes@google.com>
  • Loading branch information
mikeberesford committed Oct 6, 2022
1 parent 19f10ac commit 6556131
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 0 deletions.
67 changes: 67 additions & 0 deletions inc/saiport.h
Original file line number Diff line number Diff line change
Expand Up @@ -2151,6 +2151,14 @@ typedef enum _sai_port_attr_t
*/
SAI_PORT_ATTR_FABRIC_ISOLATE,

/**
* @brief Query the maximum number of errors the current FEC can detect.
*
* @type sai_uint32_t
* @flags READ_ONLY
*/
SAI_PORT_ATTR_MAX_FEC_ERRORS_DETECTABLE,

/**
* @brief End of attributes
*/
Expand Down Expand Up @@ -2749,6 +2757,65 @@ typedef enum _sai_port_stat_t
/** Fabric port stat out data units */
SAI_PORT_STAT_IF_OUT_FABRIC_DATA_UNITS,

/**
* @brief Port FEC codeword symbol error counters.
*
* This set of counters corresponds to number of errors each FEC codeword
* received on the port.
*
* The number of bins supported is dependent on the type of FEC in use.
* For instance, RS-528 FEC supports detection of up to 7 errors, while
* RS-544 FEC would support detection of up to 15 errors. The maximum number
* of errors that can be detected may be retrieved via the
* SAI_PORT_ATTR_MAX_FEC_ERRORS_DETECTABLE switch attribute.
*/
SAI_PORT_STAT_IF_IN_FEC_CODEWORD_ERRORS_HISTGRAM_S0,

/** Count of FEC codewords with 1 symbol error. */
SAI_PORT_STAT_IF_IN_FEC_CODEWORD_ERRORS_HISTGRAM_S1,

/** Count of FEC codewords with 2 symbol errors. */
SAI_PORT_STAT_IF_IN_FEC_CODEWORD_ERRORS_HISTGRAM_S2,

/** Count of FEC codewords with 3 symbol errors. */
SAI_PORT_STAT_IF_IN_FEC_CODEWORD_ERRORS_HISTGRAM_S3,

/** Count of FEC codewords with 4 symbol errors. */
SAI_PORT_STAT_IF_IN_FEC_CODEWORD_ERRORS_HISTGRAM_S4,

/** Count of FEC codewords with 5 symbol errors. */
SAI_PORT_STAT_IF_IN_FEC_CODEWORD_ERRORS_HISTGRAM_S5,

/** Count of FEC codewords with 6 symbol errors. */
SAI_PORT_STAT_IF_IN_FEC_CODEWORD_ERRORS_HISTGRAM_S6,

/** Count of FEC codewords with 7 symbol errors. */
SAI_PORT_STAT_IF_IN_FEC_CODEWORD_ERRORS_HISTGRAM_S7,

/** Count of FEC codewords with 8 symbol errors. */
SAI_PORT_STAT_IF_IN_FEC_CODEWORD_ERRORS_HISTGRAM_S8,

/** Count of FEC codewords with 9 symbol errors. */
SAI_PORT_STAT_IF_IN_FEC_CODEWORD_ERRORS_HISTGRAM_S9,

/** Count of FEC codewords with 10 symbol errors. */
SAI_PORT_STAT_IF_IN_FEC_CODEWORD_ERRORS_HISTGRAM_S10,

/** Count of FEC codewords with 11 symbol errors. */
SAI_PORT_STAT_IF_IN_FEC_CODEWORD_ERRORS_HISTGRAM_S11,

/** Count of FEC codewords with 12 symbol errors. */
SAI_PORT_STAT_IF_IN_FEC_CODEWORD_ERRORS_HISTGRAM_S12,

/** Count of FEC codewords with 13 symbol errors. */
SAI_PORT_STAT_IF_IN_FEC_CODEWORD_ERRORS_HISTGRAM_S13,

/** Count of FEC codewords with 14 symbol errors. */
SAI_PORT_STAT_IF_IN_FEC_CODEWORD_ERRORS_HISTGRAM_S14,

/** Count of FEC codewords with 15 symbol errors. */
SAI_PORT_STAT_IF_IN_FEC_CODEWORD_ERRORS_HISTGRAM_S15,

/** Port stat in drop reasons range start */
SAI_PORT_STAT_IN_DROP_REASON_RANGE_BASE = 0x00001000,

Expand Down
10 changes: 10 additions & 0 deletions inc/saiswitch.h
Original file line number Diff line number Diff line change
Expand Up @@ -2776,6 +2776,16 @@ typedef enum _sai_switch_attr_t
*/
SAI_SWITCH_ATTR_ECMP_MEMBER_COUNT,

/**
* @brief Switch support for port FEC statistics bins.
*
* Indicates support for SAI_PORT_STAT_IF_IN_FEC_CODEWORD_ERRORS_HISTOGRAM_S* attributes.
*
* @type bool
* @flags READ_ONLY
*/
SAI_SWITCH_ATTR_PORT_FEC_CODEWORD_ERRORS_HISTOGRAM,

/**
* @brief End of attributes
*/
Expand Down
2 changes: 2 additions & 0 deletions meta/aspell.en.pws
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ Callee
chardata
checksum
childs
codeword
codewords
const
couldn
cpp
Expand Down

0 comments on commit 6556131

Please sign in to comment.