Skip to content

Comments

[minipack3n] Add presenceDetection for FCB/PDB slot in platform_manager#350

Closed
brandonchuang wants to merge 1 commit intofacebook:mainfrom
brandonchuang:mp3n_fan_psu_presence
Closed

[minipack3n] Add presenceDetection for FCB/PDB slot in platform_manager#350
brandonchuang wants to merge 1 commit intofacebook:mainfrom
brandonchuang:mp3n_fan_psu_presence

Conversation

@brandonchuang
Copy link
Contributor

Description:

  1. Add the presenceDetection entry for the below slots in platform_manager.json
    PDBLEFT_SLOT
    PDBRIGHT_SLOT
    FCBBOTTOM_SLOT
    FCBTOP_SLOT

Motivation:

  1. The presenceDetection for the PDB/FCB slots are missing.
  2. Add psu_l_present for PDBLEFT_SLOT
  3. Add psu_r_present for PDBRIGHT_SLOT
  4. Add fan[2|4|6|8]_present for FCBBOTTOM_SLOT
  5. Add fan[1|3|5|7]_present for FCBTOP_SLOT

Test Plan:

  1. Run platform_manager with the updated configuration.
  2. Plug in all FANs and PSUs, then verify that all FCB and PDB slots are explored successfully.
    20250313_ALL_(FAN_PSU)present.txt
  3. Remove the left PSU and verify that PDBLEFT_SLOT fails during exploration.
    20250313_PDB_L_not_present.txt
  4. Remove the right PSU and verify that PDBRIGHT_SLOT fails during exploration.
    20250313_PDB_R_not_present.txt
  5. Remove fans 1/3/5/7 and verify that FCBTOP_SLOT fails during exploration.
    20250313_FCB_T_FAN_1_not_present.txt
    20250313_FCB_T_FAN_3_not_present.txt
    20250313_FCB_T_FAN_5_not_present.txt
    20250313_FCB_T_FAN_7_not_present.txt
  6. Remove fans 2/4/6/8 and verify that FCBBOTTOM_SLOT fails during exploration.
    20250313_FCB_B_FAN_2_not_present.txt
    20250313_FCB_B_FAN_4_not_present.txt
    20250313_FCB_B_FAN_6_not_present.txt
    20250313_FCB_B_FAN_8_not_present.txt

…er.json

Description:
1) Add the `presenceDetection` entry for the below slots in platform_manager.json
   PDBLEFT_SLOT
   PDBRIGHT_SLOT
   FCBBOTTOM_SLOT
   FCBTOP_SLOT

Motivation:
1) The presenceDetection for the PDB/FCB slots are missing.
1) Add `psu_l_present` for `PDBLEFT_SLOT`
2) Add `psu_r_present` for `PDBRIGHT_SLOT`
3) Add `fan[2|4|6|8]_present` for `FCBBOTTOM_SLOT`
4) Add `fan[1|3|5|7]_present` for `FCBTOP_SLOT`

Test Plan:
1) Run `platform_manager` with the updated configuration.
2) Plug in all FANs and PSUs, then verify that all FCB and PDB slots are explored successfully.
   [20250313_ALL_(FAN_PSU)_present_.txt](https://github.com/user-attachments/files/19223588/20250313_ALL_.FAN_PSU._present_.txt)
3) Remove the left PSU and verify that `PDBLEFT_SLOT` fails during exploration.
   [20250313_PDB_L_not_present.txt](https://github.com/user-attachments/files/19223616/20250313_PDB_L_not_present.txt)
4) Remove the right PSU and verify that `PDBRIGHT_SLOT` fails during exploration.
   [20250313_PDB_R_not_present.txt](https://github.com/user-attachments/files/19223618/20250313_PDB_R_not_present.txt)
5) Remove fans 1/3/5/7 and verify that `FCBTOP_SLOT` fails during exploration.
   [20250313_FCB_T_FAN_1_not_present.txt](https://github.com/user-attachments/files/19223623/20250313_FCB_T_FAN_1_not_present.txt)
   [20250313_FCB_T_FAN_3_not_present.txt](https://github.com/user-attachments/files/19223634/20250313_FCB_T_FAN_3_not_present.txt)
   [20250313_FCB_T_FAN_5_not_present.txt](https://github.com/user-attachments/files/19223727/20250313_FCB_T_FAN_5_not_present.txt)
   [20250313_FCB_T_FAN_7_not_present.txt](https://github.com/user-attachments/files/19223728/20250313_FCB_T_FAN_7_not_present.txt)
6) Remove fans 2/4/6/8 and verify that `FCBBOTTOM_SLOT` fails during exploration.
   [20250313_FCB_B_FAN_2_not_present.txt](https://github.com/user-attachments/files/19223730/20250313_FCB_B_FAN_2_not_present.txt)
   [20250313_FCB_B_FAN_4_not_present.txt](https://github.com/user-attachments/files/19223731/20250313_FCB_B_FAN_4_not_present.txt)
   [20250313_FCB_B_FAN_6_not_present.txt](https://github.com/user-attachments/files/19223732/20250313_FCB_B_FAN_6_not_present.txt)
   [20250313_FCB_B_FAN_8_not_present.txt](https://github.com/user-attachments/files/19223733/20250313_FCB_B_FAN_8_not_present.txt)
@kimdo8736
Copy link

kimdo8736 commented Mar 13, 2025

Thanks for the thorough testings

@facebook-github-bot
Copy link
Contributor

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

},
"PDBLEFT_SLOT@0": {
"slotType": "PDBLEFT_SLOT",
"presenceDetection": {

Choose a reason for hiding this comment

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

Can you please:

  1. Define PSU(LEFT | RIGHT) PmUnit.
  2. Add the above PmUnits' IDPROM config with corresponding PSU eeprom.

Comment on lines +2790 to +2835
"presenceDetection": {
"sysfsFileHandle": {
"devicePath": "/[MCB_FAN_CPLD]",
"presenceFileName": "fan2_present",
"desiredValue": 1
}
},
"outgoingI2cBusNames": [
"MCB_IOB_I2C_MASTER_17"
]
},
"FCBBOTTOM_SLOT@1": {
"slotType": "FCBBOTTOM_SLOT",
"presenceDetection": {
"sysfsFileHandle": {
"devicePath": "/[MCB_FAN_CPLD]",
"presenceFileName": "fan4_present",
"desiredValue": 1
}
},
"outgoingI2cBusNames": [
"MCB_IOB_I2C_MASTER_17"
]
},
"FCBBOTTOM_SLOT@2": {
"slotType": "FCBBOTTOM_SLOT",
"presenceDetection": {
"sysfsFileHandle": {
"devicePath": "/[MCB_FAN_CPLD]",
"presenceFileName": "fan6_present",
"desiredValue": 1
}
},
"outgoingI2cBusNames": [
"MCB_IOB_I2C_MASTER_17"
]
},
"FCBBOTTOM_SLOT@3": {
"slotType": "FCBBOTTOM_SLOT",
"presenceDetection": {
"sysfsFileHandle": {
"devicePath": "/[MCB_FAN_CPLD]",
"presenceFileName": "fan8_present",
"desiredValue": 1
}
},

Choose a reason for hiding this comment

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

Looks like physically one FCB to 4 Fans.
Can you create a separate PmUnit for "FAN" (you need 4), then define presence detection in FCB's outgoingSlotConfigs?

Copy link
Contributor

@somasun somasun left a comment

Choose a reason for hiding this comment

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

Please address @kimdo8736's comments.

raghav-nexthop pushed a commit to nexthop-ai/fboss that referenced this pull request Feb 6, 2026
<!-- Thanks for submitting a pull request! We appreciate you spending
the time to work on these changes. Please provide enough information so
that others can review your pull request. -->

**Pre-submission checklist**
- [ ] I've ran the linters locally and fixed lint errors related to the
files I modified in this PR. You can install the linters by running `pip
install -r requirements-dev.txt && pre-commit install`
- [ ] `pre-commit run`

# Summary

<!-- Explain the motivation for making this change and any other context
that you think would help reviewers of your code. What existing problem
does the pull request solve? -->

#### Why I did it

To get the Port LEDs to work on Golden Eagle so led_service_hw_test
passes

#### How I did it
Added led mappings to BspPlatformMapping and added the port leds to
platform manager json
The bsp module to add port leds is here:
nexthop-ai/nh#7605

If blinking is not working (or failures in test related to blink),
create a .conf file in `/etc/modules-load.d/` which has
```
ledtrig-timer
```
Which appears to not be loaded by default and is necessary for blink to
work

# Test Plan

<!-- Demonstrate the code is solid. Example: The exact commands you ran
and their output, screenshots / videos if the pull request changes the
user interface. How exactly did you verify that your PR solves the issue
you wanted to solve? -->


The Port LED will flash green and yellow when tests are being run. The
hw test passes with an modified Nh4010BspPlatformMapping json file and a
led.conf file

```
bash-5.1$ cd /opt/fboss/bin && sudo LD_LIBRARY_PATH=/opt/fboss/lib ./led_service_hw_test --bsp_platform_mapping_override_path=/home/admin/nh/nh4010_bsp_platform_mapping.json
[==========] Running 3 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 3 tests from LedServiceTest
[ RUN      ] LedServiceTest.checkForceLed
Overriding default flag from config: mode=nh4010
I0121 20:48:27.267847 51489 PlatformProductInfo.cpp:381] Success parsing product info fields
I0121 20:48:27.268689 51489 FsdbSwitchStateSubscriber.cpp:117] LED Service Subscribed to FSDB switch state path
I0121 20:48:27.268698 51489 LedManager.cpp:37] Created base LED Manager and subscribed to FSDB
I0121 20:48:27.268754 51489 BspGenericSystemContainer.cpp:44] Overriding BSP platform mapping from /home/admin/nh/nh4010_bsp_platform_mapping.json
I0121 20:48:27.269516 51489 I2cDevIo.cpp:86] Creating I2cRdWrIo for /run/devmap/xcvrs/xcvr_io_1
I0121 20:48:27.269607 51489 I2cDevIo.cpp:86] Creating I2cRdWrIo for /run/devmap/xcvrs/xcvr_io_2

...

I0121 20:55:06.516198 51489 LedServiceTest.cpp:334] Testing SW Port 348 with speed HUNDREDG and profile PROFILE_100G_1_PAM4_RS544_OPTICAL
I0121 20:55:06.558185 51489 LedIO.cpp:96] Trace: set LED 64 (0 base) to Blue and blink OFF
I0121 20:55:06.612149 51489 LedIO.cpp:96] Trace: set LED 64 (0 base) to Blue and blink SLOW
I0121 20:55:06.679147 51489 LedIO.cpp:110] Trace: set LED 64 (0 base) to Yellow and blink FAST
I0121 20:55:06.733212 51489 LedIO.cpp:96] Trace: set LED 64 (0 base) to Blue and blink SLOW
I0121 20:55:06.733438 51489 FsdbSwitchStateSubscriber.cpp:129] LED Service Removed from FSDB subscription
I0121 20:55:06.733456 51489 LedManager.cpp:47] Removed LED manager subscription from FSDB
I0121 20:55:06.733585 51489 LedManager.cpp:55] Removed LED manager thread and deleting Led Manager object now
[       OK ] LedServiceTest.checkLedBlinking (97453 ms)
[----------] 3 tests from LedServiceTest (399466 ms total)

[----------] Global test environment tear-down
[==========] 3 tests from 1 test suite ran. (399466 ms total)
[  PASSED  ] 3 tests.
```



<!-- If a relevant Github issue exists for this PR, please make sure you
link that issue to this PR -->
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.

4 participants