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

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rpmarvell
Copy link

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

scripts/wredstat Outdated Show resolved Hide resolved
@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
doc/Command-Reference.md Show resolved Hide resolved
scripts/wredstat Outdated Show resolved Hide resolved
scripts/portstat Outdated Show resolved Hide resolved
scripts/portstat Outdated Show resolved Hide resolved
scripts/wredstat Outdated Show resolved Hide resolved
@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.

scripts/portstat Outdated Show resolved Hide resolved
doc/Command-Reference.md Outdated Show resolved Hide resolved
@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
@rpmarvell rpmarvell force-pushed the rpmarvell_wred_stats_sonic_utilities branch 2 times, most recently from 57ee521 to 740d940 Compare February 15, 2024 10:48
@rpmarvell
Copy link
Author

@maipbui > Please merge latest master code to trigger Semgrep.

I have rebased the code changes with recent master..!

@zhangyanzhao
Copy link
Collaborator

@qiluo-msft can you please help to check and merge this PR? Thanks.

kperumalbfn
kperumalbfn previously approved these changes Sep 25, 2024
@kperumalbfn
Copy link
Contributor

@rpmarvell Could you resolve the conflicts.

@rpmarvell rpmarvell force-pushed the rpmarvell_wred_stats_sonic_utilities branch from 740d940 to 077272f Compare November 6, 2024 18:20
@rpmarvell
Copy link
Author

@rpmarvell Could you resolve the conflicts.

I have rebased and resolved the conflcts

@rpmarvell rpmarvell force-pushed the rpmarvell_wred_stats_sonic_utilities branch 9 times, most recently from 5f31583 to b207d75 Compare November 7, 2024 10:15
* 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 <rperumal@marvell.com>
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
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
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
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.

6 participants