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

Statistics support for Tx and Rx counters of different frame sizes #1536

Merged
merged 1 commit into from
Dec 13, 2020

Conversation

AkhileshSamineni
Copy link
Contributor

Added Statistics support for Tx and Rx counters of different frames sizes.

Depends on sonic-net/sonic-utilities#1299

Added below stats
SAI_PORT_STAT_ETHER_IN_PKTS_64_OCTETS
SAI_PORT_STAT_ETHER_IN_PKTS_65_TO_127_OCTETS
SAI_PORT_STAT_ETHER_IN_PKTS_256_TO_511_OCTETS
SAI_PORT_STAT_ETHER_IN_PKTS_512_TO_1023_OCTETS
SAI_PORT_STAT_ETHER_IN_PKTS_1024_TO_1518_OCTETS
SAI_PORT_STAT_ETHER_IN_PKTS_1519_TO_2047_OCTETS
SAI_PORT_STAT_ETHER_IN_PKTS_2048_TO_4095_OCTETS
SAI_PORT_STAT_ETHER_IN_PKTS_4096_TO_9216_OCTETS
SAI_PORT_STAT_ETHER_IN_PKTS_9217_TO_16383_OCTETS
SAI_PORT_STAT_ETHER_OUT_PKTS_64_OCTETS
SAI_PORT_STAT_ETHER_OUT_PKTS_65_TO_127_OCTETS
SAI_PORT_STAT_ETHER_OUT_PKTS_128_TO_255_OCTETS
SAI_PORT_STAT_ETHER_OUT_PKTS_256_TO_511_OCTETS
SAI_PORT_STAT_ETHER_OUT_PKTS_512_TO_1023_OCTETS
SAI_PORT_STAT_ETHER_OUT_PKTS_1024_TO_1518_OCTETS
SAI_PORT_STAT_ETHER_OUT_PKTS_1519_TO_2047_OCTETS
SAI_PORT_STAT_ETHER_OUT_PKTS_2048_TO_4095_OCTETS
SAI_PORT_STAT_ETHER_OUT_PKTS_4096_TO_9216_OCTETS
SAI_PORT_STAT_ETHER_OUT_PKTS_9217_TO_16383_OCTETS
SAI_PORT_STAT_ETHER_STATS_JABBERS
SAI_PORT_STAT_ETHER_STATS_FRAGMENTS
SAI_PORT_STAT_ETHER_STATS_UNDERSIZE_PKTS
SAI_PORT_STAT_IP_IN_RECEIVES

Signed-off-by: Akhilesh Samineni akhilesh.samineni@broadcom.com

Signed-off-by: Akhilesh Samineni <akhilesh.samineni@broadcom.com>
@AkhileshSamineni
Copy link
Contributor Author

Retest this please.

1 similar comment
@AkhileshSamineni
Copy link
Contributor Author

Retest this please.

@lguohan lguohan merged commit e0859f7 into sonic-net:master Dec 13, 2020
lguohan pushed a commit to sonic-net/sonic-utilities that referenced this pull request Dec 13, 2020
The current ‘show interfaces counters’ command does not show any information regarding the BCAST/MCAST counters per interface. Also, no data regarding the different packet sizes Rx/Tx counts.

Depends on sonic-net/sonic-swss#1536

Added a detailed option for 'show interface counters' to display all these information.
This is a per interface command like show below

root@sonic:/home/admin# show interfaces counters detailed -h
Usage: show interfaces counters detailed [OPTIONS] <interface_name>

Show interface counters detailed

Options:
-p, --period TEXT Display statistics over a specified period (in seconds)
--verbose Enable verbose output
-?, -h, --help Show this message and exit.
root@sonic:/home/admin#

Sample Output:
root@sonic:/home/admin# show interfaces counters detailed Ethernet11
Packets Received 64 Octets..................... 77
Packets Received 65-127 Octets................. 6
Packets Received 128-255 Octets................ 0
Packets Received 256-511 Octets................ 3
Packets Received 512-1023 Octets............... 0
Packets Received 1024-1518 Octets.............. 0
Packets Received 1519-2047 Octets.............. 0
Packets Received 2048-4095 Octets.............. 0
Packets Received 4096-9216 Octets.............. 0
Packets Received 9217-16383 Octets............. 0

Total Packets Received Without Errors.......... 86
Unicast Packets Received....................... 79
Multicast Packets Received..................... 6
Broadcast Packets Received..................... 1

Jabbers Received............................... 0
Fragments Received............................. 0
Undersize Received............................. 0
Overruns Received.............................. 0

Packets Transmitted 64 Octets.................. 77
Packets Transmitted 65-127 Octets.............. 0
Packets Transmitted 128-255 Octets............. 0
Packets Transmitted 256-511 Octets............. 3,677
Packets Transmitted 512-1023 Octets............ 0
Packets Transmitted 1024-1518 Octets........... 0
Packets Transmitted 1519-2047 Octets........... 0
Packets Transmitted 2048-4095 Octets........... 0
Packets Transmitted 4096-9216 Octets........... 0
Packets Transmitted 9217-16383 Octets.......... 0

Total Packets Transmitted Successfully......... 3,754
Unicast Packets Transmitted.................... 80
Multicast Packets Transmitted.................. 3,674
Broadcast Packets Transmitted.................. 0
Time Since Counters Last Cleared............... None
root@sonic:/home/admin#


Signed-off-by: Akhilesh Samineni <akhilesh.samineni@broadcom.com>
arlakshm pushed a commit to arlakshm/sonic-swss that referenced this pull request Dec 15, 2020
…onic-net#1536)

Added Statistics support for Tx and Rx counters of different frames sizes.

Depends on sonic-net/sonic-utilities#1299

Added below stats
SAI_PORT_STAT_ETHER_IN_PKTS_64_OCTETS
SAI_PORT_STAT_ETHER_IN_PKTS_65_TO_127_OCTETS
SAI_PORT_STAT_ETHER_IN_PKTS_256_TO_511_OCTETS
SAI_PORT_STAT_ETHER_IN_PKTS_512_TO_1023_OCTETS
SAI_PORT_STAT_ETHER_IN_PKTS_1024_TO_1518_OCTETS
SAI_PORT_STAT_ETHER_IN_PKTS_1519_TO_2047_OCTETS
SAI_PORT_STAT_ETHER_IN_PKTS_2048_TO_4095_OCTETS
SAI_PORT_STAT_ETHER_IN_PKTS_4096_TO_9216_OCTETS
SAI_PORT_STAT_ETHER_IN_PKTS_9217_TO_16383_OCTETS
SAI_PORT_STAT_ETHER_OUT_PKTS_64_OCTETS
SAI_PORT_STAT_ETHER_OUT_PKTS_65_TO_127_OCTETS
SAI_PORT_STAT_ETHER_OUT_PKTS_128_TO_255_OCTETS
SAI_PORT_STAT_ETHER_OUT_PKTS_256_TO_511_OCTETS
SAI_PORT_STAT_ETHER_OUT_PKTS_512_TO_1023_OCTETS
SAI_PORT_STAT_ETHER_OUT_PKTS_1024_TO_1518_OCTETS
SAI_PORT_STAT_ETHER_OUT_PKTS_1519_TO_2047_OCTETS
SAI_PORT_STAT_ETHER_OUT_PKTS_2048_TO_4095_OCTETS
SAI_PORT_STAT_ETHER_OUT_PKTS_4096_TO_9216_OCTETS
SAI_PORT_STAT_ETHER_OUT_PKTS_9217_TO_16383_OCTETS
SAI_PORT_STAT_ETHER_STATS_JABBERS
SAI_PORT_STAT_ETHER_STATS_FRAGMENTS
SAI_PORT_STAT_ETHER_STATS_UNDERSIZE_PKTS
SAI_PORT_STAT_IP_IN_RECEIVES

Signed-off-by: Akhilesh Samineni <akhilesh.samineni@broadcom.com>
Signed-off-by: Arvindsrinivasan Lakshmi Narasimhan <arlakshm@microsoft.com>
anand-kumar-subramanian pushed a commit to anand-kumar-subramanian/sonic-utilities that referenced this pull request Mar 2, 2021
…net#1299)

The current ‘show interfaces counters’ command does not show any information regarding the BCAST/MCAST counters per interface. Also, no data regarding the different packet sizes Rx/Tx counts.

Depends on sonic-net/sonic-swss#1536

Added a detailed option for 'show interface counters' to display all these information.
This is a per interface command like show below

root@sonic:/home/admin# show interfaces counters detailed -h
Usage: show interfaces counters detailed [OPTIONS] <interface_name>

Show interface counters detailed

Options:
-p, --period TEXT Display statistics over a specified period (in seconds)
--verbose Enable verbose output
-?, -h, --help Show this message and exit.
root@sonic:/home/admin#

Sample Output:
root@sonic:/home/admin# show interfaces counters detailed Ethernet11
Packets Received 64 Octets..................... 77
Packets Received 65-127 Octets................. 6
Packets Received 128-255 Octets................ 0
Packets Received 256-511 Octets................ 3
Packets Received 512-1023 Octets............... 0
Packets Received 1024-1518 Octets.............. 0
Packets Received 1519-2047 Octets.............. 0
Packets Received 2048-4095 Octets.............. 0
Packets Received 4096-9216 Octets.............. 0
Packets Received 9217-16383 Octets............. 0

Total Packets Received Without Errors.......... 86
Unicast Packets Received....................... 79
Multicast Packets Received..................... 6
Broadcast Packets Received..................... 1

Jabbers Received............................... 0
Fragments Received............................. 0
Undersize Received............................. 0
Overruns Received.............................. 0

Packets Transmitted 64 Octets.................. 77
Packets Transmitted 65-127 Octets.............. 0
Packets Transmitted 128-255 Octets............. 0
Packets Transmitted 256-511 Octets............. 3,677
Packets Transmitted 512-1023 Octets............ 0
Packets Transmitted 1024-1518 Octets........... 0
Packets Transmitted 1519-2047 Octets........... 0
Packets Transmitted 2048-4095 Octets........... 0
Packets Transmitted 4096-9216 Octets........... 0
Packets Transmitted 9217-16383 Octets.......... 0

Total Packets Transmitted Successfully......... 3,754
Unicast Packets Transmitted.................... 80
Multicast Packets Transmitted.................. 3,674
Broadcast Packets Transmitted.................. 0
Time Since Counters Last Cleared............... None
root@sonic:/home/admin#


Signed-off-by: Akhilesh Samineni <akhilesh.samineni@broadcom.com>
EdenGri pushed a commit to EdenGri/sonic-swss that referenced this pull request Feb 28, 2022
…mmands (sonic-net#1536)

#### What I did
Adding apply-patch, rollback, replace, checkpoint, delete-checkpoint, list-checkpoints functionality.

#### How I did it
This PR is implementing the first step in in README.md in the design document: sonic-net/SONiC#736  

#### How to verify it
Using unit-tests

#### 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)

```sh
admin@sonic:~$ sudo config apply-patch --help
Usage: config apply-patch [OPTIONS] PATCH_FILE_PATH

  Apply given patch of updates to Config. A patch is a JsonPatch which
  follows rfc6902. This command can be used do partial updates to the config
  with minimum disruption to running processes. It allows addition as well
  as deletion of configs. The patch file represents a diff of ConfigDb(ABNF)
  format or SonicYang format.

  <patch-file-path>: Path to the patch file on the file-system.

Options:
  -f, --format [CONFIGDB|SONICYANG]
                                  format of config of the patch is either
                                  ConfigDb(ABNF) or SonicYang
  -d, --dry-run                   test out the command without affecting
                                  config state
  -v, --verbose                   print additional details of what the
                                  operation is doing
  -h, -?, --help                  Show this message and exit.



admin@sonic:~$ sudo config replace --help
Usage: config replace [OPTIONS] TARGET_FILE_PATH

  Replace the whole config with the specified config. The config is replaced
  with minimum disruption e.g. if ACL config is different between current
  and target config only ACL config is updated, and other config/services
  such as DHCP will not be affected. **WARNING** The target config file
  should be the whole config, not just the part intended to be updated.

  <target-file-path>: Path to the target file on the file-system.

Options:
  -f, --format [CONFIGDB|SONICYANG]
                                  format of target config is either
                                  ConfigDb(ABNF) or SonicYang
  -d, --dry-run                   test out the command without affecting
                                  config state
  -v, --verbose                   print additional details of what the
                                  operation is doing
  -h, -?, --help                  Show this message and exit.



admin@sonic:~$ sudo config rollback --help
Usage: config rollback [OPTIONS] CHECKPOINT_NAME

  Rollback the whole config to the specified checkpoint. The config is
  rolled back with minimum disruption e.g. if ACL config is different
  between current and checkpoint config only ACL config is updated, and
  other config/services such as DHCP will not be affected.

  <checkpoint-name>: The checkpoint name, use `config list-checkpoints`
  command to see available checkpoints.

Options:
  -d, --dry-run   test out the command without affecting config state
  -v, --verbose   print additional details of what the operation is doing
  -?, -h, --help  Show this message and exit.



admin@sonic:~$ sudo config checkpoint --help
Usage: config checkpoint [OPTIONS] CHECKPOINT_NAME

  Take a checkpoint of the whole current config with the specified
  checkpoint name.

  <checkpoint-name>: The checkpoint name, use `config list-checkpoints`
  command to see available checkpoints.

Options:
  -v, --verbose   print additional details of what the operation is doing
  -h, -?, --help  Show this message and exit.



admin@sonic:~$ sudo config delete-checkpoint --help
Usage: config delete-checkpoint [OPTIONS] CHECKPOINT_NAME

  Delete a checkpoint with the specified checkpoint name.

  <checkpoint-name>: The checkpoint name, use `config list-checkpoints`
  command to see available checkpoints.

Options:
  -v, --verbose   print additional details of what the operation is doing
  -h, -?, --help  Show this message and exit.



admin@sonic:~$ sudo config list-checkpoints --help
Usage: config list-checkpoints [OPTIONS]

  List the config checkpoints available.

Options:
  -v, --verbose   print additional details of what the operation is doing
  -?, -h, --help  Show this message and exit.
```
malletvapid23 added a commit to malletvapid23/Sonic-Utility that referenced this pull request Aug 3, 2023
The current ‘show interfaces counters’ command does not show any information regarding the BCAST/MCAST counters per interface. Also, no data regarding the different packet sizes Rx/Tx counts.

Depends on sonic-net/sonic-swss#1536

Added a detailed option for 'show interface counters' to display all these information.
This is a per interface command like show below

root@sonic:/home/admin# show interfaces counters detailed -h
Usage: show interfaces counters detailed [OPTIONS] <interface_name>

Show interface counters detailed

Options:
-p, --period TEXT Display statistics over a specified period (in seconds)
--verbose Enable verbose output
-?, -h, --help Show this message and exit.
root@sonic:/home/admin#

Sample Output:
root@sonic:/home/admin# show interfaces counters detailed Ethernet11
Packets Received 64 Octets..................... 77
Packets Received 65-127 Octets................. 6
Packets Received 128-255 Octets................ 0
Packets Received 256-511 Octets................ 3
Packets Received 512-1023 Octets............... 0
Packets Received 1024-1518 Octets.............. 0
Packets Received 1519-2047 Octets.............. 0
Packets Received 2048-4095 Octets.............. 0
Packets Received 4096-9216 Octets.............. 0
Packets Received 9217-16383 Octets............. 0

Total Packets Received Without Errors.......... 86
Unicast Packets Received....................... 79
Multicast Packets Received..................... 6
Broadcast Packets Received..................... 1

Jabbers Received............................... 0
Fragments Received............................. 0
Undersize Received............................. 0
Overruns Received.............................. 0

Packets Transmitted 64 Octets.................. 77
Packets Transmitted 65-127 Octets.............. 0
Packets Transmitted 128-255 Octets............. 0
Packets Transmitted 256-511 Octets............. 3,677
Packets Transmitted 512-1023 Octets............ 0
Packets Transmitted 1024-1518 Octets........... 0
Packets Transmitted 1519-2047 Octets........... 0
Packets Transmitted 2048-4095 Octets........... 0
Packets Transmitted 4096-9216 Octets........... 0
Packets Transmitted 9217-16383 Octets.......... 0

Total Packets Transmitted Successfully......... 3,754
Unicast Packets Transmitted.................... 80
Multicast Packets Transmitted.................. 3,674
Broadcast Packets Transmitted.................. 0
Time Since Counters Last Cleared............... None
root@sonic:/home/admin#


Signed-off-by: Akhilesh Samineni <akhilesh.samineni@broadcom.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants