Skip to content

Commit

Permalink
Enable fabric counter for syncd's FlexCounter (sonic-net#669)
Browse files Browse the repository at this point in the history
New SAI version provides more counters for fabric ports. Extend the supported counter list to cover those counters.

    /** SAI port stat if in FEC correctable pkts */
    SAI_PORT_STAT_IF_IN_FEC_CORRECTABLE_FRAMES,

    /** SAI port stat if in FEC not correctable pkts */
    SAI_PORT_STAT_IF_IN_FEC_NOT_CORRECTABLE_FRAMES,

    /** SAI port stat if in FEC symbol errors */
    SAI_PORT_STAT_IF_IN_FEC_SYMBOL_ERRORS,

    /** Fabric port stat in data units */
    SAI_PORT_STAT_IF_IN_FABRIC_DATA_UNITS,

    /** Fabric port stat out data units */
    SAI_PORT_STAT_IF_OUT_FABRIC_DATA_UNITS,

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

Signed-off-by: ngocdo <ngocdo@arista.com>
  • Loading branch information
ngoc-do authored Oct 12, 2020
1 parent 573d5c1 commit 0f3668f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion syncd/FlexCounter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1651,7 +1651,7 @@ void FlexCounter::updateSupportedPortCounters(

uint64_t value;

for (int id = SAI_PORT_STAT_IF_IN_OCTETS; id <= SAI_PORT_STAT_PFC_7_ON2OFF_RX_PKTS; ++id)
for (int id = SAI_PORT_STAT_IF_IN_OCTETS; id <= SAI_PORT_STAT_IF_OUT_FABRIC_DATA_UNITS; ++id)
{
sai_port_stat_t counter = static_cast<sai_port_stat_t>(id);

Expand Down

0 comments on commit 0f3668f

Please sign in to comment.