Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Command-Reference] Add CLI docs for route flow counter #2069

Merged

Conversation

Junchao-Mellanox
Copy link
Collaborator

HLD: sonic-net/SONiC#908

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

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

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

Enable/disable configuration:

counterpoll flowcnt-route  <enable | disable>
Example:
admin@sonic:~$ counterpoll flowcnt-route enable

Polling interval configuration:

counterpoll flowcnt-route interval <time_in_msec> // default - 1000ms
Example:
admin@sonic:~$ counterpoll flowcnt-route interval 2000

Show configuration:

counterpoll show
Example:
admin@sonic:~$ counterpoll show
Type                              Interval (in ms)          Status
--------------------------        ------------------        --------
FLOW_CNT_ROUTE_STAT               default(10000)            disable

Config route pattern:

config flowcnt-route pattern <add | remove> [--vrf <vrf>] [--max <route-max>] <prefix-pattern>    // configure route pattern
Example:
admin@sonic:~$ config flowcnt-route pattern add --vrf Vrf_1 --max 50 2.2.0.0/16
Route Pattern Flow Counter configuration is successful

admin@sonic:~$ config flowcnt-route pattern remove --vrf Vrf_1 2.2.0.0/16
Route Pattern Flow Counter configuration is successful

Show configuration:

show flowcnt-route config
Example:
admin@sonic:~$ show flowcnt-route config
Route pattern          VRF                 Max
-----------------------------------------------
3.3.0.0/16             default             50

Show counters value:

show flowcnt-route stats   // show statistics of all route flow counters
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


show flowcnt-route stats pattern [<prefix-pattern> [ --vrf <vrf>] ]   // show statistics of all routes matching the configured 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

show flowcnt-route stats route [<prefix> [ --vrf <vrf>] ]             // show statistics of the specific route matching the configured route pattern
Example:
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

Clear counters:

sonic-clear flowcnt-route    // clear all route flow counters
Example:
admin@sonic:~$ sonic-clear flowcnt-route
Route Flow Counters were successfully cleared

sonic-clear flowcnt-route pattern  [<prefix-pattern> [ --vrf <vrf>] ]   // clear flow counters of all routes matching the configured 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

sonic-clear flowcnt-route route [<prefix> [ --vrf <vrf>] ]  // clear flow counters of the specific route matching the configured 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

keboliu
keboliu previously approved these changes Feb 16, 2022
@Junchao-Mellanox
Copy link
Collaborator Author

/azpw run Azure.sonic-utilities

@mssonicbld
Copy link
Collaborator

/AzurePipelines run Azure.sonic-utilities

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@Junchao-Mellanox
Copy link
Collaborator Author

/azpw run Azure.sonic-utilities

@mssonicbld
Copy link
Collaborator

/AzurePipelines run Azure.sonic-utilities

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@Junchao-Mellanox
Copy link
Collaborator Author

/azpw run Azure.sonic-utilities

@mssonicbld
Copy link
Collaborator

/AzurePipelines run Azure.sonic-utilities

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@Junchao-Mellanox
Copy link
Collaborator Author

/azpw run Azure.sonic-utilities

@mssonicbld
Copy link
Collaborator

/AzurePipelines run Azure.sonic-utilities

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@Junchao-Mellanox
Copy link
Collaborator Author

/azpw run Azure.sonic-utilities

@mssonicbld
Copy link
Collaborator

/AzurePipelines run Azure.sonic-utilities

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@Junchao-Mellanox
Copy link
Collaborator Author

Did a rebase to include fix #2079 which fixed the unit test failure.

@liat-grozovik
Copy link
Collaborator

@prsunny could you please help to review?

keboliu
keboliu previously approved these changes Apr 12, 2022
liat-grozovik pushed a commit that referenced this pull request Apr 18, 2022
HLD: sonic-net/SONiC#908
Command reference : #2069

- What I did
Add CLIs for route flow counter feature

- How I did it
Add show command show flowcnt-route config and command group show flowcnt-route stats
Add config command group config flowcnt-route pattern
Add clear command group sonic-clear flowcnt-route

- How to verify it
1.  Full unit test cover
2.  Manual test
3. sonic-mgmt test cases
@liat-grozovik liat-grozovik merged commit d012be9 into sonic-net:master Apr 25, 2022
malletvapid23 added a commit to malletvapid23/Sonic-Utility that referenced this pull request Aug 3, 2023
HLD: sonic-net/SONiC#908
Command reference : sonic-net/sonic-utilities#2069

- What I did
Add CLIs for route flow counter feature

- How I did it
Add show command show flowcnt-route config and command group show flowcnt-route stats
Add config command group config flowcnt-route pattern
Add clear command group sonic-clear flowcnt-route

- How to verify it
1.  Full unit test cover
2.  Manual test
3. sonic-mgmt test cases
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.

4 participants