Fix SAI object create error in libsai adapter#167
Fix SAI object create error in libsai adapter#167marian-pritsak merged 1 commit intosonic-net:mainfrom
Conversation
ee45e9d to
2a2bb70
Compare
|
Hi @mukeshmv I think it'd be good to add tests in vnet_out.cpp to DELETE objects as well. I did this in the course of pending #164 and discovered an error in the libsai adaptor for DELETE: #158 Please see my submitted changes in #164 for dash-pipeline/SAI/templates/saiapi.cpp.j2, dash-pipeline/SAI/templates/utils.cpp.j2 and dash-pipeline/tests/libsai/vnet_out/vnet_out.cpp and consider applying the template fix and adding similar delete operations in reverse order. It might expose some hidden issue of the changes you're proposing (I suppose it'd be nicer if I'd already submitted these fixes in a separate PR but I was working on saithrift at the time.) |
2a2bb70 to
7418895
Compare
Thanks for the suggestion @chrispsommers. I tried reverse object deletes including the ENI object with your SAI template "==" fix and it went through fine. So this change does not introduce any new issues for Delete operation. I will add this ENI object to the delete test after your fix gets merged. |
|
7743574 to
0b8d079
Compare
|
@chrispsommers I have added the ENI object create and delete to the ptf and pytest as well. Pls check. |
|
Test job fail is due to conflict with recent ACL group PR merge. Will fix the tests. |
0b8d079 to
1940efc
Compare
|
@chrispsommers I am keeping my sai thrift test changes commented out for now. They were working initially, but I am noticing that after rebasing to the tip where new P4 tables and parameters have been added to the dash pipeline the sai thrift test is not configuring the P4 correctly. Can you update the containers and let me know I can try again ? |
|
Hi @mukeshmv, two questions:
The pre-built containers don't include build artifacts, they are "builders" and contain only tools. The artifacts are modified in your host filesystem using volume mounts. See volume-mounts. The only exception is the saithrift client which contains python saithrift wrappers based on the P4 code -> sai header generation. That container is always rebuilt in-place, not downloaded. |
@chrispsommers thanks for the clarification regarding the docker containers. Strangely no error is thrown. But I dont see any output in the thrift server or the libsai / P4 simple_switch for this And then the assert fails because no acl_group_id is returned from the create. Whereas I checked that the below call that I added is indeed hitting the thrift server, and is failing in the libasi with the error that required parameters are missing (this is known and it needs the above object id created from the dash acl group create) All of this passes in the vnet_out test but hits the same issue in both the ptf and pytest thrift tests. The only difference is that the eni is an existing P4 table / SAI API whereas the dash ACL group is a new one. I do see thrift code for the dash ACL group is getting generated. But I am not an expert so maybe there is something missing. If it's not the thrift client then could the issue be with the server ?
Yes I am executing below steps. Sure, lets have a 1:1. |
1940efc to
7f08f11
Compare
- Populate SAI obj-id as P4 match key - Add SAI thrift tests for ENI object create, delete
7f08f11 to
7be40f6
Compare
|
Turns out that the sai_api_query was not returning the Dash ACL impl table. Adding that fixed the saithrift issue. Thanks @chrispsommers for your help debugging. |
chrispsommers
left a comment
There was a problem hiding this comment.
LGTM, I mainly reviewed the utils.cpp.j2 and test cases, not the API generator. Nicely done.
Populate SAI obj-id as P4 match key.
No change in SAI API headers.
Fixes #166