Skip to content

Add bmv2 libsai switch & port attributes - #281

Merged
chrispsommers merged 9 commits into
sonic-net:mainfrom
chrispsommers:issue-235-switch-attributes
Nov 22, 2022
Merged

chrispsommers merged 9 commits into
sonic-net:mainfrom
chrispsommers:issue-235-switch-attributes

Conversation

@chrispsommers

@chrispsommers chrispsommers commented Nov 10, 2022 •

Copy link
Copy Markdown
Collaborator

Fixes #235. Added fake switch & port attributes to bmv2 libsai in order to satisfy PyTest and PTF base classes.

  • Split off part of utils.cpp.j2 into saifixedapis.cpp.j2 for maintainability.
  • Minor refactoring of code-generator & Makefile
  • Use SaiHelperSimplified as PTF base class to replace workaround use of ThriftInterfaceDataPlane base class.

…to satisfy initialization requirements for PTF and Pytest frameworks. Modified PTF tests to use correct base class which exploits these attributes. Removed one "chmod" command in Makefile which caused repeated "make all" to fail (discovered while implementing this fix).
@chrispsommers

Copy link
Copy Markdown
Collaborator Author

@aputriax please review as well.

@chrispsommers
chrispsommers marked this pull request as ready for review November 10, 2022 23:30
Comment thread dash-pipeline/tests/saithrift/ptf/thrift/test_thrift_session.py Outdated
Comment thread dash-pipeline/tests/saithrift/pytest/switch/test_saithrift_switch.py Outdated
Comment thread dash-pipeline/tests/saithrift/pytest/switch/test_saithrift_switch.py Outdated
@aputriax aputriax mentioned this pull request Nov 14, 2022

@vmytnykx vmytnykx left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@chrispsommers thanks for making those changes. In general it looks good with minor comments.

Comment thread dash-pipeline/SAI/templates/utils.cpp.j2 Outdated
Comment thread dash-pipeline/SAI/templates/utils.cpp.j2 Outdated
Comment thread dash-pipeline/SAI/templates/utils.cpp.j2 Outdated
… remove warnings due to type conversions, print our OIDs in Pytest for easier interpretation.
@chrispsommers

Copy link
Copy Markdown
Collaborator Author

Hi @marian-pritsak could you please take a quick look at this? It's needed to unblock some other work, thanks!

@lguohan

lguohan commented Nov 16, 2022

Copy link
Copy Markdown
Contributor

@marian-pritsak , can you review this?

Comment thread dash-pipeline/SAI/templates/utils.cpp.j2 Outdated
Comment thread dash-pipeline/SAI/templates/utils.cpp.j2 Outdated
Comment thread dash-pipeline/SAI/templates/utils.cpp.j2 Outdated
…view feedback. Minor refactoring of templates and code-generator to promote maintainability.

@marian-pritsak marian-pritsak left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good.

@chrispsommers
chrispsommers merged commit 4a8368a into sonic-net:main Nov 22, 2022
chrispsommers added a commit that referenced this pull request Nov 22, 2022
* Refactor saichallenger-client to use a [puboished] base image for faster builds. Publish base image only. Build both of these images in bmv2-CI.

* Fix dockerfile tags.

* Build base image before building final image. Fix some comments.

* Replace use of chrissommers dockerhub registry with sonicdash.azurecr.io (some missed items in PR225). (#274)

Co-authored-by: Chris Sommers <chrispsommers@gmail.com>

* Change ACL list match to prefix list for IPs (#269)

The SAI API change opencomputeproject/SAI#1630

Signed-off-by: Marian Pritsak <marianp@mellanox.com>

* Add bmv2 libsai switch & port attributes (#281)

* Fix issue 235 - added more switch and port attributes to bmv2 libsai to satisfy initialization requirements for PTF and Pytest frameworks. Modified PTF tests to use correct base class which exploits these attributes. Removed one "chmod" command in Makefile which caused repeated "make all" to fail (discovered while implementing this fix).

* Restore chmod in makefile from prev. commit, CI breaks.

* Add pytest mark "switch" and add tests for switch and port attributes.

* Fixed spelling of setUp/tearDown. Removed redundant case.

* Changed assertions on switch attributes to check for "not None" instead of explicit values, which will allow for different results on various targets.

* Restored test assertions to !=0

* Changes per review feedback - make dummy object_id creation explicit, remove warnings due to type conversions, print our OIDs in Pytest for easier interpretation.

* Split DASH libsai fixed APIs from utils.cpp into separate file per review feedback. Minor refactoring of templates and code-generator to promote maintainability.

Co-authored-by: Chris Sommers <chrispsommers@gmail.com>

* Merge from main

* Fix DASH ACL implementation and add testcases (#265)

* Fixbug: SAI Server crash on DASH ACL API

1. Fix duplicate SAI ID
2. Wrong search action
3. Double delete entry if SAI write error
4. Wrong format of error message

Signed-off-by: Ze Gan <ganze718@gmail.com>

Signed-off-by: Marian Pritsak <marianp@mellanox.com>
Signed-off-by: Ze Gan <ganze718@gmail.com>
Co-authored-by: Chris Sommers <chrispsommers@gmail.com>
Co-authored-by: Marian Pritsak <marianp@mellanox.com>
Co-authored-by: Ze Gan <ganze718@gmail.com>
@chrispsommers
chrispsommers deleted the issue-235-switch-attributes branch December 7, 2022 22:19
vijasrin pushed a commit to vijasrin/DASH that referenced this pull request Dec 8, 2022
* Fix issue 235 - added more switch and port attributes to bmv2 libsai to satisfy initialization requirements for PTF and Pytest frameworks. Modified PTF tests to use correct base class which exploits these attributes. Removed one "chmod" command in Makefile which caused repeated "make all" to fail (discovered while implementing this fix).

* Restore chmod in makefile from prev. commit, CI breaks.

* Add pytest mark "switch" and add tests for switch and port attributes.

* Fixed spelling of setUp/tearDown. Removed redundant case.

* Changed assertions on switch attributes to check for "not None" instead of explicit values, which will allow for different results on various targets.

* Restored test assertions to !=0

* Changes per review feedback - make dummy object_id creation explicit, remove warnings due to type conversions, print our OIDs in Pytest for easier interpretation.

* Split DASH libsai fixed APIs from utils.cpp into separate file per review feedback. Minor refactoring of templates and code-generator to promote maintainability.

Co-authored-by: Chris Sommers <chrispsommers@gmail.com>
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.

sai_get_switch-attribute() returns 0 when requesting number_of_active_ports

5 participants