From b550c44eafe320b06b3c2b99643de86688b93f08 Mon Sep 17 00:00:00 2001 From: Junchao-Mellanox <57339448+Junchao-Mellanox@users.noreply.github.com> Date: Tue, 30 Nov 2021 02:17:30 +0800 Subject: [PATCH] Add command reference for trap flow counters (#1876) *Update CLI command reference for trap flow counters --- doc/Command-Reference.md | 55 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/doc/Command-Reference.md b/doc/Command-Reference.md index 0567b787bac9..768c51b86467 100644 --- a/doc/Command-Reference.md +++ b/doc/Command-Reference.md @@ -53,6 +53,9 @@ * [Feature](#feature) * [Feature show commands](#feature-show-commands) * [Feature config commands](#feature-config-commands) +* [Flow Counters](#flow-counters) + * [Flow Counters show commands](#flow-counters-show-commands) + * [Flow Counters clear commands](#flow-counters-clear-commands) * [Gearbox](#gearbox) * [Gearbox show commands](#gearbox-show-commands) * [Interfaces](#interfaces) @@ -3066,6 +3069,58 @@ commands are don't care and will not update state/auto-restart value. Go Back To [Beginning of the document](#) or [Beginning of this section](#feature) +## Flow Counters + +This section explains all the Flow Counters show commands and clear commands that are supported in SONiC. Flow counters are usually used for debugging, troubleshooting and performance enhancement processes. Flow counters supports case like: + + - Host interface traps (number of received traps per Trap ID) + +### Flow Counters show commands + +**show flowcnt-trap stats** + +This command is used to show the current statistics for the registered host interface traps. + +Because clear (see below) is handled on a per-user basis different users may see different counts. + +- Usage: + ``` + show flowcnt-trap stats + ``` + +- Example: + ``` + admin@sonic:~$ show flowcnt-trap stats + Trap Name Packets Bytes PPS + --------- --------- ------- ------- + dhcp 100 2,000 50.25/s + + For multi-ASIC: + admin@sonic:~$ show flowcnt-trap stats + ASIC ID Trap Name Packets Bytes PPS + ------- ----------- --------- ------- ------- + asic0 dhcp 100 2,000 50.25/s + asic1 dhcp 200 3,000 45.25/s + ``` + +### Flow Counters clear commands + +**sonic-clear flowcnt-trap** + +This command is used to clear the current statistics for the registered host interface traps. This is done on a per-user basis. + +- Usage: + ``` + sonic-clear flowcnt-trap + ``` + +- Example: + ``` + admin@sonic:~$ sonic-clear flowcnt-trap + Trap Flow Counters were successfully cleared + ``` + +Go Back To [Beginning of the document](#) or [Beginning of this section](#flow-counters) ## Gearbox This section explains all the Gearbox PHY show commands that are supported in SONiC.