MPS(4)

πŸ’– MPS(4) πŸ’–

okay bestie, pull up a chair, we're talking about mps β€” the LSI Fusion-MPT 2 IT/IR 6Gb/s Serial Attached SCSI/SATA driver. That's the whole vibe. Kernel interfaces manual, section 4. Let's get into it. πŸ¦‹


✨ SYNOPSIS ✨

So you wanna bake this driver into your kernel? Slip these little lines into your kernel configuration file:

device pci
device scbus
device mps

Orrrr if you'd rather just load it as a module at boot time (which, honestly, so valid), pop this line into loader.conf(5):

mps_load="YES"

🌸 DESCRIPTION 🌸

The mps driver literally provides support for Broadcom Ltd./Avago Tech (LSI) Fusion-MPT 2 IT/IR SAS controllers and WarpDrive solid state storage cards. two for one, we love to see it πŸ’…


πŸŽ€ HARDWARE πŸŽ€

These controllers are supported by the mps driver, no cap:

  • Broadcom Ltd./Avago Tech (LSI) SAS 2004 (4 Port SAS)
  • Broadcom Ltd./Avago Tech (LSI) SAS 2008 (8 Port SAS)
  • Broadcom Ltd./Avago Tech (LSI) SAS 2108 (8 Port SAS)
  • Broadcom Ltd./Avago Tech (LSI) SAS 2116 (16 Port SAS)
  • Broadcom Ltd./Avago Tech (LSI) SAS 2208 (8 Port SAS)
  • Broadcom Ltd./Avago Tech (LSI) SAS 2308 (8 Port SAS)
  • Broadcom Ltd./Avago Tech (LSI) SSS6200 Solid State Storage
  • Intel Integrated RAID Module RMS25JB040
  • Intel Integrated RAID Module RMS25JB080
  • Intel Integrated RAID Module RMS25KB040
  • Intel Integrated RAID Module RMS25KB080

look at that lineup. iconic behavior fr fr ⭐


πŸ’œ CONFIGURATION πŸ’œ

Quick glossary bestie: in every single tunable description down below, X represents the adapter number. Remember it. Live it. Love it.

🧚 Interrupts (MSI / MSI-X)

Want MSI interrupts OFF for all the mps instances? Set this tunable in loader.conf(5):

hw.mps.disable_msi=1

Want MSI interrupts off for just one specific instance? Set this in loader.conf(5):

dev.mps.X.disable_msi=1

Now the MSI-X version β€” all instances:

hw.mps.disable_msix=1

And MSI-X for one specific instance:

dev.mps.X.disable_msix=1

πŸ”— DMA Chains

To set the max number of DMA chains allocated for all adapters:

hw.mps.max_chains=NNNN

For one specific adapter:

dev.mps.X.max_chains=NNNN

The default max_chains value is 16384.

And here's your little sysctl(8) dashboard, bestie:

  • The current number of free chain frames lives in the dev.mps.X.chain_free sysctl(8) variable.
  • The lowest number of free chain frames seen since boot lives in the dev.mps.X.chain_free_lowwater sysctl(8) variable.
  • The number of times that chain frame allocations have failed since boot lives in the dev.mps.X.chain_alloc_fail sysctl(8) variable. Use this one to figure out whether you should bump the max_chains tunable up to help performance.
  • The current number of active I/O commands is shown in the dev.mps.X.io_cmds_active sysctl(8) variable.

πŸ“„ I/O Pages

Max number of pages used per I/O, all adapters:

hw.mps.max_io_pages=NNNN

For one specific adapter:

dev.mps.X.max_io_pages=NNNN

The default max_io_pages value is -1, which means the maximum I/O size used per I/O gets calculated using the IOCFacts values stored in the controller. The lowest value the driver will use for max_io_pages is 1 β€” otherwise IOCFacts gets used to calculate the max I/O size. And whichever I/O size is smaller, the one from max_io_pages or the one from IOCFacts, that's the max I/O size the driver uses. the smaller one wins. periodt.

Oh and also β€” the highest number of active I/O commands seen since boot is stored in the dev.mps.X.io_cmds_highwater sysctl(8) variable. πŸ‘‘

πŸ™ˆ Excluding Devices

Devices can be excluded from mps control for all adapters by setting this tunable in loader.conf(5):

hw.mps.exclude_ids=Y

Y represents the target ID of the device. If you're excluding more than one device, separate the target IDs with commas.

Same thing, but for one specific adapter:

dev.mps.X.exclude_ids=Y

Again, Y is the target ID of the device, and multiple target IDs get separated by commas. πŸ’…

πŸ”Œ StartStopUnit (SSU) on Shutdown

Okay so here's the deal: the adapter can issue the StartStopUnit SCSI command to SATA direct-access devices during shutdown, which lets the device quiesce while powering down. πŸ¦‹

To control this feature for all adapters, set the

hw.mps.enable_ssu

tunable in loader.conf(5) to one of these values:

  • 0 β€” Do not send SSU to either HDDs or SSDs.
  • 1 β€” Send SSU to SSDs, but not to HDDs. This is the default value.
  • 2 β€” Send SSU to HDDs, but not to SSDs.
  • 3 β€” Send SSU to both HDDs and SSDs.

To control this feature for one specific adapter, set this tunable value in loader.conf(5):

dev.mps.X.enable_ssu

The same set of values are valid as when setting this tunable for all adapters. same menu, smaller table.

⏳ Spinup Wait Time

Real talk: SATA disks that take several seconds to spin up and then fail the SATA Identify command might not get discovered by the driver. 😭 Sometimes you can overcome this by increasing the value of the spinup wait time in loader.conf(5) with the

hw.mps.spinup_wait_time=NNNN

tunable. Here, NNNN represents the number of seconds to wait for SATA devices to spin up when the device fails the initial SATA Identify command.

Spinup wait times can be set for specific adapters in loader.conf(5) with the

dev.mps.X.spinup_wait_time=NNNN

tunable. NNNN is the number of seconds to wait for SATA devices to spin up when they fail the initial SATA Identify command. 🫢

πŸ—ΊοΈ Phy Number Device Mapping

Okay this one's a whole saga, stay with me bestie.

The driver can map devices discovered by the adapter so that target IDs corresponding to a specific device persist across resets and reboots. ✨ But in some cases, it's possible for devices to lose their mapped IDs due to unexpected behavior from certain hardware β€” like some types of enclosures.

To overcome this problem, a tunable is provided that will force the driver to map devices using the Phy number associated with the device.

⚠️ This feature is not recommended if the topology includes multiple enclosures/expanders. If multiple enclosures/expanders are present in the topology, Phy numbers are repeated, causing all devices at these Phy numbers except the first device to fail enumeration. no cap, that's bad. πŸ’€

To control this feature for all adapters, set the

hw.mps.use_phy_num

tunable in loader.conf(5) to one of these values:

  • -1 β€” Only use Phy numbers to map devices and bypass the driver's mapping logic.
  • 0 β€” Never use Phy numbers to map devices.
  • 1 β€” Use Phy numbers to map devices, but only if the driver's mapping logic fails to map the device that is being enumerated. This is the default value.

To control this feature for one specific adapter, set this tunable value in loader.conf(5):

dev.mps.X.use_phy_num

The same set of values are valid as when setting this tunable for all adapters. πŸ’…


πŸ› DEBUGGING πŸ›

Driver diagnostic printing is controlled in loader.conf(5) by using the global hw.mps.debug_level and per-device dev.mps.X.debug_level tunables. And you can alter the debug level for any adapter at run-time using the sysctl(8) variable dev.mps.X.debug_level. πŸ”₯

Now, all debug_level variables can be named by either an integer value or a text string. Multiple values can be specified together by either ORing the integer values or by providing a comma-separated list of names.

And here's the cute part: a text string prefixed by + adds the specified debug levels to the existing set, while the prefix - removes them from the existing set. The current debug_level status is reported in both formats for convenience. πŸŽ€

The following levels are available:

  • 0x0001 β€” info β€” Basic information (enabled by default)
  • 0x0002 β€” fault β€” Driver faults (enabled by default)
  • 0x0004 β€” event β€” Controller events
  • 0x0008 β€” log β€” Logging data from controller
  • 0x0010 β€” recovery β€” Tracing of recovery operations
  • 0x0020 β€” error β€” Parameter errors and programming bugs
  • 0x0040 β€” init β€” System initialization operations
  • 0x0080 β€” xinfo β€” More detailed information
  • 0x0100 β€” user β€” Tracing of user-generated commands (IOCTL)
  • 0x0200 β€” mapping β€” Tracing of device mapping
  • 0x0400 β€” trace β€” Tracing through driver functions

eleven whole levels. we are SO spoiled. 🌈


πŸ‘€ SEE ALSO πŸ‘€

cam(4), cd(4), ch(4), da(4), mpr(4), mpt(4), pci(4), sa(4), scsi(4), targ(4), loader.conf(5), sysctl(8)

go read them. for me. 🫢


πŸ“œ HISTORY πŸ“œ

The mps driver first appeared in FreeBSD 9.0. ⭐


πŸ’– AUTHORS πŸ’–

The mps driver was originally written by Scott Long <scottl@FreeBSD.org>. It has been improved and tested by LSI Corporation, Avago Technologies (formally LSI), and Broadcom Ltd. (formally Avago).

This man page was written by Ken Merry <ken@FreeBSD.org> with additional input from Stephen McConnell <slm@FreeBSD.org>.

shoutout to the whole team, we appreciate you. πŸ’œ


and that's the whole page, bestie!! this one came from the Debian crew, dated June 1, 2019, and it's the MPS(4) page through and through. go forth and slay your SAS controllers. πŸ’…βœ¨πŸ¦‹πŸŽ€

πŸ“¦ where this page comes from