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

DARWIN: add initial platform_manager.json config #267

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

adamcalabrigo
Copy link
Contributor

@adamcalabrigo adamcalabrigo commented Oct 15, 2024

Description

Adds initial platform_manager support for DARWIN platform.

All sysfs file names are the same as the current udev-based approach, with the following exception:

  • No watchdog sysfs file is created anymore, now that the kernel driver no longer exposes an endpoint. In the config, miscCtrlConfigs is used for watchdogs so that platform_manager doesn't enforce that a device be created in /dev/.
  • SC_QSFPDD_IR35223, SC_TH3_ANLG_IR35223, and SC_TH3_CORE_IR35223 devices are added for additional monitoring. These were previously shared but had not been incorporated.
  • SCD SPI device is added.

Caveats

  1. platform_manager currently reports two failures because it does not read Darwin's EEPROM format correctly; platform_manager support needs to be added for this:
platform_manager[1434]: I1015 00:50:40.059080  1434 PlatformExplorer.cpp:656] Concluding darwin exploration...
platform_manager[1434]: I1015 00:50:40.059091  1434 PlatformExplorer.cpp:660] Unexpected Failures in Device IDPROM for PmUnit RACKMON at SlotPath /RACKMON_SLOT@0
platform_manager[1434]: I1015 00:50:40.059096  1434 PlatformExplorer.cpp:670] 1. Could not fetch contents of IDPROM /sys/bus/i2c/devices/29-0052/eeprom in /RACKMON_SLOT@0. EEPROM version 48 is not supported. Only ver 4+ is supported.
platform_manager[1434]: I1015 00:50:40.059103  1434 PlatformExplorer.cpp:660] Unexpected Failures in Device IDPROM for PmUnit PEM at SlotPath /PEM_SLOT@0
platform_manager[1434]: I1015 00:50:40.059108  1434 PlatformExplorer.cpp:670] 1. Could not fetch contents of IDPROM /sys/bus/i2c/devices/28-0050/eeprom in /PEM_SLOT@0. EEPROM version 48 is not supported. Only ver 4+ is supported.
  1. platform_manager fails to read the version and subversion of the CPU_CPLD because the symlink is in /run/devmap/cplds/; this is where the symlink is located in the existing udev rule-based implementation, so the behavior is maintained here.
platform_manager[1434]: E1015 00:50:40.058992  1434 PlatformFsUtils.cpp:128] Received error code 2 from reading from path /run/devmap/cplds/ROOK_CPU_CPLD/cpld_ver: No such file or directory
platform_manager[1434]: E1015 00:50:40.059000  1434 PlatformExplorer.cpp:123] Failed to open firmware version file /run/devmap/cplds/ROOK_CPU_CPLD/cpld_ver: No such file or directory
platform_manager[1434]: E1015 00:50:40.059011  1434 PlatformFsUtils.cpp:128] Received error code 2 from reading from path /run/devmap/cplds/ROOK_CPU_CPLD/cpld_sub_ver: No such file or directory
platform_manager[1434]: E1015 00:50:40.059016  1434 PlatformExplorer.cpp:123] Failed to open firmware version file /run/devmap/cplds/ROOK_CPU_CPLD/cpld_sub_ver: No such file or directory
platform_manager[1434]: I1015 00:50:40.059021  1434 PlatformExplorer.cpp:733] Reporting firmware version for ROOK_CPU_CPLD - version string:0.0 ODS value:0

Test Plan

Tested on Darwin with Linux kernel 6.4 and CentOS 9.

platform_manager service is running:

[root@rkd326 sys]# systemctl status platform_manager
● platform_manager.service - FBOSS Platform Manager
     Loaded: loaded (/etc/systemd/system/platform_manager.service; enabled; preset: disabled)
     Active: active (running) since Tue 2024-10-15 00:50:40 UTC; 25min ago
    Process: 1432 ExecStartPre=/bin/bash -c [[ -f /opt/fboss/share/platform_configs/platform_manager.json ]] (code=exited, status=0/SUCCESS)
   Main PID: 1434 (platform_manage)
      Tasks: 32 (limit: 200901)
     Memory: 4.6M
        CPU: 1.880s
     CGroup: /system.slice/platform_manager.service
             └─1434 /opt/fboss/bin/platform_manager -config-file /opt/fboss/share/platform_configs/platform_manager.json -noenable_pkg_mgmnt --run_once=false -reload_kmods=true

platform_manager loads all devices correctly:

# tree /run/devmap/
/run/devmap/
├── cplds
│   ├── BLACKHAWK_CPLD -> /sys/bus/i2c/devices/9-0023
│   ├── FAN_CPLD -> /sys/bus/i2c/devices/13-0060
│   └── ROOK_CPU_CPLD -> /sys/bus/pci/devices/0000:ff:0b.3
├── eeproms
│   ├── FANSPINNER_EEPROM -> /sys/bus/i2c/devices/29-0050/eeprom
│   └── RACKMON_EEPROM -> /sys/bus/i2c/devices/29-0052/eeprom
├── flashes
│   └── SCD_SPI_MASTER_DEVICE1 -> /dev/spidev2002.0
├── fpgas
│   └── SCD_FPGA -> /sys/bus/pci/devices/0000:07:00.0
├── gpiochips
│   └── RACKMON_PLS -> /dev/gpiochip2
├── i2c-busses
│   ├── ROOK_SMBUS0_CH0 -> /dev/i2c-1
│   ├── ROOK_SMBUS0_CH1 -> /dev/i2c-2
│   ├── ROOK_SMBUS0_CH2 -> /dev/i2c-3
│   ├── ROOK_SMBUS0_CH3 -> /dev/i2c-4
│   ├── ROOK_SMBUS1_CH0 -> /dev/i2c-5
│   ├── ROOK_SMBUS1_CH1 -> /dev/i2c-6
│   ├── ROOK_SMBUS1_CH2 -> /dev/i2c-7
│   ├── ROOK_SMBUS1_CH3 -> /dev/i2c-8
│   ├── ROOK_SMBUS2_CH0 -> /dev/i2c-9
│   ├── ROOK_SMBUS2_CH1 -> /dev/i2c-10
│   ├── ROOK_SMBUS2_CH2 -> /dev/i2c-11
│   ├── ROOK_SMBUS2_CH3 -> /dev/i2c-12
│   ├── ROOK_SMBUS3_CH0 -> /dev/i2c-13
│   ├── ROOK_SMBUS3_CH1 -> /dev/i2c-14
│   ├── ROOK_SMBUS3_CH2 -> /dev/i2c-15
│   ├── ROOK_SMBUS3_CH3 -> /dev/i2c-16
│   ├── SCD_SMBUS0_CH0 -> /dev/i2c-17
│   ├── SCD_SMBUS0_CH1 -> /dev/i2c-18
│   ├── SCD_SMBUS0_CH2 -> /dev/i2c-19
│   ├── SCD_SMBUS0_CH3 -> /dev/i2c-20
│   ├── SCD_SMBUS0_CH4 -> /dev/i2c-21
│   ├── SCD_SMBUS0_CH5 -> /dev/i2c-22
│   ├── SCD_SMBUS0_CH6 -> /dev/i2c-23
│   ├── SCD_SMBUS0_CH7 -> /dev/i2c-24
│   ├── SCD_SMBUS1_CH0 -> /dev/i2c-25
│   ├── SCD_SMBUS1_CH1 -> /dev/i2c-26
│   ├── SCD_SMBUS1_CH2 -> /dev/i2c-27
│   ├── SCD_SMBUS1_CH3 -> /dev/i2c-28
│   ├── SCD_SMBUS1_CH4 -> /dev/i2c-29
│   ├── SCD_SMBUS1_CH5 -> /dev/i2c-30
│   ├── SCD_SMBUS1_CH6 -> /dev/i2c-31
│   └── SCD_SMBUS1_CH7 -> /dev/i2c-32
└── sensors
    ├── CPU_BOARD_TEMP_MAX6658 -> /sys/bus/i2c/devices/1-004c/hwmon/hwmon2
    ├── CPU_CORE_TEMP -> /sys/bus/platform/devices/coretemp.0/hwmon/hwmon1
    ├── CPU_FP_TEMP_LM73 -> /sys/bus/i2c/devices/15-0048/hwmon/hwmon3
    ├── CPU_MPS1_PMBUS -> /sys/bus/i2c/devices/3-0021/hwmon/hwmon5
    ├── CPU_MPS2_PMBUS -> /sys/bus/i2c/devices/3-0027/hwmon/hwmon6
    ├── CPU_POS_UCD90160 -> /sys/bus/i2c/devices/2-004e/hwmon/hwmon4
    ├── FAN_CPLD -> /sys/bus/i2c/devices/13-0060/hwmon/hwmon7
    ├── FS_FAN_SLG4F4527 -> /sys/bus/i2c/devices/29-0008/hwmon/hwmon15
    ├── PCH_THERMAL -> /sys/devices/virtual/thermal/thermal_zone0/hwmon0
    ├── PEM_ADC_MAX11645 -> /sys/bus/i2c/devices/28-0036/iio:device0
    ├── PEM_ECB_MAX5970 -> /sys/bus/i2c/devices/28-003a/hwmon/hwmon13
    ├── PEM_TEMP_MAX6658 -> /sys/bus/i2c/devices/28-004c/hwmon/hwmon14
    ├── SC_BOARD_TEMP_MAX6581 -> /sys/bus/i2c/devices/25-004d/hwmon/hwmon8
    ├── SC_POS_UCD90320 -> /sys/bus/i2c/devices/11-0011/hwmon/hwmon9
    ├── SC_QSFPDD_IR35223 -> /sys/bus/i2c/devices/32-0042/hwmon/hwmon12
    ├── SC_TH3_ANLG_IR35223 -> /sys/bus/i2c/devices/31-0041/hwmon/hwmon11
    └── SC_TH3_CORE_IR35223 -> /sys/bus/i2c/devices/30-0040/hwmon/hwmon10

@facebook-github-bot
Copy link
Contributor

@joancaneus has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@adamcalabrigo has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@adamcalabrigo has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@joancaneus has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

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.

2 participants