1.\" 2.\" Copyright (c) 2010 Spectra Logic Corporation 3.\" Copyright (c) 2014 LSI Corp 4.\" Copyright (c) 2015-2017 Avago Technologies 5.\" Copyright (c) 2015-2017 Broadcom Ltd. 6.\" All rights reserved. 7.\" 8.\" Redistribution and use in source and binary forms, with or without 9.\" modification, are permitted provided that the following conditions 10.\" are met: 11.\" 1. Redistributions of source code must retain the above copyright 12.\" notice, this list of conditions, and the following disclaimer, 13.\" without modification. 14.\" 2. Redistributions in binary form must reproduce at minimum a disclaimer 15.\" substantially similar to the "NO WARRANTY" disclaimer below 16.\" ("Disclaimer") and any redistribution must be conditioned upon 17.\" including a substantially similar Disclaimer requirement for further 18.\" binary redistribution. 19.\" 20.\" NO WARRANTY 21.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR 24.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25.\" HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 29.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 30.\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31.\" POSSIBILITY OF SUCH DAMAGES. 32.\" 33.\" mpr driver man page. 34.\" 35.\" Author: Ken Merry <ken@FreeBSD.org> 36.\" Author: Stephen McConnell <slm@FreeBSD.org> 37.\" 38.\" $Id$ 39.\" $FreeBSD$ 40.\" 41.Dd June 1, 2019 42.Dt MPR 4 43.Os 44.Sh NAME 45.Nm mpr 46.Nd "LSI Fusion-MPT 3/3.5 IT/IR 12Gb/s Serial Attached SCSI/SATA/PCIe driver" 47.Sh SYNOPSIS 48To compile this driver into the kernel, place these lines in the kernel 49configuration file: 50.Bd -ragged -offset indent 51.Cd "device pci" 52.Cd "device scbus" 53.Cd "device mpr" 54.Ed 55.Pp 56The driver can be loaded as a module at boot time by placing this line in 57.Xr loader.conf 5 : 58.Bd -literal -offset indent 59mpr_load="YES" 60.Ed 61.Sh DESCRIPTION 62The 63.Nm 64driver provides support for Broadcom Ltd./Avago Tech (LSI) 65Fusion-MPT 3/3.5 IT/IR 66.Tn SAS/PCIe 67controllers. 68.Sh HARDWARE 69These controllers are supported by the 70.Nm 71driver: 72.Pp 73.Bl -bullet -compact 74.It 75Broadcom Ltd./Avago Tech (LSI) SAS 3004 (4 Port SAS) 76.It 77Broadcom Ltd./Avago Tech (LSI) SAS 3008 (8 Port SAS) 78.It 79Broadcom Ltd./Avago Tech (LSI) SAS 3108 (8 Port SAS) 80.It 81Broadcom Ltd./Avago Tech (LSI) SAS 3216 (16 Port SAS) 82.It 83Broadcom Ltd./Avago Tech (LSI) SAS 3224 (24 Port SAS) 84.It 85Broadcom Ltd./Avago Tech (LSI) SAS 3316 (16 Port SAS) 86.It 87Broadcom Ltd./Avago Tech (LSI) SAS 3324 (24 Port SAS) 88.It 89Broadcom Ltd./Avago Tech (LSI) SAS 3408 (8 Port SAS/PCIe) 90.It 91Broadcom Ltd./Avago Tech (LSI) SAS 3416 (16 Port SAS/PCIe) 92.It 93Broadcom Ltd./Avago Tech (LSI) SAS 3508 (8 Port SAS/PCIe) 94.It 95Broadcom Ltd./Avago Tech (LSI) SAS 3516 (16 Port SAS/PCIe) 96.It 97Broadcom Ltd./Avago Tech (LSI) SAS 3616 (16 Port SAS/PCIe) 98.It 99Broadcom Ltd./Avago Tech (LSI) SAS 3708 (8 Port SAS/PCIe) 100.It 101Broadcom Ltd./Avago Tech (LSI) SAS 3716 (16 Port SAS/PCIe) 102.El 103.Sh CONFIGURATION 104In all tunable descriptions below, X represents the adapter number. 105.Pp 106To disable MSI interrupts for all 107.Nm 108driver instances, set this tunable value in 109.Xr loader.conf 5 : 110.Bd -literal -offset indent 111hw.mpr.disable_msi=1 112.Ed 113.Pp 114To disable MSI interrupts for a specific 115.Nm 116driver instance, set this tunable value in 117.Xr loader.conf 5 : 118.Bd -literal -offset indent 119dev.mpr.X.disable_msi=1 120.Ed 121.Pp 122To disable MSI-X interrupts for all 123.Nm 124driver instances, set this tunable value in 125.Xr loader.conf 5 : 126.Bd -literal -offset indent 127hw.mpr.disable_msix=1 128.Ed 129.Pp 130To disable MSI-X interrupts for a specific 131.Nm 132driver instance, set this tunable value in 133.Xr loader.conf 5 : 134.Bd -literal -offset indent 135dev.mpr.X.disable_msix=1 136.Ed 137.Pp 138To set the maximum number of DMA chains allocated for all adapters, set 139this tunable in 140.Xr loader.conf 5 : 141.Bd -literal -offset indent 142hw.mpr.max_chains=NNNN 143.Ed 144.Pp 145To set the maximum number of DMA chains allocated for a specific adapter, 146set this tunable in 147.Xr loader.conf 5 : 148.Bd -literal -offset indent 149dev.mpr.X.max_chains=NNNN 150.Ed 151.Pp 152The default max_chains value is 16384. 153.Pp 154The current number of free chain frames is stored in the 155dev.mpr.X.chain_free 156.Xr sysctl 8 157variable. 158.Pp 159The lowest number of free chain frames seen since boot is stored in the 160dev.mpr.X.chain_free_lowwater 161.Xr sysctl 8 162variable. 163.Pp 164The number of times that chain frame allocations have failed since boot is 165stored in the 166dev.mpr.X.chain_alloc_fail 167.Xr sysctl 8 168variable. 169This can be used to determine whether the max_chains tunable should be 170increased to help performance. 171.Pp 172The current number of active I/O commands is shown in the 173dev.mpr.X.io_cmds_active 174.Xr sysctl 8 175variable. 176.Pp 177The current number of free PRP pages is stored in the 178dev.mpr.X.prp_pages_free 179.Xr sysctl 8 180variable. 181PRP pages are used by NVMe devices for I/O transfers, much like Scatter/Gather 182lists. 183.Pp 184The lowest number of free PRP pages seen since boot is stored in the 185dev.mpr.X.prp_pages_free_lowwater 186.Xr sysctl 8 187variable. 188.Pp 189The number of times that PRP page allocations have failed since boot is 190stored in the 191dev.mpr.X.prp_page_alloc_fail 192.Xr sysctl 8 193variable. 194.Pp 195To set the maximum number of pages that will be used per I/O for all adapters, 196set this tunable in 197.Xr loader.conf 5 : 198.Bd -literal -offset indent 199hw.mpr.max_io_pages=NNNN 200.Ed 201.Pp 202To set the maximum number of pages that will be used per I/O for a specific 203adapter, set this tunable in 204.Xr loader.conf 5 : 205.Bd -literal -offset indent 206dev.mpr.X.max_io_pages=NNNN 207.Ed 208.Pp 209The default max_io_pages value is -1, meaning that the maximum I/O size that 210will be used per I/O will be calculated using the IOCFacts values stored in 211the controller. 212The lowest value that the driver will use for max_io_pages is 1, otherwise 213IOCFacts will be used to calculate the maximum I/O size. 214The smaller I/O size calculated from either max_io_pages or IOCFacts will be the 215maximum I/O size used by the driver. 216.Pp 217The highest number of active I/O commands seen since boot is stored in the 218dev.mpr.X.io_cmds_highwater 219.Xr sysctl 8 220variable. 221.Pp 222Devices can be excluded from 223.Nm 224control for all adapters by setting this tunable in 225.Xr loader.conf 5 : 226.Bd -literal -offset indent 227hw.mpr.exclude_ids=Y 228.Ed 229.Pp 230Y represents the target ID of the device. 231If more than one device is to be excluded, target IDs are separated by commas. 232.Pp 233Devices can be excluded from 234.Nm 235control for a specific adapter by setting this tunable in 236.Xr loader.conf 5 : 237.Bd -literal -offset indent 238dev.mpr.X.exclude_ids=Y 239.Ed 240.Pp 241Y represents the target ID of the device. 242If more than one device is to be excluded, target IDs are separated by commas. 243.Pp 244The adapter can issue the 245.Sy StartStopUnit 246SCSI command to SATA direct-access devices during shutdown. 247This allows the device to quiesce powering down. 248To control this feature for all adapters, set the 249.Bd -literal -offset indent 250hw.mpr.enable_ssu 251.Ed 252.Pp 253tunable in 254.Xr loader.conf 5 255to one of these values: 256.Bl -tag -width 6n -offset indent 257.It 0 258Do not send SSU to either HDDs or SSDs. 259.It 1 260Send SSU to SSDs, but not to HDDs. 261This is the default value. 262.It 2 263Send SSU to HDDs, but not to SSDs. 264.It 3 265Send SSU to both HDDs and SSDs. 266.El 267.Pp 268To control this feature for a specific adapter, set this tunable value in 269.Xr loader.conf 5 : 270.Bd -literal -offset indent 271dev.mpr.X.enable_ssu 272.Ed 273.Pp 274The same set of values are valid as when setting this tunable for all adapters. 275.Pp 276SATA disks that take several seconds to spin up and fail the SATA Identify 277command might not be discovered by the driver. 278This problem can sometimes be overcome by increasing the value of the spinup 279wait time in 280.Xr loader.conf 5 281with the 282.Bd -literal -offset indent 283hw.mpr.spinup_wait_time=NNNN 284.Ed 285.Pp 286tunable. 287NNNN represents the number of seconds to wait for SATA devices to spin up when 288the device fails the initial SATA Identify command. 289.Pp 290Spinup wait times can be set for specific adapters in 291.Xr loader.conf 5 : 292with the 293.Bd -literal -offset indent 294dev.mpr.X.spinup_wait_time=NNNN 295.Ed 296.Pp 297tunable. 298NNNN is the number of seconds to wait for SATA devices to spin up when they fail 299the initial SATA Identify command. 300.Pp 301The driver can map devices discovered by the adapter so that target IDs 302corresponding to a specific device persist across resets and reboots. 303In some cases it is possible for devices to lose their mapped IDs due to 304unexpected behavior from certain hardware, such as some types of enclosures. 305To overcome this problem, a tunable is provided that will force the driver to 306map devices using the Phy number associated with the device. 307This feature is not recommended if the topology includes multiple 308enclosures/expanders. 309If multiple enclosures/expanders are present in the topology, Phy numbers are 310repeated, causing all devices at these Phy numbers except the first device to 311fail enumeration. 312To control this feature for all adapters, set the 313.Bd -literal -offset indent 314hw.mpr.use_phy_num 315.Ed 316.Pp 317tunable in 318.Xr loader.conf 5 319to one of these values: 320.Bl -tag -width 6n -offset indent 321.It -1 322Only use Phy numbers to map devices and bypass the driver's mapping logic. 323.It 0 324Never use Phy numbers to map devices. 325.It 1 326Use Phy numbers to map devices, but only if the driver's mapping logic fails 327to map the device that is being enumerated. 328This is the default value. 329.El 330.Pp 331To control this feature for a specific adapter, set this tunable value in 332.Xr loader.conf 5 : 333.Bd -literal -offset indent 334dev.mpr.X.use_phy_num 335.Ed 336.Pp 337The same set of values are valid as when setting this tunable for all adapters. 338.Pp 339.Sh DEBUGGING 340Driver diagnostic printing is controlled in 341.Xr loader.conf 5 342by using the global 343.Va hw.mpr.debug_level 344and per-device 345.Va dev.mpr.X.debug_level 346tunables. 347One can alter the debug level for any adapter at run-time using the 348.Xr sysctl 8 349variable 350.Va dev.mpr.X.debug_level . 351.Pp 352All 353.Va debug_level 354variables can be named by either an integer value or a text string. 355Multiple values can be specified together by either ORing the 356integer values or by providing a comma-separated list of names. 357A text string prefixed by 358.Qq + 359adds the specified debug levels to the existing set, while the prefix 360.Qq - 361removes them from the existing set. 362The current 363.Va debug_level 364status is reported in both formats for convenience. 365The following levels are available: 366.Bl -column "FlagXX" "NameXXXX" "Description" -offset indent 367.It Em Flag Ta Em Name Ta Em Description 368.It 0x0001 Ta info Ta Basic information (enabled by default) 369.It 0x0002 Ta fault Ta Driver faults (enabled by default) 370.It 0x0004 Ta event Ta Controller events 371.It 0x0008 Ta log Ta Logging data from controller 372.It 0x0010 Ta recovery Ta Tracing of recovery operations 373.It 0x0020 Ta error Ta Parameter errors and programming bugs 374.It 0x0040 Ta init Ta System initialization operations 375.It 0x0080 Ta xinfo Ta More detailed information 376.It 0x0100 Ta user Ta Tracing of user-generated commands (IOCTL) 377.It 0x0200 Ta mapping Ta Tracing of device mapping 378.It 0x0400 Ta trace Ta Tracing through driver functions 379.El 380.Sh SEE ALSO 381.Xr cam 4 , 382.Xr cd 4 , 383.Xr ch 4 , 384.Xr da 4 , 385.Xr mps 4 , 386.Xr mpt 4 , 387.Xr pci 4 , 388.Xr sa 4 , 389.Xr scsi 4 , 390.Xr targ 4 , 391.Xr loader.conf 5 , 392.Xr sysctl 8 393.Sh HISTORY 394The 395.Nm 396driver first appeared in 397.Fx 9.3 . 398.Sh AUTHORS 399The 400.Nm 401driver was originally written by 402.An -nosplit 403.An Scott Long Aq Mt scottl@FreeBSD.org . 404It has been improved and tested by LSI Corporation, 405Avago Technologies (formally LSI), and Broadcom Ltd. (formally Avago). 406.Pp 407This man page was written by 408.An Ken Merry Aq Mt ken@FreeBSD.org 409with additional input from 410.An Stephen McConnell Aq Mt slm@FreeBSD.org . 411