Introduction

Many Mellanox FRUs (fans or PSUs) have onboard EEPROMs that contain VPD (Vital Product Data) information. This often includes Part Number (PN), Serial Number (SN) and other information.

For fans and PSUs, Cumulus Linux, or more precisely, the included Mellanox Hardware Management package (hw-mgmt), uses this EEPROM data to determine the airflow direction.

However, some OEM FRUs may have PNs that are not recognized by Cumulus Linux, leading to issues with airflow detection. Some OEM PNs are handled in usr/bin/hw-management-helpers.sh, like the Dell OEM PSU 071-000-203-01 (this is a MTEF-PSF-AC-A). The matching fan, 045-000-018-00 aka MTEF-FANF-A, is not handled, leading to output like this:

cumulus@cumulus:mgmt:~$ nv show platform environment fan
Name      Fan State  Current Speed (RPM)  Max Speed  Min Speed  Fan Direction
--------  ---------  -------------------  ---------  ---------  -------------
FAN1/1    ok         11801                25000      1500       N/A          
FAN1/2    ok         10211                25000      1500       N/A          
FAN2/1    ok         12224                25000      1500       N/A          
FAN2/2    ok         10366                25000      1500       N/A          
FAN3/1    ok         12116                25000      1500       N/A          
FAN3/2    ok         10288                25000      1500       N/A          
FAN4/1    ok         12116                25000      1500       N/A          
FAN4/2    ok         10445                25000      1500       N/A          
PSU1/FAN  ok         10192                18000      2000       B2F          
PSU2/FAN  ok         10320                18000      2000       B2F    

You might also want to have nicer output, instead of:

cumulus@cumulus:mgmt:~$ nv show platform inventory 
          HW Version  Model          Serial        State  Type  
--------  ----------  -------------  ------------  -----  ------
...
PSU1      01          071-000-203-01  MT1234X56789  ok     psu   
PSU1/FAN  N/A         N/A             N/A           ok     fan   
PSU2      01          071-000-203-01  MT1234X56789  ok     psu   
PSU2/FAN  N/A         N/A             N/A           ok     fan   

Modding the EEPROM

For some reason, the path I expected to be writable, /sys/bus/i2c/devices/<bus>-<device>/eeprom is not.

Below you can find the commands I used to modify the EEPROMs on my SN2700 with Cumulus Linux 5.13.1

You have to reboot the switch after modifying the EEPROMs to make sure Cumulus Linux picks up the changes.

Write MTEF-FANF-A to fan:

printf '\x4d\x54\x45\x46\x2d\x46\x41\x4e\x46\x2d\x41\x00\x00\x00\x00\x00' | dd of=/sys/bus/i2c/devices/12-0050/12-00503/nvmem bs=1 seek=64 count=16 conv=notrunc

This writes the string MTEF-FANF-A\0\0\0\0\0 to the one of the fan EEPROMs, which is located at /sys/bus/i2c/devices/12-0050/12-00503/nvmem.

Pre-Mod:

cumulus@cumulus:mgmt:~$ cat /var/run/hw-management/eeprom/fan2_data 
SN:                      MT1821K12345
PN:                      045-000-018-00
REV:                     01
MFG_DATE:                15052723
PROD_NAME:               NEPTUNE_FAN
HW_MGT_ID:               66
HW_MGT_REV:              0
SW_MGT_ID:               851970
MAX_POWER:               0
CRIT_AMB_TEMP:           0
CRIT_IC_TEMP:            0
ALERT_AMB_TEMP:          0
ALERT_IC_TEMP:           0
FAN_DIR:                 1
LENGTH:                  0
WIDTH:                   0
LED:                     0

Post-Mod:

cumulus@cumulus:mgmt:~$ cat /var/run/hw-management/eeprom/fan2_data 
SN:                      MT1821K12345
PN:                      MTEF-FANF-A
REV:                     01
MFG_DATE:                15052723
PROD_NAME:               NEPTUNE_FAN
HW_MGT_ID:               66
HW_MGT_REV:              0
SW_MGT_ID:               851970
MAX_POWER:               0
CRIT_AMB_TEMP:           0
CRIT_IC_TEMP:            0
ALERT_AMB_TEMP:          0
ALERT_IC_TEMP:           0
FAN_DIR:                 1
LENGTH:                  0
WIDTH:                   0
LED:                     0
cumulus@cumulus:mgmt:~$ nv show platform environment fan
Name      Fan State  Current Speed (RPM)  Max Speed  Min Speed  Fan Direction
--------  ---------  -------------------  ---------  ---------  -------------
FAN1/1    ok         6268                 25000      1500       B2F
FAN1/2    ok         5378                 25000      1500       B2F
FAN2/1    ok         6268                 25000      1500       B2F
FAN2/2    ok         5357                 25000      1500       B2F
FAN3/1    ok         6239                 25000      1500       B2F
FAN3/2    ok         5315                 25000      1500       B2F
FAN4/1    ok         6385                 25000      1500       B2F
FAN4/2    ok         5421                 25000      1500       B2F
PSU1/FAN  ok         5576                 18000      2000       B2F
PSU2/FAN  ok         5456                 18000      2000       B2F

I didn’t bother to modify the other values.

Write MTEF-PSF-AC-A to the PSU:

printf '\x4d\x54\x45\x46\x2d\x50\x53\x46\x2d\x41\x43\x2d\x41\x00\x00\x00' | dd of=/sys/bus/i2c/devices/10-0050/10-00506/nvmem bs=1 seek=165 count=16 conv=notrunc

This writes the string MTEF-PSF-AC-A\0\0\0 to the PSU EEPROM, which is located at /sys/bus/i2c/devices/10-0050/10-00506/nvmem.

Pre-Mod:

cumulus@cumulus:mgmt:~$ cat /var/run/hw-management/eeprom/psu1_vpd 
SN_VPD_FIELD: MT2052X12345
PN_VPD_FIELD: 071-000-203-01
REV_VPD_FIELD: 01
MFG_DATE_FIELD: C9A4C8
MAX_RPM: 18000
MIN_RPM: 2000

Post-Mod:

cumulus@cumulus:mgmt:~$ cat /var/run/hw-management/eeprom/psu1_vpd 
SN_VPD_FIELD: MT2052X12345
PN_VPD_FIELD: MTEF-PSF-AC-A
REV_VPD_FIELD: 01
MFG_DATE_FIELD: C9A4C8
MAX_RPM: 18000
MIN_RPM: 2000
cumulus@cumulus:mgmt:~$ nv show platform inventory 
          HW Version  Model          Serial        State  Type  
--------  ----------  -------------  ------------  -----  ------
...
PSU1      01          MTEF-PSF-AC-A  MT2052X12345  ok     psu   
PSU1/FAN  N/A         N/A            N/A           ok     fan   
PSU2      01          MTEF-PSF-AC-A  MT2052X12345  ok     psu   
PSU2/FAN  N/A         N/A            N/A           ok     fan   

I²C Locations

The I²C locations of the FRUs can be different depending on the switch model. For the SN2700, the locations are:

  • PSU1: /sys/bus/i2c/devices/10-0050/ (I²C Bus 10, Address 0x50)
  • PSU2: /sys/bus/i2c/devices/10-0051/ (I²C Bus 10, Address 0x51)
  • FAN1: /sys/bus/i2c/devices/11-0050/ (I²C Bus 11, Address 0x50)
  • FAN2: /sys/bus/i2c/devices/12-0050/ (I²C Bus 12, Address 0x50)
  • FAN3: /sys/bus/i2c/devices/13-0050/ (I²C Bus 13, Address 0x50)
  • FAN4: /sys/bus/i2c/devices/14-0050/ (I²C Bus 14, Address 0x50)