From d012be9e2d1696898a1c0eb4be0db40b63fb3ccd Mon Sep 17 00:00:00 2001 From: Junchao-Mellanox <57339448+Junchao-Mellanox@users.noreply.github.com> Date: Mon, 25 Apr 2022 18:26:31 +0800 Subject: [PATCH] [Command-Reference] Add CLI docs for route flow counter (#2069) - What I did Add CLIs document for route flow counter feature, CLI PR: #2031 - How I did it Add CLIs document for route flow counter feature - How to verify it Run build --- doc/Command-Reference.md | 112 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 111 insertions(+), 1 deletion(-) diff --git a/doc/Command-Reference.md b/doc/Command-Reference.md index dc750d2bbc..748a273d85 100644 --- a/doc/Command-Reference.md +++ b/doc/Command-Reference.md @@ -57,6 +57,7 @@ * [Flow Counters](#flow-counters) * [Flow Counters show commands](#flow-counters-show-commands) * [Flow Counters clear commands](#flow-counters-clear-commands) + * [Flow Counters config commands](#flow-counters-config-commands) * [Gearbox](#gearbox) * [Gearbox show commands](#gearbox-show-commands) * [Interfaces](#interfaces) @@ -3137,9 +3138,10 @@ Go Back To [Beginning of the document](#) or [Beginning of this section](#featur ## 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: +This section explains all the Flow Counters show commands, clear commands and config 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) + - Routes matching the configured prefix pattern (number of hits and number of bytes) ### Flow Counters show commands @@ -3169,6 +3171,50 @@ Because clear (see below) is handled on a per-user basis different users may see asic1 dhcp 200 3,000 45.25/s ``` +**show flowcnt-route stats** + +This command is used to show the current statistics for route flow patterns. + +Because clear (see below) is handled on a per-user basis different users may see different counts. + +- Usage: + ``` + show flowcnt-route stats + show flowcnt-route stats pattern [--vrf ] + show flowcnt-route stats route [--vrf ] + ``` + +- Example: + ``` + admin@sonic:~$ show flowcnt-route stats + Route pattern VRF Matched routes Packets Bytes + -------------------------------------------------------------------------------------- + 3.3.0.0/16 default 3.3.1.0/24 100 4543 + 3.3.2.3/32 3443 929229 + 3.3.0.0/16 0 0 + 2000::/64 default 2000::1/128 100 4543 + ``` + +The "pattern" subcommand is used to display the route flow counter statistics by route pattern. + +- Example: + ``` + admin@sonic:~$ show flowcnt-route stats pattern 3.3.0.0/16 + Route pattern VRF Matched routes Packets Bytes + -------------------------------------------------------------------------------------- + 3.3.0.0/16 default 3.3.1.0/24 100 4543 + 3.3.2.3/32 3443 929229 + 3.3.0.0/16 0 0 + ``` + +The "route" subcommand is used to display the route flow counter statistics by route prefix. + ``` + admin@sonic:~$ show flowcnt-route stats route 3.3.3.2/32 --vrf Vrf_1 + Route VRF Route Pattern Packets Bytes + ----------------------------------------------------------------------------------------- + 3.3.3.2/32 Vrf_1 3.3.0.0/16 100 4543 + ``` + ### Flow Counters clear commands **sonic-clear flowcnt-trap** @@ -3186,6 +3232,70 @@ This command is used to clear the current statistics for the registered host int Trap Flow Counters were successfully cleared ``` +**sonic-clear flowcnt-route** + +This command is used to clear the current statistics for the route flow counter. This is done on a per-user basis. + +- Usage: + ``` + sonic-clear flowcnt-route + sonic-clear flowcnt-route pattern [--vrf ] + sonic-clear flowcnt-route route [--vrf ] + ``` + +- Example: + ``` + admin@sonic:~$ sonic-clear flowcnt-route + Route Flow Counters were successfully cleared + ``` + +The "pattern" subcommand is used to clear the route flow counter statistics by route pattern. + +- Example: + ``` + admin@sonic:~$ sonic-clear flowcnt-route pattern 3.3.0.0/16 --vrf Vrf_1 + Flow Counters of all routes matching the configured route pattern were successfully cleared + ``` + +The "route" subcommand is used to clear the route flow counter statistics by route prefix. + +- Example: + ``` + admin@sonic:~$ sonic-clear flowcnt-route route 3.3.3.2/32 --vrf Vrf_1 + Flow Counters of the specified route were successfully cleared + ``` + +### Flow Counters config commands + +**config flowcnt-route pattern add** + +This command is used to add or update the route pattern which is used by route flow counter to match route entries. + +- Usage: + ``` + config flowcnt-route pattern add [--vrf ] [--max ] + ``` + +- Example: + ``` + admin@sonic:~$ config flowcnt-route pattern add 2.2.0.0/16 --vrf Vrf_1 --max 50 + ``` + +**config flowcnt-route pattern remove** + +This command is used to remove the route pattern which is used by route flow counter to match route entries. + +- Usage: + ``` + config flowcnt-route pattern remove [--vrf ] + ``` + +- Example: + ``` + admin@sonic:~$ config flowcnt-route pattern remove 2.2.0.0/16 --vrf Vrf_1 + ``` + + Go Back To [Beginning of the document](#) or [Beginning of this section](#flow-counters) ## Gearbox