Skip to content

Conversation

@prgeor
Copy link
Contributor

@prgeor prgeor commented Dec 6, 2025

What I did

Added the missing columns for "show interface counters fec-stats"

PS. This issue is NOT seen on master/202511 due to difference in code for portstat.py

How I did it

Unlike cnstat_print, cnstat_diff_print was missing all the fec-stats columns

How to verify it

Previous command output (if the output of a command-line utility has changed)

root@str-sonic:~# portstat -f 
Last cached time was 2025-12-06T00:29:18.073371
      IFACE    STATE    FEC_CORR    FEC_UNCORR    FEC_SYMBOL_ERR
-----------  -------  ----------  ------------  ----------------
  Ethernet0        X           0             0                 0
  Ethernet1        X           0             0                 0
  Ethernet2        X           0             0                 0

New command output (if the output of a command-line utility has changed)

root@str-sonic:~# portstat -f
Last cached time was 2025-12-06T00:29:18.073371
      IFACE    STATE    FEC_CORR    FEC_UNCORR    FEC_SYMBOL_ERR    FEC_PRE_BER    FEC_POST_BER    FLR(O)    FLR(P) (Accuracy)
-----------  -------  ----------  ------------  ----------------  -------------  --------------  --------  -------------------
  Ethernet0        X           0             0                 0       0.00e+00        0.00e+00         0                    0
  Ethernet1        X           0             0                 0       0.00e+00        0.00e+00         0                    0
  Ethernet2        X           0             0                 0       0.00e+00        0.00e+00         0                    0
  Ethernet3        X           0             0                 0       0.00e+00        0.00e+00         0                    0
  Ethernet4        X           0             0                 0       0.00e+00        0.00e+00         0                    0

@prgeor prgeor added the Bug label Dec 6, 2025
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@prgeor
Copy link
Contributor Author

prgeor commented Dec 8, 2025

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@kewei-arista
Copy link

Thanks for fixing this Prince, LGTM! Can you please fix this error?

tests/portstat_test.py:84:121: E501 line too long (143 > 120 characters)

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes missing FEC statistics columns in the portstat -f command when using the period flag (-p). The issue was that the cnstat_diff_print method (used for periodic stats) was only displaying the first 3 FEC counter columns (FEC_CORR, FEC_UNCORR, FEC_SYMBOL_ERR), while the cnstat_print method already included all 8 columns including rate-based metrics.

Key changes:

  • Added 5 missing FEC stats columns to cnstat_diff_print: FEC_PRE_BER, FEC_POST_BER, FEC_PRE_BER_MAX, FLR(O), and FLR(P) (Accuracy)
  • Updated test expectations to match the complete output format

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
utilities_common/portstat.py Added missing FEC rate statistics columns (FEC_PRE_BER, FEC_POST_BER, FEC_PRE_BER_MAX, FLR(O), FLR(P)) to both branches of the fec_stats_only conditional in cnstat_diff_print method, matching the format already present in cnstat_print
tests/portstat_test.py Updated expected test output for intf_fec_counters_period to include all FEC statistics columns, and removed extra blank lines for cleaner formatting

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@prgeor prgeor merged commit cfb5121 into sonic-net:202505 Dec 9, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants