Skip to content

sonic-utilities: WRED stats feature changes on sonic-utilities #2807

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

Merged

Conversation

rpmarvell
Copy link
Contributor

What I did

CLI support for WRED and ECN statistics feature

How I did it

  • New script for wredstat CLI commands
  • portstat script updated to accomodate WRED port stats
  • counterpoll script updated to support wredport and wredqueue counters
  • CLi to script mapping changes
  • UT for the new script changes

How to verify it

sonic-utilities UT and Marvell DUT manual testing

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

root@sonic-dut:~# show interfaces counters detailed Ethernet8
Packets Received 64 Octets..................... 0
Packets Received 65-127 Octets................. 2
Packets Received 128-255 Octets................ 0
Packets Received 256-511 Octets................ 0
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.......... 2
Unicast Packets Received....................... 0
Multicast Packets Received..................... 2
Broadcast Packets Received..................... 0

Jabbers Received............................... N/A
Fragments Received............................. N/A
Undersize Received............................. 0
Overruns Received.............................. 0

Packets Transmitted 64 Octets.................. 32,893
Packets Transmitted 65-127 Octets.............. 16,449
Packets Transmitted 128-255 Octets............. 3
Packets Transmitted 256-511 Octets............. 2,387
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......... 51,732
Unicast Packets Transmitted.................... 0
Multicast Packets Transmitted.................. 18,840
Broadcast Packets Transmitted.................. 32,892
Time Since Counters Last Cleared............... None

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

root@sonic-dut:~# show interfaces counters detailed Ethernet8
Packets Received 64 Octets..................... 0
Packets Received 65-127 Octets................. 2
Packets Received 128-255 Octets................ 0
Packets Received 256-511 Octets................ 0
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.......... 2
Unicast Packets Received....................... 0
Multicast Packets Received..................... 2
Broadcast Packets Received..................... 0

Jabbers Received............................... N/A
Fragments Received............................. N/A
Undersize Received............................. 0
Overruns Received.............................. 0

Packets Transmitted 64 Octets.................. 32,893
Packets Transmitted 65-127 Octets.............. 16,449
Packets Transmitted 128-255 Octets............. 3
Packets Transmitted 256-511 Octets............. 2,387
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......... 51,732
Unicast Packets Transmitted.................... 0
Multicast Packets Transmitted.................. 18,840
Broadcast Packets Transmitted.................. 32,892
Time Since Counters Last Cleared............... None

WRED Green Dropped Packets..................... 1
WRED Yellow Dropped Packets.................... 3
WRED RED Dropped Packets....................... 10
WRED Total Dropped Packets..................... 14

@rpmarvell rpmarvell force-pushed the rpmarvell_wred_stats_sonic_utilities branch 2 times, most recently from 6084f23 to 88db720 Compare May 18, 2023 20:31
@rpmarvell rpmarvell requested a review from msosyak May 18, 2023 21:04
@rpmarvell rpmarvell force-pushed the rpmarvell_wred_stats_sonic_utilities branch 2 times, most recently from 4725812 to 2a2bd9f Compare May 29, 2023 13:15
@rpmarvell rpmarvell requested a review from stephenxs May 29, 2023 13:20
Copy link
Collaborator

@stephenxs stephenxs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two minor comments.
The rest LGTM.

@rpmarvell rpmarvell force-pushed the rpmarvell_wred_stats_sonic_utilities branch from 2a2bd9f to 29a097c Compare May 30, 2023 07:01
@rpmarvell rpmarvell force-pushed the rpmarvell_wred_stats_sonic_utilities branch from 29a097c to 989748b Compare June 15, 2023 09:54
@maipbui
Copy link
Contributor

maipbui commented Jun 29, 2023

@rpmarvell Please merge latest master code to trigger Semgrep.

@rpmarvell rpmarvell force-pushed the rpmarvell_wred_stats_sonic_utilities branch from 4247129 to eb034f9 Compare December 5, 2023 12:26
@rpmarvell rpmarvell force-pushed the rpmarvell_wred_stats_sonic_utilities branch from eb034f9 to 17d9c65 Compare January 31, 2024 12:42
@rpmarvell rpmarvell force-pushed the rpmarvell_wred_stats_sonic_utilities branch 4 times, most recently from 0fad42d to 9d38aa0 Compare February 14, 2024 09:06
@rpmarvell rpmarvell force-pushed the rpmarvell_wred_stats_sonic_utilities branch 2 times, most recently from cd9018d to 45f3465 Compare February 15, 2024 06:03
45: ['SAI_PORT_STAT_GREEN_WRED_DROPPED_PACKETS'],
46: ['SAI_PORT_STAT_YELLOW_WRED_DROPPED_PACKETS'],
47: ['SAI_PORT_STAT_RED_WRED_DROPPED_PACKETS'],
48: ['SAI_PORT_STAT_WRED_DROPPED_PACKETS']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about SAI_PORT_STAT_ECN_MARKED_PACKETS?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SAI_PORT_STAT_ECN_MARKED_PACKETS is not part of the HLD.

@@ -91,7 +100,11 @@
41: ['SAI_PORT_STAT_IP_IN_RECEIVES'],
42: ['SAI_PORT_STAT_IF_IN_FEC_CORRECTABLE_FRAMES'],
43: ['SAI_PORT_STAT_IF_IN_FEC_NOT_CORRECTABLE_FRAMES'],
44: ['SAI_PORT_STAT_IF_IN_FEC_SYMBOL_ERRORS']
44: ['SAI_PORT_STAT_IF_IN_FEC_SYMBOL_ERRORS'],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If WRED profile action is 'ecn_marking', does this port counter(SAI_PORT_STAT_GREEN_WRED_DROPPED_PACKETS) show ECN marked packets or this is used only for WRED drop?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ECN marked statistics will not be counted in SAI_PORT_STAT_GREEN_WRED_DROPPED_PACKETS. Per Queue ECN statistics is supported thru this Feature.

@kperumalbfn
Copy link
Contributor

@rpmarvell Could you resolve the conflicts

@vmittal-msft vmittal-msft self-requested a review January 16, 2025 00:55
* New script for wredstat CLI commands
* portstat script updated to accomodate WRED port stats
* counterpoll script updated to support wredport and wredqueue counters
* CLi to script mapping changes
* UT for the new script changes
* CLI command reference document updated

Signed-off-by: rpmarvell <[email protected]>
@rpmarvell rpmarvell force-pushed the rpmarvell_wred_stats_sonic_utilities branch from c37e76a to 226a8eb Compare January 17, 2025 11:15
@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@rpmarvell
Copy link
Contributor Author

Resolved the conflicts.

@kperumalbfn
Copy link
Contributor

Thanks @rpmarvell . Any build or test breakage of this sonic-utilities PR without swss and sairedis changes? If not, we can merge this and have other PRs later.please confirm

@rpmarvell
Copy link
Contributor Author

There should not be any SONiC build issue or UT issue if we merge it without the other branches.

@vmittal-msft
Copy link
Contributor

@rpmarvell Please share queue command output as well.

@rpmarvell
Copy link
Contributor Author

sonic-dut:~# show queue wredcounters Ethernet16
      Port    TxQ    WredDrp/pkts    WredDrp/bytes  EcnMarked/pkts EcnMarked/bytes
----------  -----  --------------  ---------------  -------------- ---------------
Ethernet16    UC0               0                0               0               0
Ethernet16    UC1               1              120               0               0
Ethernet16    UC2               0                0               0               0
Ethernet16    UC3               0                0               0               0
Ethernet16    UC4               0                0               0               0
Ethernet16    UC5               0                0               0               0
Ethernet16    UC6               0                0               0               0
Ethernet16    UC7               0                0               0               0

@mssonicbld
Copy link
Collaborator

Cherry-pick PR to msft-202412: Azure/sonic-utilities.msft#128

mssonicbld added a commit to mssonicbld/sonic-swss.msft that referenced this pull request Feb 28, 2025
* New flex counter group for per-Queue WRED and ECN statistics
* New flex counter group for per-Port WRED and ECN statistics

  Signed-off-by: [email protected]

<!--
Please make sure you have read and understood the contribution guildlines:
https://github.com/Azure/SONiC/blob/gh-pages/CONTRIBUTING.md

1. Make sure your commit includes a signature generted with `git commit -s`
2. Make sure your commit title follows the correct format: [component]: description
3. Make sure your commit message contains enough details about the change and related tests
4. Make sure your pull request adds related reviewers, asignees, labels

Please also provide the following information in this pull request:
-->

**What I did**
WRED and ECN statistics support

**Why I did it**
Implemented as per the HLD : https://github.com/sonic-net/SONiC/blob/master/doc/qos/ECN_and_WRED_statistics_HLD.md

**How I verified it**
Verfied it using Marvell DUT and SWSS unit tests.

**Details if related**
- Two new flex counters added for per-Queue and per-Port WRED ECN statistics.

Build dependency on sonic-swss-common pull request : sonic-net/sonic-swss-common#777

Expected order of dependent pull-request to be committed :
1) sonic-swss common pull request : sonic-net/sonic-swss-common#777
2) sonic-yang-model pull requests : sonic-net/sonic-buildimage#14758
3) sonic-sairedis pull request : sonic-net/sonic-sairedis#1234
4) sonic-swss : pull request : sonic-net/sonic-swss#2750
5) sonic-utilities pull request : sonic-net/sonic-utilities#2807
mssonicbld added a commit to Azure/sonic-swss.msft that referenced this pull request Feb 28, 2025
* New flex counter group for per-Queue WRED and ECN statistics
* New flex counter group for per-Port WRED and ECN statistics

 Signed-off-by: [email protected]

<!--
Please make sure you have read and understood the contribution guildlines:
https://github.com/Azure/SONiC/blob/gh-pages/CONTRIBUTING.md

1. Make sure your commit includes a signature generted with `git commit -s`
2. Make sure your commit title follows the correct format: [component]: description
3. Make sure your commit message contains enough details about the change and related tests
4. Make sure your pull request adds related reviewers, asignees, labels

Please also provide the following information in this pull request:
-->

**What I did**
WRED and ECN statistics support

**Why I did it**
Implemented as per the HLD : https://github.com/sonic-net/SONiC/blob/master/doc/qos/ECN_and_WRED_statistics_HLD.md

**How I verified it**
Verfied it using Marvell DUT and SWSS unit tests.

**Details if related**
- Two new flex counters added for per-Queue and per-Port WRED ECN statistics.

Build dependency on sonic-swss-common pull request : sonic-net/sonic-swss-common#777

Expected order of dependent pull-request to be committed :
1) sonic-swss common pull request : sonic-net/sonic-swss-common#777
2) sonic-yang-model pull requests : sonic-net/sonic-buildimage#14758
3) sonic-sairedis pull request : sonic-net/sonic-sairedis#1234
4) sonic-swss : pull request : sonic-net/sonic-swss#2750
5) sonic-utilities pull request : sonic-net/sonic-utilities#2807
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.

9 participants