Skip to content

allow per-interface filtering for "show interfaces counters errors"#4502

Open
donggyu-nexthop wants to merge 2 commits into
sonic-net:masterfrom
nexthop-ai:allow-per-interface-filtering-show
Open

allow per-interface filtering for "show interfaces counters errors"#4502
donggyu-nexthop wants to merge 2 commits into
sonic-net:masterfrom
nexthop-ai:allow-per-interface-filtering-show

Conversation

@donggyu-nexthop
Copy link
Copy Markdown

What I did

fixes #4501

Added per-interface filtering for the show interface counters suite of commands (for ones that didn't already have this feature)

How I did it

in interfaces/__init__.py, I updated counters sub-commands that didn't support per-interface filtering to take in an optional INTERFACE positional argument.

I added per-interface filtering support for the following commands:

  • show interfaces counters errors
  • show interfaces counters fec-stats
  • show interfaces counters rates
  • show interfaces counters was also updated to use a positional argument instead of the -i flag

This filtering functionality already existed for the other sub-commands. After discussions it was decided that it'd be best to keep the CLI consistent (with other CLI commands that provide per-interface filtering) by providing filtering capabilities via positional arguments rather than a flag.

How to verify it

on a DUT:

# display single-row table for Ethernet0
show interfaces counters Ethernet0

# display single-row errors table for Ethernet0
show interfaces counters errors Ethernet0

# display single-row table with tx/rx rates
show interfaces counters rates Ethernet0 

# display single-row table for FEC data
show interfaces counters fec-stats Ethernet0

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

Running show interfaces counters Ethernet0 would spit out a message saying something along the lines of "Ethernet0 is not a valid command".

Running show interfaces counters errors Ethernet0 would ignore the interface argument, and print out the counters table for all admin-up interfaces

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

$ show interfaces counters Ethernet0
    IFACE    STATE    RX_OK    RX_BPS    RX_UTIL    RX_ERR    RX_DRP    RX_OVR    TX_OK    TX_BPS    TX_UTIL    TX_ERR    TX_DRP    TX_OVR
---------  -------  -------  --------  ---------  --------  --------  --------  -------  --------  ---------  --------  --------  --------
Ethernet0        X        0  0.00 B/s      0.00%         0         0         0        0  0.00 B/s      0.00%         0         0         0

$ show interfaces counters errors Ethernet0
    IFACE    STATE    RX_ERR    RX_DRP    RX_OVR    TX_ERR    TX_DRP    TX_OVR
---------  -------  --------  --------  --------  --------  --------  --------
Ethernet0        X         0         0         0         0         0         0

$ show interfaces counters fec-stats Ethernet0
    IFACE    STATE    FEC_CORR    FEC_UNCORR    FEC_SYMBOL_ERR    FEC_PRE_BER    FEC_POST_BER    FEC_PRE_BER_MAX    FLR(O)    FLR(P) (Accuracy)    FEC_MAX_T
---------  -------  ----------  ------------  ----------------  -------------  --------------  -----------------  --------  -------------------  -----------
Ethernet0        X         N/A           N/A               N/A            N/A             N/A                N/A       N/A                  N/A          N/A

$ show interfaces counters rates Ethernet0
    IFACE    STATE    RX_OK    RX_BPS    RX_PPS    RX_UTIL    TX_OK    TX_BPS    TX_PPS    TX_UTIL
---------  -------  -------  --------  --------  ---------  -------  --------  --------  ---------
Ethernet0        X        0  0.00 B/s    0.00/s      0.00%        0  0.00 B/s    0.00/s      0.00%

Signed-off-by: donggyu-nexthop <donggyu@nexthop.ai>
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Signed-off-by: Donggyu Kim <donggyu@nexthop.ai>
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

provide support for per-interface filtering in show interfaces counters commands

2 participants