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 support for S9300-32D platform #14922

Merged
merged 2 commits into from
Jul 5, 2023
Merged

[Ufispace][PDDF] Add support for S9300-32D platform #14922

merged 2 commits into from
Jul 5, 2023

Conversation

linyutsung
Copy link
Contributor

@linyutsung linyutsung commented May 3, 2023

Signed-off-by: linyutsung linyutsung6502@gmail.com

Why I did it

Add PDDF support on Ufispace S9300-32D with Broadcom ASIC

How I did it

Add PDDF configuration files, scripts and python files

How to verify it

Run pddf commands and show command

root@sonic:~# pddf_psuutil status
PSU    Status
-----  --------
PSU1   OK
PSU2   NOT OK

root@sonic:~# pddf_thermalutil gettemp
Temp Sensor       Value
----------------  -------
Temp_CPU_PECI     temp1  +48.0 C (high = +95.0 C, crit = +100.0 C)
Temp_CPU_ENV      temp1  +43.0 C (high = +85.0 C, crit = +90.0 C)
Temp_CPU_ENV2     temp1  +43.0 C (high = +70.0 C, crit = +80.0 C)
Temp_MAC_ENV      temp1  +46.0 C (high = +85.0 C, crit = +90.0 C)
Temp_MAC_DIE      temp1  +54.0 C (high = +100.0 C, crit = +105.0 C)
Temp_CAGE         temp1  +43.0 C (high = +85.0 C, crit = +90.0 C)
Temp_PSU_CONNTOR  temp1  +41.0 C (high = +65.0 C, crit = +70.0 C)

root@sonic:~# pddf_ledutil getstatusled SYS_LED
green

root@sonic:~# show interfaces transceiver presence
Port         Presence
-----------  -----------
Ethernet0    Present
Ethernet8    Not present
Ethernet16   Not present
Ethernet24   Not present
Ethernet32   Not present
Ethernet40   Not present
Ethernet48   Not present
Ethernet56   Not present
Ethernet64   Not present
Ethernet72   Not present
Ethernet80   Not present
Ethernet88   Not present
Ethernet96   Not present
Ethernet104  Not present
Ethernet112  Not present
Ethernet120  Not present
Ethernet128  Not present
Ethernet136  Not present
Ethernet144  Not present
Ethernet152  Not present
Ethernet160  Not present
Ethernet168  Not present
Ethernet176  Not present
Ethernet184  Not present
Ethernet192  Not present
Ethernet200  Not present
Ethernet208  Not present
Ethernet216  Not present
Ethernet224  Not present
Ethernet232  Not present
Ethernet240  Not present
Ethernet248  Present
Ethernet256  Not present
Ethernet257  Present

root@sonic:~# show platform fan
  Drawer    LED         FAN                Speed    Direction    Presence    Status          Timestamp
--------  -----  ----------  -------------------  -----------  ----------  --------  -----------------
Fantray1  green  Fantray1_1                  56%       INTAKE     Present        OK  20230503 21:38:00
Fantray1  green  Fantray1_2                  56%       INTAKE     Present        OK  20230503 21:38:00
Fantray2  green  Fantray2_1                  55%       INTAKE     Present        OK  20230503 21:38:00
Fantray2  green  Fantray2_2                  56%       INTAKE     Present        OK  20230503 21:38:00
Fantray3  green  Fantray3_1                  55%       INTAKE     Present        OK  20230503 21:38:00
Fantray3  green  Fantray3_2                  55%       INTAKE     Present        OK  20230503 21:38:00
Fantray4  green  Fantray4_1                  55%       INTAKE     Present        OK  20230503 21:38:00
Fantray4  green  Fantray4_2                  56%       INTAKE     Present        OK  20230503 21:38:00
Fantray5  green  Fantray5_1                  55%       INTAKE     Present        OK  20230503 21:38:00
Fantray5  green  Fantray5_2                  55%       INTAKE     Present        OK  20230503 21:38:00
Fantray6  green  Fantray6_1                  57%       INTAKE     Present        OK  20230503 21:38:00
Fantray6  green  Fantray6_2                  55%       INTAKE     Present        OK  20230503 21:38:00
     N/A    N/A   PSU1_FAN1                  70%      EXHAUST     Present        OK  20230503 21:38:00
     N/A    N/A   PSU2_FAN1                   0%      EXHAUST     Present    Not OK  20230503 21:38:00

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)

@linyutsung linyutsung requested a review from lguohan as a code owner May 3, 2023 07:39
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented May 17, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: linyutsung / name: leo lin (0bef4c87a0c0218bc891d08030e96e399d55a03c)

@adyeung
Copy link
Collaborator

adyeung commented May 19, 2023

@FuzailBrcm pls help review

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented May 22, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: linyutsung / name: leo lin (aa7bc229833650317f66b0704eed722590a330e0)

@linyutsung
Copy link
Contributor Author

sync with latest master and reopen, please help to review

try:
# The index will start from 1
# sfputil already convert to physical port index according to config
sfp = self._sfp_list[index]
Copy link
Contributor

Choose a reason for hiding this comment

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

Please check this once again. Generally, the index passed down from 'xcvrd' to chassis.py is 1 based. So, to get the required sfp obj from _sfp_list, you need to do 'index-1'.

Copy link
Contributor

Choose a reason for hiding this comment

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

Please check this once again. Generally, the index passed down from 'xcvrd' to chassis.py is 1 based. So, to get the required sfp obj from _sfp_list, you need to do 'index-1'.

I take back my comment. I just checked your port_config.ini and that is using 0-based indexing. So no requirement of 'index-1'. However, this function is not required then as the parent class 'chassis_base.py' provide the same definition.

https://github.com/sonic-net/sonic-platform-common/blob/8c0398eb911ee96967c3a0e1b7fb3ba9167451e1/sonic_platform_base/chassis_base.py#L477

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, you're right, the definition is duplicated, will update it.

status = True if (speed != 0) else False
return status

def get_target_speed(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

target speed is the speed intended from the duty-cycle (or pwm) setting. I can understand of the PSU-fan intended speed is fixed but how can System fan target_speed is fixed at 65%?
Are you not supporting fan speed variations?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since the platform doesn't support pwm setting and the fan speed is controlled by ucd accroding to thermal sensor. Is that ok to set the target speed to crrent speed percentage to avoid warning ?


return direction

def get_presence(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

This implementation is pretty similar to the one present in pddf_fan.py. Can you double check why you had to overwrite that def with this one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently, the base always set the psu fan presence to true which is FRU in our platform. So we overwrite it to dectect PSU presence as for psu fan presence.

{
"capability":
{
"ro": ["SYS_LED", "FAN_LED", "PSU1_LED", "PSU2_LED"],
Copy link
Contributor

Choose a reason for hiding this comment

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

This 'rw' or 'ro' flags are supported in pddf-device.json structure now. Please check this example below,

"LOC_LED":
{
    "dev_info": { "device_type":"LED", "device_name":"LOC_LED"},
    "dev_attr": { "index":"0", **"flag": "rw"**},
    "i2c" :
    {
        "attr_list":
        [
            {"attr_name":"blue_blink", "descr": "" , "bits" : "5:0",  "value" : "0x27", "swpld_addr" : "0x60", "swpld_addr_offset" : "0x25"},

You can make use of this provision.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for your kindly notification, will update this

2. use flag to set led w/o in device config instead of validation in API.
3. update led color from amber to yellow
4. set fan target speed to current speed
@linyutsung
Copy link
Contributor Author

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

@FuzailBrcm
Copy link
Contributor

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

Changes look good to me. Approved.

@linyutsung
Copy link
Contributor Author

@lguohan FuzailBrcm has reviewed and approved, please help to merge, thanks

@linyutsung
Copy link
Contributor Author

@lguohan please help to merge, thanks

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.

4 participants