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

[bfn][saiserver]support bfn saiserverv1 and saiserverv2 #9684

Closed

Conversation

richardyu-ms
Copy link
Contributor

@richardyu-ms richardyu-ms commented Jan 6, 2022

Why I did it

support bfn saiserverv1 and saiserverv2

How I did it

Support saiserver v2 with python3 and thrift 0.13.0
add variables to support the saiserverv2
build different thrift in saithrift depends on saiserver version
build differernt versions of saiserver
make the saiserver and saiserver docker with version number

How to verify it

build two different versions of sasiserver in local build environment
todo: test on devices

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106

Description for the changelog

A picture of a cute animal (not mandatory but encouraged)

@richardyu-ms richardyu-ms force-pushed the bfn_saiserverv2_support branch from a6eab9c to e2c2230 Compare January 6, 2022 03:48
@richardyu-ms richardyu-ms force-pushed the bfn_saiserverv2_support branch 3 times, most recently from 86fbcb0 to e631fdf Compare January 15, 2022 11:51
@ravi861
Copy link

ravi861 commented Jan 31, 2022

@akokhan @msosyak Please review this.

Copy link
Contributor

@msosyak msosyak left a comment

Choose a reason for hiding this comment

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

I believe we need to merge #9881 and #9884 before this changes to avoid conflicts and runtime issues

platform/barefoot/libsaithrift-dev.mk Outdated Show resolved Hide resolved
@richardyu-ms richardyu-ms force-pushed the bfn_saiserverv2_support branch from 9fc1297 to 9508855 Compare February 24, 2022 05:30
@richardyu-ms
Copy link
Contributor Author

@msosyak could you help make a review about this update? BTW, I found you removed two dependencies $(BFN_INGRASYS_PLATFORM) $(BFN_PLATFORM), in our previous testing(in bf sdk with 0.13 thrift), some error might come out as missing dlopen failed for libdru_sim.so, err=libdru_sim.so: cannot open shared object file ...
UNable to load dru sim library.

After add those library, $(BFN_INGRASYS_PLATFORM) $(BFN_PLATFORM), the saiserver can start.

@msosyak
Copy link
Contributor

msosyak commented Mar 2, 2022

@richardyu-ms

  • The error with libdru_sim is coused due to incorrect initialization of BFN SDK. I will investigate it deeply and come up with hte solution in day or two. But please provid me the steps you used to start dockr-saiserver in SONiC.

Also I found few one more issue while trying to build saiserver.

  • The saiserverv2 is not compatible with thrift 0.14.1 - I could make appropriate changes, but let me know is saithriftv2 should support previous thrift versions (0.11.0).

@msosyak
Copy link
Contributor

msosyak commented Mar 7, 2022

@richardyu-ms Here are the changes needed to fix saiserverv2 startup richardyu-ms#5. Please review and try it.
This PR opencomputeproject/SAI#1433 is also required to build saiververv2

@richardyu-ms richardyu-ms force-pushed the bfn_saiserverv2_support branch from 9508855 to 3af6eb8 Compare March 9, 2022 05:57
Copy link
Contributor

@msosyak msosyak left a comment

Choose a reason for hiding this comment

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

This PR is dependent on opencomputeproject/SAI#1433 which is not yet included in sonic-sairedis and sonic-buildimage. Without this, the build will fail.

I left a few minor comments, but I still, have some concerns regarding work on different devices.
Will check and come back.

@@ -13,18 +13,19 @@ $(LIBSAITHRIFT_DEV)_DEPENDS += $(LIBTHRIFT_0_14_1) $(LIBTHRIFT_0_14_1_DEV) \
#$(LIBSAIVS) $(LIBSAIVS_DEV) $(LIBSAIMETADATA) $(LIBSAIMETADATA_DEV)

# $(LIBSAITHRIFT_DEV)_BUILD_ENV = platform=v
$(LIBSAITHRIFT_DEV)_BUILD_ENV = SAITHRIFTV2=true SAITHRIFT_VER=v2
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't it be under

ifeq ($(SAITHRIFT_V2),y)

@@ -295,6 +295,7 @@ endif
$(info "ENABLE_SYNCD_RPC" : "$(ENABLE_SYNCD_RPC)")
$(info "SAITHRIFT_V2" : "$(SAITHRIFT_V2)")
$(info "ENABLE_ORGANIZATION_EXTENSIONS" : "$(ENABLE_ORGANIZATION_EXTENSIONS)")
$(info "SAITHRIFT_V2" : "$(SAITHRIFT_V2)")
Copy link
Contributor

Choose a reason for hiding this comment

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

Will be great to add this variable to rules/config file

export ONIE_PLATFORM=`grep onie_platform /etc/machine.conf | awk 'BEGIN { FS = "=" } ; { print $2 }'`
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/bfn/install/lib:/opt/bfn/install/lib/platform/$ONIE_PLATFORM:/opt/bfn/install/lib:/opt/bfn/install/lib/tofinopd/switch
./opt/bfn/install/bin/dma_setup.sh
/usr/sbin/saiserver -p /etc/sai/profile.ini -f /etc/sai/portmap.ini
Copy link
Contributor

Choose a reason for hiding this comment

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

Where /etc/sai/portmap.ini is taken?

@msosyak
Copy link
Contributor

msosyak commented Jan 5, 2023

@richardyu-ms shouldn't this PR be closed in favor of #13166?

@richardyu-ms
Copy link
Contributor Author

close this one as all the change finished in #13166

@richardyu-ms richardyu-ms deleted the bfn_saiserverv2_support branch January 16, 2023 11:28
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.

3 participants