Skip to content

[orchagent] Adds swss support for drop counters#1075

Merged
yxieca merged 30 commits intosonic-net:masterfrom
daall:drop_counters
Nov 19, 2019
Merged

[orchagent] Adds swss support for drop counters#1075
yxieca merged 30 commits intosonic-net:masterfrom
daall:drop_counters

Conversation

@daall
Copy link
Contributor

@daall daall commented Sep 30, 2019

Adds swss support for drop counters

  • Creates a new orchestrator for managing debug counters
  • Adds utility functions for managing debug counters

How I verified it
A set of vswitch tests is included.

=============================================================================================== test session starts ===============================================================================================
platform linux2 -- Python 2.7.15+, pytest-3.3.0, py-1.8.0, pluggy-0.6.0 -- /usr/bin/python2
cachedir: .cache
rootdir: /home/daall/dev/sonic-swss/tests, inifile:
collected 14 items                                                                                                                                                                                                

test_drop_counters.py::TestDropCounters::test_deviceCapabilitiesTablePopulated remove extra link dummy
PASSED                                                                                                                       [  7%]
test_drop_counters.py::TestDropCounters::test_flexCounterGroupInitialized PASSED                                                                                                                            [ 14%]
test_drop_counters.py::TestDropCounters::test_createAndRemoveDropCounterBasic PASSED                                                                                                                        [ 21%]
test_drop_counters.py::TestDropCounters::test_createAndRemoveDropCounterReversed PASSED                                                                                                                     [ 28%]
test_drop_counters.py::TestDropCounters::test_createCounterWithInvalidCounterType PASSED                                                                                                                    [ 35%]
test_drop_counters.py::TestDropCounters::test_createCounterWithInvalidDropReason PASSED                                                                                                                     [ 42%]
test_drop_counters.py::TestDropCounters::test_addReasonToInitializedCounter PASSED                                                                                                                          [ 50%]
test_drop_counters.py::TestDropCounters::test_removeReasonFromInitializedCounter PASSED                                                                                                                     [ 57%]
test_drop_counters.py::TestDropCounters::test_addDropReasonMultipleTimes PASSED                                                                                                                             [ 64%]
test_drop_counters.py::TestDropCounters::test_addInvalidDropReason PASSED                                                                                                                                   [ 71%]
test_drop_counters.py::TestDropCounters::test_removeDropReasonMultipleTimes PASSED                                                                                                                          [ 78%]
test_drop_counters.py::TestDropCounters::test_removeNonexistentDropReason PASSED                                                                                                                            [ 85%]
test_drop_counters.py::TestDropCounters::test_removeInvalidDropReason PASSED                                                                                                                                [ 92%]
test_drop_counters.py::TestDropCounters::test_createAndDeleteMultipleCounters PASSED                                                                                                                        [100%]

=========================================================================================== 14 passed in 113.65 seconds ===========================================================================================

Details if related
Depends on:

Signed-off-by: Danny Allen [email protected]

this->counter_id = debug_counter_id;
}

void DebugCounter::removeDebugCounterFromSAI()

Choose a reason for hiding this comment

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

How do handle warm reboot case?
Can the SWSS reset the counters? or reconcile the debug counters?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll have to verify but yes, the counters should be reconciled upon warm reboot.

@wendani wendani requested a review from qiluo-msft October 28, 2019 23:10
Copy link
Contributor

@qiluo-msft qiluo-msft left a comment

Choose a reason for hiding this comment

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

Please also resolve conflicts and fix vs tests.

daall added 3 commits October 29, 2019 09:17
- Creates a new orchestrator for managing debug counters
- Adds utility functions for managing flex counters
- Adds utility functions for managing debug counters

Signed-off-by: Danny Allen <[email protected]>
@daall daall requested a review from qiluo-msft November 14, 2019 23:31
@yxieca
Copy link
Contributor

yxieca commented Nov 15, 2019

My comments are mostly cosmetic issues. Overall the change looks pretty good.

Thanks for adding these comments in source code to tell tricky choices. These comments helps a lot.

Add some comments to state the purpose of test steps would also help readers.

I found that you used quite a bit 'this->' to specify scope in your code. This is not wrong per-se. Just curious why are you doing compiler's job? :-)

Copy link
Contributor

@qiluo-msft qiluo-msft left a comment

Choose a reason for hiding this comment

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

Looks good to me. Please also check others' comments

@daall
Copy link
Contributor Author

daall commented Nov 19, 2019

retest this please

@yxieca
Copy link
Contributor

yxieca commented Nov 19, 2019

retest this please

@yxieca yxieca merged commit c3b8fe1 into sonic-net:master Nov 19, 2019
@daall daall deleted the drop_counters branch December 18, 2019 01:37
EdenGri pushed a commit to EdenGri/sonic-swss that referenced this pull request Feb 28, 2022
Aligned single back quotes in .md file
oleksandrivantsiv pushed a commit to oleksandrivantsiv/sonic-swss that referenced this pull request Mar 1, 2023
…t#1075)

SAI_OBJECT_TYPE_TUNNEL has fewer attributes in 201811 than in 202012. These new attributes are CREATE only, and can't be added using just SET oper. Hence old object needs to be removed, and new object needs to be added.
Moreover existing sequence (make before break) causes SAI errors in removing VXLAN tunnel (as part of CPA teardown).

Adding SAI_OBJECT_TYPE_TUNNEL to break before make to avoid creating a new object before removing existing ones.
Janetxxx pushed a commit to Janetxxx/sonic-swss that referenced this pull request Nov 10, 2025
* [orchagent] Adds swss support for drop counters
- Creates a new orchestrator for managing debug counters
- Adds utility functions for managing flex counters
- Adds utility functions for managing debug counters

Signed-off-by: Danny Allen <[email protected]>

* Fix build issues

* Fix log levels

* Cast drop reasons before serializing

* Fix testing issues

* Clean up flex counter utilities

* Expose switch ids in redis

* Clean-up comments and namespace usage

* Add basic drop counter vswitch tests

* Add drop reasons

* Fix rebase merge conflicts

* Move flex counter and switch related work to different PRs

* Fix first round of feedback comments

* Fix free counters review comments

* Reorganize helper classes

* Delete extra makefile

* Only put useful capabilities in STATE DB

* Use new flex counter manager naming

* Update mock tests to build with debug counter orch

* Add remaining ingress drop reasons

* Fix reference style issue

* Update tests to match virtual switch implementation

* Respond to C++ style issues

* Improve documentation for vs tests

* Add test case for removing all drop reasons from a counter

* Specify exception type being caught

* Add range check for drop counter indices

* Undo range check
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.

4 participants