Reading Sensors - UG1739

AMD Solarflare X4 Series Ethernet Adapter User Guide (UG1739)

Document ID
UG1739
Release Date
2025-10-24
Revision
1.0 English

X4 series adapters have various sensors for temperature, voltage and currents. Their values are output using standard Linux conventions:

  • The sensors command provides a formatted view of the values
  • Alternatively, you can access the raw values via the filesystem.

Using the sensors command

For a formatted view of the sensor values, use the sensors command from the lm_sensors package.

If the package is not already installed:

# yum install lm_sensors

By default, the sensors command shows sensors for all cores and other devices. By filtering its output you can get a list of all cores and devices in its output:

$ sensors | awk 'NF==1 {print}'

or a list of all adapters using the AMD Solarflare sfc driver:

$ sensors | grep sfc
sfc-pci-0400
sfc-pci-0401

Then, to get output for a specific adapter such as sfc-pci-0400:

# sensors sfc-pci-0400
sfc-pci-0400
Adapter: PCI adapter
1.2V supply:      N/A
3.3V supply:     +3.22 V (min = +3.00 V, max = +3.60 V)
12.0V supply:     +12.14 V (min = +11.04 V, max = +12.96 V)
0.9V supply (ext. ADC):   +1.03 V (min = +0.50 V, max = +1.10 V)
                                         (crit max = +1.15 V)
0.9V phase A supply:    N/A
PHY overcurrent:     N/A
ERROR: Can't get value of subfeature temp1_alarm: Can't read
PHY temp.:       N/A
AOE FPGA temp.:     +68.0°C (low = +0.0°C, high = +95.0°C)
                                         (crit = +105.0°C)
Ambient temp.:     +56.0°C (low = +0.0°C, high = +75.0°C)
                                         (crit = +85.0°C)
Controller die (TDIODE) temp.: +77.0°C (low = +0.0°C, high = +95.0°C)
                                         (crit = +105.0°C)
Board front temp.:    +59.0°C (low = +0.0°C, high = +75.0°C)
                                         (crit = +85.0°C)
Board back temp.:    +62.0°C (low = +0.0°C, high = +75.0°C)
                                         (crit = +85.0°C)
1.2V supply current:    N/A
0.9V phase A supply current:  N/A
3.3V supply current:    N/A
12V supply current:     N/A

Using the filesystem

Sensors for Linux devices output their values into the /sys/class/hwmon hierarchy, in a directory named /sys/class/hwmon/hwmon<n>/device.

To determine which of the hwmon<n>/device directories contain sensor data from AMD Solarflare adapters, search for a driver file within the directory that is a soft link to the sfc driver:

$ ls -l /sys/class/hwmon/*/device/driver | egrep sfc\$
lrwxrwxrwx 1 root root 0 Mar 20 10:43 /sys/class/hwmon/hwmon1/device/driver -> ../../../../bus/pci/drivers/sfc
lrwxrwxrwx 1 root root 0 Mar 20 10:43 /sys/class/hwmon/hwmon2/device/driver -> ../../../../bus/pci/drivers/sfc

So in the above example, the /sys/class/hwmon/hwmon1/device and /sys/class/hwmon/hwmon2/device directories contain sensor data from AMD Solarflare adapters.

Within these directories, each sensor has the following files:

  • <sensor>_label contains a description of the sensor
  • <sensor>_input contains the current value of the sensor, in thousandths of the base unit (°C, V or A)
  • <sensor>_max contains the maximum value for the sensor, in thousandths of the base unit (°C, V or A)
  • <sensor>_min contains the minimum value for the sensor, in thousandths of the base unit (°C, V or A)
  • <sensor>_crit contains the critical maximum value of the sensor, in thousandths of the base unit (°C, V or A)
  • <sensor>_alarm contains 1 if an alarm condition exists for the sensor, else 0.

Read these files to get the data. For example:

$ cd /sys/class/hwmon/hwmon1/device
$ for file in temp4_*; do echo -en "${file}:\t" ; cat ${file}; done
temp4_alarm: 0
temp4_crit:  85000
temp4_input: 56000
temp4_label: Ambient temp.
temp4_max:  75000
temp4_min:  0

In the above example, the ambient temperature is currently 56°C.