Activate SATA Link Power Management in OPNsense

From Thomas-Krenn-Wiki
Jump to navigation Jump to search

FreeBSD (and thus also OPNsense) allows to set different settings for the power management of the SATA interface (SATA Link Power Management). In this example we show how enabling SATA Device Initiated Power Management (DIPM) via Tuneable hint.ahcich.0.pm_level = 1 reduces power consumption by about 1 watt.

Configuration options

Under System ‣ Settings ‣ Tunables a new tuneable (hint.ahcich.0.pm_level = 1) can be set. In the "Type" field, this tuneable is marked as "environment".[1][2]

The FreeBSD AHCI driver allows to set different settings for the power management of the SATA interface via the tuneable variable hint.ahcich.X.pm_level. The following configuration options are selectable:[3]

0 - SATA link power management is disabled (default).
1 - SATA device is allowed to initiate PM state change (DIPM - Device Initiated Power Management), host is passive.
2 - Host initiates PARTIAL PM state transition each time port becomes inactive.
3 - Host initiates SLUMBER PM state transition each time port becomes inactive.
4 - The driver initiates the PARTIAL PM state transition 1ms after the port becomes idle.
5 - The driver initiates the SLUMBER PM state transition 125ms after the port becomes inactive.

Example IoT Firewall

With the setting hint.ahcich.0.pm_level=1, the power consumption of the system decreases by about 1 watt, if the SSD supports DIPM
Test setup.
DC3455-4-4-F power supply.

In the following example, a Thomas-Krenn Edge 4L Firewall with the following configuration is used:

  • BIOS version: (information to follow)
  • RAM: 2 GB DDR3
  • SSD: 120 GB ATP A600Sc (AF120GSTIC-T22) with Power Loss Protection
  • Headless operation (no attached monitor, keyboard, mouse) with two active NICs (1 Gbit/s)
  • OS : OPNsense 23.1.9-amd64 / FreeBSD 13.1-RELEASE-p7
    • Default configuration
    • SSH server enabled (LAN port)
    • os-smart plugin and drivedb.h update[4]
  • Ambient temperature: 23.9 - 24.4 °C
  • Power measurement of the whole system using a Christ Electronic CLM1000-Professional Plus connected before the power supply (Delta Electronics ADP-36PH B, 12V / 3A / 36W, Efficency Class VI) of the DC3455-4-4F
hint.ahcich.0.pm_level 120 GB ATP A600Sc SSD

AF120GSTIC-T22

FW T0205B

ATP-AF120GSTIC-T22.jpg

128 GB ATP A600Sv SSD

AT128GSTIC-TM2

FW SBFMT1.3

ATP-AT128GSTIC-TM2.jpg

120 GB ATP A600Sc TM1 mSATA SSD[note 1]

(AF120GSMHI-TM1, FW Q0303B)

System

Idle Power

SSD Temp.

Board (ID 194)

SSD Temp.

Controller (ID 231)

System

Idle Power

System

Idle Power

SSD Temp.

Board (ID 194)

SSD Temp.

Controller (ID 231)

0 5.9 - 7.7 Watt 53 °C 73 °C 5.4 - 7.4 Watt 7.6 - 10.4 Watt 55 °C 63 °C
1 4.6 - 6.8 Watt 44 °C 44 °C 4.6 - 6.4 Watt 6.8 - 9.1 Watt 47 °C 47 °C
2 5.0 - 6.5 Watt 45 °C 45 °C (not tested) (not tested)
3 5.0 - 6.9 Watt 45 °C 45 °C
4 4.9 - 6.2 Watt 45 °C 45 °C
5 5.0 - 6.7 Watt 47 °C 50 °C
Savings at pm_level = 1 ~ 1 Watt ~ 9 °C ~ 29 °C ~ 0.8 - 1 Watt ~ 0.8 - 1 Watt ~ 8 °C ~ 16 °C

Footnote:

  1. Testsystem LES compact 4L, including LTE modem

References

  1. system: name unknown tunables as "environment" (github.com/opnsense/core, 17.07.2023)
  2. Support SATA Link Power Management - savings of ~1 watt (forum.opnsense.org, 22.06.2023)
  3. ahci(4) - FreeBSD Manual Pages (man.freebsd.org)
  4. drivedb.h: Add ATP SATA III SSDs (github.com/smartmontools)


Foto Werner Fischer.jpg

Author: Werner Fischer

Werner Fischer, working in the Knowledge Transfer team at Thomas-Krenn, completed his studies of Computer and Media Security at FH Hagenberg in Austria. He is a regular speaker at many conferences like LinuxTag, OSMC, OSDC, LinuxCon, and author for various IT magazines. In his spare time he enjoys playing the piano and training for a good result at the annual Linz marathon relay.


Related articles

OPNsense does not boot without monitor
OPNsense Software RAID 1 setup
Timecounter HPET frequency 19200000 Hz quality 950