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

[Ufispace][PDDF] Add PDDF support on S9180-32X #14909

Merged
merged 4 commits into from
Jul 24, 2023

Conversation

cytsai0409
Copy link
Contributor

@cytsai0409 cytsai0409 commented May 2, 2023

Signed-off-by: Jason Tsai jason.cy.tsai@ufispace.com

Why I did it

Add PDDF support on Ufispace S9180-32X with Barefoot ASIC

How I did it

Add PDDF configuration files, scripts and python files

How to verify it

Run pddf commands and show commands.

root@sonic:~# pddf_psuutil status
PSU    Status
-----  --------
PSU1   OK
PSU2   OK
root@sonic:~# pddf_thermalutil gettemp
                Temp Sensor     Value
--------------  --------------  -------
Temp_CPU_BOARD  tmp75-i2c-0-4f  temp1    +36.7 C (crit = +70.0 C)
Temp_BMC        temp1    +33.0 C (crit = +65.0 C)
Temp_MAC        temp1    +52.0 C (crit = +95.0 C)
Temp_MAC_Front  temp1    +35.0 C (crit = +65.0 C)
Temp_MAC_Rear   temp1    +37.0 C (crit = +65.0 C)
Temp_PSU1_AMB   temp1    +39.0 C (crit = +60.0 C)
Temp_PSU1_HS    temp1    +42.0 C (crit = +95.0 C)
Temp_PSU2_AMB   temp1    +42.0 C (crit = +60.0 C)
Temp_PSU2_HS    temp1    +39.0 C (crit = +95.0 C)
root@sonic:~# pddf_fanutil status
FAN         Status
----------  --------
Fantray1_1  OK
Fantray1_2  OK
Fantray2_1  OK
Fantray2_2  OK
Fantray3_1  OK
Fantray3_2  OK
Fantray4_1  OK
Fantray4_2  OK

root@sonic:~# pddf_ledutil getstatusled SYS_LED
green

root@sonic:~# show interfaces transceiver presence
Port         Presence
-----------  -----------
Ethernet0    Present
Ethernet4    Not present
Ethernet8    Present
Ethernet12   Not present
Ethernet16   Present
Ethernet20   Not present
Ethernet24   Not present
Ethernet28   Not present
Ethernet32   Not present
Ethernet36   Not present
Ethernet40   Not present
Ethernet44   Not present
Ethernet48   Not present
Ethernet52   Not present
Ethernet56   Not present
Ethernet60   Not present
Ethernet64   Not present
Ethernet68   Not present
Ethernet72   Not present
Ethernet76   Not present
Ethernet80   Not present
Ethernet84   Not present
Ethernet88   Not present
Ethernet92   Not present
Ethernet96   Not present
Ethernet100  Not present
Ethernet104  Not present
Ethernet108  Not present
Ethernet112  Not present
Ethernet116  Not present
Ethernet120  Not present
Ethernet124  Not present
Ethernet128  Present
Ethernet129  Present
root@sonic:~# show platform fan
  Drawer    LED         FAN    Speed    Direction    Presence    Status          Timestamp
--------  -----  ----------  -------  -----------  ----------  --------  -----------------
Fantray1  green  Fantray1_1      49%       intake     Present        OK  20230502 02:11:59
Fantray1  green  Fantray1_2      50%       intake     Present        OK  20230502 02:11:59
Fantray2  green  Fantray2_1      50%       intake     Present        OK  20230502 02:11:59
Fantray2  green  Fantray2_2      50%       intake     Present        OK  20230502 02:11:59
Fantray3  green  Fantray3_1      49%       intake     Present        OK  20230502 02:11:59
Fantray3  green  Fantray3_2      51%       intake     Present        OK  20230502 02:11:59
Fantray4  green  Fantray4_1      49%       intake     Present        OK  20230502 02:11:59
Fantray4  green  Fantray4_2      51%       intake     Present        OK  20230502 02:11:59
     N/A    N/A   PSU1_FAN1      29%       intake     Present        OK  20230502 02:11:59
     N/A    N/A   PSU2_FAN1      27%       intake     Present        OK  20230502 02:11:59

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

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211

Tested branch (Please provide the tested image version)

  • master

Description for the changelog

Link to config_db schema for YANG module changes

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

@cytsai0409 cytsai0409 requested a review from lguohan as a code owner May 2, 2023 02:18
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented May 2, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

Signed-off-by: cytsai0409 <cytsai0409@gmail.com>
Signed-off-by: cytsai0409 <cytsai0409@gmail.com>
@adyeung
Copy link
Collaborator

adyeung commented May 19, 2023

@FuzailBrcm pls help review

#self._sfp_list[int(index)].check_sfp_optoe_type()
return ret_dict

def get_sfp(self, index):
Copy link
Contributor

Choose a reason for hiding this comment

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

This might not be required as he parent class chassi_base.py provide the same definition of the func.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok. I will remove this function.


return rpm_speed

def get_direction(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you check this again?
I think same implementation is present in the pddf_fan.py class.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This device is old design and we can't get fan direction information from CPU or BMC. I tried to take implementation from pddf_fan.py class, the direction will be "N/a". So I still need to overwrite the get_direction() function and set the direction to FAN_DIRECTION_EXHAUST to fit our device. I will update the code later.

if self.is_psu_fan:
return 75
else:
return 65
Copy link
Contributor

Choose a reason for hiding this comment

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

Is your system fan doesnt support speed variations etc?
How is the target speed has a fixed value? This is supposed to be the speed intended by the user. Its calculation is based on the duty-cycle/pwm calculations.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, The fan speed is fully controlled by BMC and not open for the users. Still I will update the code to get current speed to avoid fixed value which is quite misleading. Thanks.

1. remove duplicate get_sfp() in chassis.py
2. update get_direction() and get_target_speed() in fan.py

Signed-off-by: cytsai0409 <cytsai0409@gmail.com>
@cytsai0409
Copy link
Contributor Author

@FuzailBrcm update committed and pass the check, pls help review, thanks

Copy link
Contributor

@FuzailBrcm FuzailBrcm left a comment

Choose a reason for hiding this comment

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

Changes look okay to me.

@cytsai0409
Copy link
Contributor Author

@lguohan Please help review and merge, thanks.

@cytsai0409
Copy link
Contributor Author

@lguohan please help merge, thanks.

1 similar comment
@cytsai0409
Copy link
Contributor Author

@lguohan please help merge, thanks.

@cytsai0409
Copy link
Contributor Author

@yxieca please help merge, thanks.

@yxieca
Copy link
Contributor

yxieca commented Jul 21, 2023

@yxieca please help merge, thanks.

Please resolve the merge conflict.

@cytsai0409
Copy link
Contributor Author

@yxieca Merge conflict is resolved. Thanks.

@prgeor prgeor added the PDDF label Jul 24, 2023
@yxieca yxieca merged commit d2b5d77 into sonic-net:master Jul 24, 2023
17 checks passed
@liushilongbuaa
Copy link
Contributor

@cytsai0409 , bfnplatform-ufispace_1.0.0_amd64.deb conflicts with bfnsdk_20221130_sai_1.11.0_deb11.deb.
dpkg -c /sonic/target/debs/bullseye/bfnsdk_20221130_sai_1.11.0_deb11.deb | grep "^l.*bfn/install "
lrwxrwxrwx root/root 0 2022-12-02 16:15 ./opt/bfn/install -> install_x2_tofino
dpkg -c /sonic/target/debs/bullseye/bfnplatform-ufispace_1.0.0_amd64.deb | grep "^d.*bfn/install/"
drwxr-xr-x root/root 0 2023-03-14 06:16 ./opt/bfn/install/

@liushilongbuaa
Copy link
Contributor

It breaks barefoot SONiC image's build.
When install bfnsdk before bfnplatform-ufispace, it will succeed. Otherwise, it will fail.

liushilongbuaa added a commit to liushilongbuaa/sonic-buildimage that referenced this pull request Aug 10, 2023
@cytsai0409
Copy link
Contributor Author

@liushilongbuaa We checked the build logs and found sometimes bfnplatform-ufispace_1.0.0_amd64.deb is installed before bfnsdk_20221130_sai_1.11.0_deb11.deb. In this case the build process failed. We will add dependency rule in the makefile to avoid such installation conflict soon. Is this ok to you? Tks.

@liushilongbuaa
Copy link
Contributor

@cytsai0409 , if install ufispace after bfnsdk, /opt/intall/libsai.so will be override.
target/debs/bullseye/syncd_1.0.0_amd64.deb depends on libsai.so. build fails.

@cytsai0409
Copy link
Contributor Author

@liushilongbuaa Could you provide your build commands? We would like to reproduce the issue in our local environment. By the way the master branch has another build issue #16087 that we need time to walkaround it. Tks.

@liushilongbuaa
Copy link
Contributor

@cytsai0409 , you can check https://dev.azure.com/mssonic/build/_build?definitionId=146&_a=summary&branchFilter=11237%2C11237%2C11237%2C11237
It is not related with build options. There is race issues when building.

@liushilongbuaa
Copy link
Contributor

liushilongbuaa commented Aug 11, 2023

And you can login to sonic-slave-bullseye-$USER container to reproduce.

  1. sudo dpkg -P bfnsdk bfnplatform-ufispace
    1. sudo dpkg -i /sonic/target/debs/bullseye/bfnsdk_20221130_sai_1.11.0_deb11.deb
    2. sudo dpkg -i /sonic/target/debs/bullseye/bfnplatform-ufispace_1.0.0_amd64.deb
    3. cd /sonic/src/sonic-sairedis
    4. ./configure --------result is Success
  2. sudo dpkg -P bfnsdk bfnplatform-ufispace
    1. sudo dpkg -i /sonic/target/debs/bullseye/bfnplatform-ufispace_1.0.0_amd64.deb
    2. sudo dpkg -i /sonic/target/debs/bullseye/bfnsdk_20221130_sai_1.11.0_deb11.deb
    3. cd /sonic/src/sonic-sairedis
    4. ./configure --------result is Failure

@cytsai0409
Copy link
Contributor Author

@liushilongbuaa We plan to create a new bfnplatform-ufispace_1.0.0_amd64.deb that create new folder under /opt/bfn/install_x1_tofino and /opt/bfn/install_x2_tofino and put our files there. This way the files in bfnsdk_20221130_sai_1.11.0_deb11.deb are not affected and there will be no race issue. We will test it and let you know the result later. Tks.

yxieca pushed a commit that referenced this pull request Aug 11, 2023
@cytsai0409
Copy link
Contributor Author

@liushilongbuaa We created a test deb package and verified the file structures are the same under /opt/bfn regardless the package installation ordering. The logs are in the attachment files. Also the build process is successful in my environment with this test deb. I will update the bfnplatform-ufispace_1.0.0_amd64.deb on github and submit a new PR later. Tks.

@liushilongbuaa
Copy link
Contributor

I'm not sure how to check if there are other conflicts.
Please check carefully locally.

@cytsai0409
Copy link
Contributor Author

ok. I will stress the build process for a while locally and check if there are other conflicts not found so far. tks.

sonic-otn pushed a commit to sonic-otn/sonic-buildimage that referenced this pull request Sep 20, 2023
* Add s9180-32x pddf support

Signed-off-by: cytsai0409 <cytsai0409@gmail.com>

* Fix memset_s parameter

Signed-off-by: cytsai0409 <cytsai0409@gmail.com>

* Update chassis.py and fan.py

1. remove duplicate get_sfp() in chassis.py
2. update get_direction() and get_target_speed() in fan.py

Signed-off-by: cytsai0409 <cytsai0409@gmail.com>

---------

Signed-off-by: cytsai0409 <cytsai0409@gmail.com>
sonic-otn pushed a commit to sonic-otn/sonic-buildimage that referenced this pull request Sep 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants