-
Notifications
You must be signed in to change notification settings - Fork 270
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
Add mdio IPC client library #1230
Conversation
Signed-off-by: Jiahua Wang <jiahua.wang@broadcom.com> Why I did it The syncd has a MDIO IPC server to help the access of external PHYs on the NPU MDIO bus. A MDIO IPC client library is required to communicate to the MDIO IPC server. The gbsyncd will pass the function pointers for the function in the client library to the PAI. How I did it MDIO IPC client functions are added to connect to the MDIO IPC server socket, to send request and to wait for response IPC messages. The client functions are made into a .so library. The .so library is packaged in the syncd debian package. How to verify it The client functions are also available in as a .a library. The unit test code can use the code to test both IPC server and client.
@kcudnik, Junhua, pls merge the code PR, this is needed for 202305 |
@jiahua-wang, currently swss-common repo UT failed and PR blocked because new UT and azure-pipeline change in this PR. This PR add new UT: TEST(MdioIpcServer, mdioAccess), Also this PR modify .azure-pipelines/build-template.yml to support new UT. However, there few sonic-swss-common repo also build and run sonic-sairedis UTs, could you please also fix the build break which caused by this UT in sonic-swss-common? Here is an UT break example: |
sonic-net/sonic-swss-common#778
has been created. This PR will make similar changes in sonic-swss-common/.azure-pipelines/build-sairedis-template.yml as what #1230 has done in sonic-sairedis/.azure-pipelines/build-template.yml
The diff is as following:
commit 65354201064747c255056cb8a5a262c59284f216 (HEAD -> build-template, origin/build-template)
Author: Jiahua Wang ***@***.***>
Date: Fri Apr 28 05:35:26 2023 +0000
Create directory /var/run/sswsyncd and add capability for syncd unittest
Signed-off-by: Jiahua Wang ***@***.***>
diff --git a/.azure-pipelines/build-sairedis-template.yml b/.azure-pipelines/build-sairedis-template.yml
index 308ac75..49bb7d9 100644
--- a/.azure-pipelines/build-sairedis-template.yml
+++ b/.azure-pipelines/build-sairedis-template.yml
@@ -87,6 +87,7 @@ jobs:
sudo sed -ri 's/redis-server.sock/redis.sock/' /etc/redis/redis.conf
sudo sed -ri 's/^databases .*/databases 17/' /etc/redis/redis.conf
sudo service redis-server start
+ sudo mkdir -m 755 /var/run/sswsyncd
sudo apt-get install -y rsyslog
sudo service rsyslog start
@@ -129,6 +130,8 @@ jobs:
DEB_BUILD_OPTIONS=nocheck DEB_BUILD_PROFILES=nopython2 fakeroot dpkg-buildpackage -b -us -uc -Tbinary-syncd-vs -j$(nproc)
# Add SYS_TIME capability for settimeofday ok in syncd test
sudo setcap "cap_sys_time=eip" syncd/.libs/syncd_tests
+ # Add CAP_DAC_OVERRIDE capability for system directory creation in syncd unittest
+ sudo setcap "cap_dac_override,cap_ipc_lock,cap_ipc_owner,cap_sys_time=eip" unittest/syncd/.libs/tests
make check
mv ../*.deb .
displayName: "Compile sonic sairedis"
Thanks,
Jiahua
… On Apr 27, 2023, at 8:05 PM, Hua Liu ***@***.***> wrote:
@jiahua-wang <https://www.google.com/url?q=https://github.com/jiahua-wang&source=gmail-imap&ust=1683255956000000&usg=AOvVaw1zKF4Wmbr84aSiarj0kvWx>, currently swss-common repo UT failed and PR blocked because new UT and azure-pipeline change in this PR.
This PR add new UT: TEST(MdioIpcServer, mdioAccess), Also this PR modify .azure-pipelines/build-template.yml to support new UT.
However, there few sonic-swss-common repo also build and run sonic-sairedis UTs, could you please also fix the build break which caused by this UT in sonic-swss-common?
https://github.com/sonic-net/sonic-swss-common/blob/master/.azure-pipelines/build-sairedis-template.yml <https://www.google.com/url?q=https://github.com/sonic-net/sonic-swss-common/blob/master/.azure-pipelines/build-sairedis-template.yml&source=gmail-imap&ust=1683255956000000&usg=AOvVaw39RM859gcvsaRDmPhWfMQi>
Here is an UT break example:
sonic-net/sonic-swss-common#715 <https://www.google.com/url?q=https://github.com/sonic-net/sonic-swss-common/pull/715&source=gmail-imap&ust=1683255956000000&usg=AOvVaw0wqVrJiA5M_0cNeBytxsDg>
https://dev.azure.com/mssonic/build/_build/results?buildId=261336&view=logs&j=61b7eb0d-78fa-5af5-6df0-b6f82d3891a8&t=f575074c-f5f7-5116-3e48-4a11a237643a <https://www.google.com/url?q=https://dev.azure.com/mssonic/build/_build/results?buildId%3D261336%26view%3Dlogs%26j%3D61b7eb0d-78fa-5af5-6df0-b6f82d3891a8%26t%3Df575074c-f5f7-5116-3e48-4a11a237643a&source=gmail-imap&ust=1683255956000000&usg=AOvVaw2D2E788NYsHD_FVJN-4sBc>
—
Reply to this email directly, view it on GitHub <https://www.google.com/url?q=https://github.com/sonic-net/sonic-sairedis/pull/1230%23issuecomment-1526917519&source=gmail-imap&ust=1683255956000000&usg=AOvVaw32iqgi8GJTaNKTbHeegKQP>, or unsubscribe <https://www.google.com/url?q=https://github.com/notifications/unsubscribe-auth/AJF3Z63DSY6QTOFRUFGPXLDXDMXZFANCNFSM6AAAAAAXETE5PA&source=gmail-imap&ust=1683255956000000&usg=AOvVaw1KK0KpFoP0mtilzvu7L4op>.
You are receiving this because you were mentioned.
--
This electronic communication and the information and any files transmitted
with it, or attached to it, are confidential and are intended solely for
the use of the individual or entity to whom it is addressed and may contain
information that is confidential, legally privileged, protected by privacy
laws, or otherwise restricted from disclosure to anyone else. If you are
not the intended recipient or the person responsible for delivering the
e-mail to the intended recipient, you are hereby notified that any use,
copying, distributing, dissemination, forwarding, printing, or copying of
this e-mail is strictly prohibited. If you received this e-mail in error,
please return the e-mail to the sender, delete it from your computer, and
destroy any printed copy of it.
|
Signed-off-by: Jiahua Wang jiahua.wang@broadcom.com
Why I did it
The syncd has a MDIO IPC server to help the access of external PHYs on the NPU MDIO bus. A MDIO IPC client library is required to communicate to the MDIO IPC server. The gbsyncd will pass the function pointers for the function in the client library to the PAI.
How I did it
MDIO IPC client functions are added to connect to the MDIO IPC server socket, to send request and to wait for response IPC messages. The client functions are made into a .so library. The .so library is packaged in the syncd debian package.
How to verify it
The client functions are also available in as a .a library. The unit test code can use the code to test both IPC server and client.