-
Notifications
You must be signed in to change notification settings - Fork 661
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
[show priority-group drop counters] Remove backup with cached PG drop counters after 'config reload' #1679
[show priority-group drop counters] Remove backup with cached PG drop counters after 'config reload' #1679
Conversation
… counters after 'config reload' Signed-off-by: Andriy Yurkiv <ayurkiv@nvidia.com>
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
@ayurkiv-nvda please add unit test to catch the issue which will work now with the fix. if i am not mistaken config reload cannot be used in the unittest infra so please consider simulation the behaviour without a config reload. |
Will review once there is a testcase for this |
@neethajohn there is no infra for unit test for config reload. this was also discussed on other PRs related to changes in config reload. Do you have other suggestion? |
@ayurkiv-nvda, can you explore if you could use something similar to this |
Signed-off-by: Andriy Yurkiv <ayurkiv@nvidia.com>
Done |
Done |
… counters after 'config reload' (#1679) - What I did Explanation how show/clear counters works: Suppose we got from SDK some count of dropped packets for priority group (№3) per interface (Ehernet4). (for example Ethernet4 PG-3 123 packets) Stats can be shown via show priority-group drop counters Then we run sonic-clear priority-group drop counters. This command will save data "Ethernet4 PG-3 123 packets" to backup. It saved in /tmp/dropstat-{user_id} folder When we run show priority-group drop counters again, script will take data from SDK and data saved from backup. In backup it will find 123. In SDK it may still be number 123 for Ethernet4 (like in backup) or bigger (for example 126.) Our sonic-clear priority-group drop counters command does not change anything in SDK. It just show difference beetwen SDK data and last saved data. So if in SDK data is 123, show priority-group drop counters will show 0 (123 minus 123) - data is cleared If in SDK data is bigger than saved 124, or higher show priority-group drop counters will show 1 (124 minus 123) FIX After config reload all counters drop counters data retrieved from SDK become cleared. All counters become zeros. In this case show priority-group drop counters will show -123 ( 0 (from SDK) minus 123 (saved backup)) So we don't need backup after config reload - How I did it remove /tmp/dropstat-{user_id} folders with counters backup Signed-off-by: Andriy Yurkiv <ayurkiv@nvidia.com>
Updates: 888701b [Mellanox] Remove mstdump from Mellanoxs collect dump script ([sonic-net/sonic-utilities#1706]) 4818360 [sonic-package-manager] support warm/fast reboot for extension packages ([sonic-net/sonic-utilities#1554]) 793b847 [show priority-group drop counters] Remove backup with cached PG drop counters after 'config reload' ([sonic-net/sonic-utilities#1679]) 24fe1ac [show][config] support for interface alias for muxcable commands ([sonic-net/sonic-utilities#1699])
Updates: 888701b [Mellanox] Remove mstdump from Mellanoxs collect dump script ([sonic-net/sonic-utilities#1706]) 4818360 [sonic-package-manager] support warm/fast reboot for extension packages ([sonic-net/sonic-utilities#1554]) 793b847 [show priority-group drop counters] Remove backup with cached PG drop counters after 'config reload' ([sonic-net/sonic-utilities#1679]) 24fe1ac [show][config] support for interface alias for muxcable commands ([sonic-net/sonic-utilities#1699])
Update: > 2ca493b 2021-07-13 create sniffer folder if not exist (sonic-net/sonic-utilities#1659) > 1695104 2021-07-07 [show priority-group drop counters] Remove backup with cached PG drop counters after 'config reload' (sonic-net/sonic-utilities#1679) > e99a3c5 2021-07-07 [show][config] support for interface alias for muxcable commands (sonic-net/sonic-utilities#1699)
Updates: 888701b [Mellanox] Remove mstdump from Mellanoxs collect dump script ([sonic-net/sonic-utilities#1706]) 4818360 [sonic-package-manager] support warm/fast reboot for extension packages ([sonic-net/sonic-utilities#1554]) 793b847 [show priority-group drop counters] Remove backup with cached PG drop counters after 'config reload' ([sonic-net/sonic-utilities#1679]) 24fe1ac [show][config] support for interface alias for muxcable commands ([sonic-net/sonic-utilities#1699])
… counters after 'config reload' (sonic-net#1679) - What I did Explanation how show/clear counters works: Suppose we got from SDK some count of dropped packets for priority group (№3) per interface (Ehernet4). (for example Ethernet4 PG-3 123 packets) Stats can be shown via show priority-group drop counters Then we run sonic-clear priority-group drop counters. This command will save data "Ethernet4 PG-3 123 packets" to backup. It saved in /tmp/dropstat-{user_id} folder When we run show priority-group drop counters again, script will take data from SDK and data saved from backup. In backup it will find 123. In SDK it may still be number 123 for Ethernet4 (like in backup) or bigger (for example 126.) Our sonic-clear priority-group drop counters command does not change anything in SDK. It just show difference beetwen SDK data and last saved data. So if in SDK data is 123, show priority-group drop counters will show 0 (123 minus 123) - data is cleared If in SDK data is bigger than saved 124, or higher show priority-group drop counters will show 1 (124 minus 123) FIX After config reload all counters drop counters data retrieved from SDK become cleared. All counters become zeros. In this case show priority-group drop counters will show -123 ( 0 (from SDK) minus 123 (saved backup)) So we don't need backup after config reload - How I did it remove /tmp/dropstat-{user_id} folders with counters backup Signed-off-by: Andriy Yurkiv <ayurkiv@nvidia.com>
Signed-off-by: Andriy Yurkiv ayurkiv@nvidia.com
What I did
Explanation how show/clear counters works:
Then we run sonic-clear priority-group drop counters. This command will save data "Ethernet4 PG-3 123 packets" to backup. It saved in /tmp/dropstat-{user_id} folder
Our sonic-clear priority-group drop counters command does not change anything in SDK. It just show difference beetwen SDK data and last saved data.
So if in SDK data is 123, show priority-group drop counters will show 0 (123 minus 123) - data is cleared
If in SDK data is bigger than saved 124, or higher show priority-group drop counters will show 1 (124 minus 123)
FIX
After config reload all counters drop counters data retrieved from SDK become cleared. All counters become zeros.
In this case show priority-group drop counters will show -123 ( 0 (from SDK) minus 123 (saved backup))
So we don't need backup after config reload
How I did it
remove
/tmp/dropstat-{user_id}
folders with counters backupHow to verify it
show priority-group drop counters
sudo config reload -y
show priority-group drop counters
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)