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

[drop counters] Fix configuration for counters with lowercase names #1103

Merged
merged 1 commit into from
Sep 10, 2020

Conversation

daall
Copy link
Contributor

@daall daall commented Sep 9, 2020

Signed-off-by: Danny Allen daall@microsoft.com

- What I did
I fixed in a bug in the drop counters CLI where counters that weren't provided in uppercase were not being installed properly into Config DB.

Fixes sonic-net/sonic-buildimage#5303

- How I did it
I figured out that swssdk normalizes all table names to uppercase. Since I was providing the drop counter name as part of the table name instead of part of the key, the drop counter name was being set to all uppercase. This is problematic because the counter was being installed into config DB in whatever case the user provided since for that table it is treated as a key.

So, I updated the parts of the code that touch the DROP_REASONS table to include the counter name as part of the key rather than as part of the table name.

- How to verify it
I've updated the unit tests to include a lowercase_counter to check for this behavior. I also validated that all four config functions work properly on a physical DUT.

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

Signed-off-by: Danny Allen <daall@microsoft.com>
@prsunny
Copy link
Contributor

prsunny commented Sep 9, 2020

retest this please

@daall
Copy link
Contributor Author

daall commented Sep 9, 2020

retest this please

1 similar comment
@daall
Copy link
Contributor Author

daall commented Sep 9, 2020

retest this please

@daall daall merged commit 144bccb into sonic-net:master Sep 10, 2020
@daall daall deleted the drop_counter_case_fix branch September 10, 2020 16:15
abdosi pushed a commit that referenced this pull request Sep 19, 2020
stepanblyschak pushed a commit to stepanblyschak/sonic-utilities that referenced this pull request Apr 28, 2022
Revert "Revert " [201911]show interface counters for multi ASIC devices
(sonic-net#1104)""
 Revert "Revert "Pfcstat (sonic-net#1097)""
  [show] Fix 'show int neighbor expected' (sonic-net#1106)
   Update argument for docker exec it->i (sonic-net#1118)
     Update to make config load/reload backward compatible. (sonic-net#1115)
     Handling deletion of Port Channel before deletion of its members
     (sonic-net#1062)
    Skip default route present in ASIC-DB but not in APP-DB. (sonic-net#1107)
     [CLI][PFCWD][Multi-ASIC] Added multi ASIC support to 'pfcwd' CLI
     (sonic-net#1102)
       [201911]  Multi asic platform config interface portchannel, show
       transceiver  (sonic-net#1087)
       [drop counters] Fix configuration for counters with lowercase
       names (sonic-net#1103)

Signed-off-by: Abhishek Dosi <abdosi@microsoft.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.

Switch level drop counters not working
4 participants