Skip to content

[pfcstat] Create new copies of Rx and Tx dictionaries#1150

Merged
neethajohn merged 3 commits intosonic-net:masterfrom
neethajohn:pfcstat_fix
Oct 7, 2020
Merged

[pfcstat] Create new copies of Rx and Tx dictionaries#1150
neethajohn merged 3 commits intosonic-net:masterfrom
neethajohn:pfcstat_fix

Conversation

@neethajohn
Copy link
Contributor

@neethajohn neethajohn commented Oct 6, 2020

- What I did
Fixes sonic-net/sonic-buildimage#5540

The issue was due to pfcstat rx and tx dict values copied using '=' and hence the Rx counts were always getting overwritten by the Tx counts
Unit tests didn't catch the problem because the Tx and Rx counts were set to the same value.

- How I did it
create new copies of pfcstat Rx and Tx dictionaries
Updated unit tests to use different values for Tx and Rx counts

- How to verify it
Without the change, modified the mock counter values for Rx and Tx to be different. The pfcstat tests were failing.
With the changes, send PFC pause frames from the fanout and from the DUT and ensured that values were getting reflected correctly for Rx and Tx.

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

@smaheshm
Copy link
Contributor

smaheshm commented Oct 7, 2020

Looks good. Thanks for working on the fix!!

Copy link
Contributor

@smaheshm smaheshm left a comment

Choose a reason for hiding this comment

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

:shipit:

@neethajohn neethajohn requested a review from jleveque October 7, 2020 16:21
@neethajohn neethajohn merged commit 737c5ad into sonic-net:master Oct 7, 2020
@neethajohn neethajohn deleted the pfcstat_fix branch October 7, 2020 17:05
abdosi pushed a commit that referenced this pull request Oct 13, 2020
* Fix the issue where Rx counts were overwritten by the Tx counts

Signed-off-by: Neetha John <[email protected]>
stepanblyschak pushed a commit to stepanblyschak/sonic-utilities that referenced this pull request Apr 28, 2022
[pfcstat] Create new copies of Rx and Tx dictionaries (sonic-net#1150)
[config] Reload Monit configuration after potential hostname
changes (sonic-net#1132)

Signed-off-by: Abhishek Dosi <[email protected]>
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.

[PFC] pfcstat utility returns incorrect number of received PFC frames

4 participants