1.\" Copyright (c) 2014 LSI Corp 2.\" All rights reserved. 3.\" Author: Kashyap Desai 4.\" Support: freebsdraid@lsi.com 5.\" 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: 9.\" 1. Redistributions of source code must retain the above copyright 10.\" notice, this list of conditions and the following disclaimer. 11.\" 2. Redistributions in binary form must reproduce the above copyright 12.\" notice, this list of conditions and the following disclaimer in the 13.\" documentation and/or other materials provided with the distribution. 14.\" 3. Neither the name of the <ORGANIZATION> nor the names of its 15.\" contributors may be used to endorse or promote products derived 16.\" from this software without specific prior written permission. 17.\" 18.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 21.\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 22.\" COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 23.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 24.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26.\" CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 28.\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29.\" POSSIBILITY OF SUCH DAMAGE. 30.\" 31.\" The views and conclusions contained in the software and documentation 32.\" are those of the authors and should not be interpreted as representing 33.\" official policies, either expressed or implied, of the FreeBSD Project. 34.\" 35.\" $FreeBSD: head/share/man/man4/mrsas.4 267182 2014-06-06 19:00:43Z joel $ 36.\" 37.Dd June 14, 2014 38.Dt MRSAS 4 39.Os 40.Sh NAME 41.Nm mrsas 42.Nd "LSI MegaRAID 6Gb/s and 12Gb/s SAS+SATA RAID controller driver" 43.Sh SYNOPSIS 44To compile this driver into the kernel, 45place the following lines in your 46kernel configuration file: 47.Bd -ragged -offset indent 48.Cd "device pci" 49.Cd "device mrsas" 50.Ed 51.Pp 52Alternatively, to load the driver as a 53module at boot time, place the following line in 54.Xr loader.conf 5 : 55.Bd -literal -offset indent 56mrsas_load="YES" 57.Ed 58.Sh DESCRIPTION 59The 60.Nm 61driver will detect LSI's next generation (6Gb/s and 12Gb/s) PCI Express 62SAS/SATA RAID controllers. 63See the 64.Nm HARDWARE 65section for the supported devices list. 66A disk (virtual disk/physical disk) attached to the 67.Nm 68driver will be visible to the user through 69.Xr camcontrol 8 70as 71.Pa /dev/da? 72device nodes. 73A simple management interface is also provided on a per-controller basis via the 74.Pa /dev/mrsas? 75device node. 76.Pp 77The 78.Nm 79name is derived from the phrase "MegaRAID SAS HBA", which is 80substantially different than the old "MegaRAID" Driver 81.Xr mfi 4 82which does not connect targets 83to the 84.Xr cam 4 85layer and thus requires a new driver which attaches targets to the 86.Xr cam 4 87layer. 88Older MegaRAID controllers are supported by 89.Xr mfi 4 90and 91.Xr amr 4 92and will not work with 93.Nm , 94but both the 95.Xr mfi 4 96and 97.Nm 98drivers can detect and manage the LSI MegaRAID SAS 2208/2308/3008/3108 series of 99controllers. 100.Pp 101The 102.Xr device.hints 5 103option is provided to tune the 104.Nm 105driver's behavior for LSI MegaRAID SAS 2208/2308/3008/3108 controllers. 106By default, the 107.Xr mfi 4 108driver will detect these controllers. 109See the 110.Nm PRIORITY 111section to know more about driver priority for MR-Fusion devices. 112.Pp 113.Nm 114will provide a priority of (-30) (between 115.Dv BUS_PROBE_DEFAULT 116and 117.Dv BUS_PROBE_LOW_PRIORITY ) 118at probe call for device id's 0x005B, 0x005D, and 1190x005F so that 120.Nm 121does not take control of these devices without user intervention. 122.Sh HARDWARE 123The 124.Nm 125driver supports the following hardware: 126.Pp 127[ Thunderbolt 6Gb/s MR controller ] 128.Bl -bullet -compact 129.It 130LSI MegaRAID SAS 9265 131.It 132LSI MegaRAID SAS 9266 133.It 134LSI MegaRAID SAS 9267 135.It 136LSI MegaRAID SAS 9270 137.It 138LSI MegaRAID SAS 9271 139.It 140LSI MegaRAID SAS 9272 141.It 142LSI MegaRAID SAS 9285 143.It 144LSI MegaRAID SAS 9286 145.It 146DELL PERC H810 147.It 148DELL PERC H710/P 149.El 150.Pp 151[ Invader/Fury 12Gb/s MR controller ] 152.Bl -bullet -compact 153.It 154LSI MegaRAID SAS 9380 155.It 156LSI MegaRAID SAS 9361 157.It 158LSI MegaRAID SAS 9341 159.It 160DELL PERC H830 161.It 162DELL PERC H730/P 163.It 164DELL PERC H330 165.El 166.Sh CONFIGURATION 167By default, the driver will use MSI if it is supported. 168This behavior can be turned off by setting the following tunable value in 169.Xr loader.conf 5 : 170.Bd -literal -offset indent 171hw.mrsas.msi.enable=0 172.Ed 173.Pp 174To disable Online Controller Reset(OCR) for a specific 175.Nm 176driver instance, set the 177following tunable value in 178.Xr loader.conf 5 : 179.Bd -literal -offset indent 180hw.mrsasX.disable_ocr=1 181.Ed 182.Pp 183where X is the adapter number. 184.Pp 185To change the I/O timeout value for a specific 186.Nm 187driver instance, set the following tunable value in 188.Xr loader.conf 5 : 189.Bd -literal -offset indent 190hw.mrsasX.mrsas_io_timeout=NNNNNN 191.Ed 192.Pp 193where NNNNNN is the timeout value in milli-seconds. 194.Pp 195To change the firmware fault check timer value for a specific 196.Nm 197driver instance, set the following tunable value in 198.Xr loader.conf 5 : 199.Bd -literal -offset indent 200hw.mrsasX.mrsas_fw_fault_check_delay=NN 201.Ed 202.Pp 203where NN is the fault check delay value in seconds. 204.Pp 205The current number of active I/O commands is shown in the 206.Va hw.mrsasX.fw_outstanding 207.Xr sysctl 8 208variable. 209.Sh DEBUGGING 210To enable debugging prints from the 211.Nm 212driver, set the 213.Va hw.mrsas.X.debug_level 214variable, where X is the adapter number, either in 215.Xr loader.conf 5 216or via 217.Xr sysctl 8 . 218The following bits have the described effects: 219.Pp 220.Bl -tag -width "0x01" -offset indent -compact 221.It 0x01 222Enable informational prints. 223.It 0x02 224Enable tracing prints. 225.It 0x04 226Enable prints for driver faults. 227.It 0x08 228Enable prints for OCR and I/O timeout. 229.It 0x10 230Enable prints for AEN events. 231.El 232.Sh PRIORITY 233The 234.Nm 235driver will always set a default (-30) priority in the PCI subsystem for 236selection of MR-Fusion cards. 237(It is between 238.Dv BUS_PROBE_DEFAULT 239and 240.Dv BUS_PROBE_LOW_PRIORITY ) . 241MR-Fusion Controllers include all cards with the 242Device IDs - 2430x005B, 2440x005D, 2450x005F. 246.Pp 247The 248.Xr mfi 4 249driver will set a priority of either 250.Dv BUS_PROBE_DEFAULT 251or 252.Dv BUS_PROBE_LOW_PRIORITY 253(depending on the device.hints setting) in the PCI 254subsystem for selection of MR-Fusion cards. 255With the above design in place, the 256.Xr mfi 4 257driver will attach to a MR-Fusion card given that it has a higher priority than 258.Nm . 259.Pp 260Using 261.Pa /boot/device.hints 262(as mentioned below), the user can provide a preference 263for the 264.Nm 265driver to detect a MR-Fusion card instead of the 266.Xr mfi 4 267driver. 268.Bd -ragged -offset indent 269.Cd hw.mfi.mrsas_enable="1" 270.Ed 271.Pp 272At boot time, the 273.Xr mfi 4 274driver will get priority to detect MR-Fusion controllers by default. 275Before 276changing this default driver selection policy, LSI advises users to understand 277how the driver selection policy works. 278LSI's policy is to provide priority to 279the 280.Xr mfi 4 281driver to detect MR-Fusion cards, but allow for the ability to choose the 282.Nm 283driver to detect MR-Fusion cards. 284.Pp 285LSI recommends setting hw.mfi.mrsas_enable="0" for customers who are using the 286older 287.Xr mfi 4 288driver and do not want to switch to 289.Nm . 290For those customers who are using a MR-Fusion controller for the first time, LSI 291recommends using the 292.Nm 293driver and setting hw.mfi.mrsas_enable="1". 294.Pp 295Changing the default behavior is well tested under most conditions, but 296unexpected behavior may pop up if more complex and unrealistic operations are 297executed by switching between the 298.Xr mfi 4 299and 300.Nm 301drivers for MR-Fusion. 302Switching drivers is designed to happen only one time. 303Although multiple 304switching is possible, it is not recommended. 305The user should decide from 306.Nm Start of Day 307which driver they want to use for the MR-Fusion card. 308.Pp 309The user may see different device names when switching from 310.Xr mfi 4 311to 312.Nm . 313This behavior is 314.Nm Functions As Designed 315and the user needs to change the 316.Xr fstab 5 317entry manually if they are doing any experiments with 318.Xr mfi 4 319and 320.Nm 321interoperability. 322.Sh FILES 323.Bl -tag -width ".Pa /dev/mrsas?" -compact 324.It Pa /dev/da? 325array/logical disk interface 326.It Pa /dev/mrsas? 327management interface 328.El 329.Sh SEE ALSO 330.Xr amr 4 , 331.Xr cam 4 , 332.Xr mfi 4 , 333.Xr pci 4 , 334.Xr device.hints 5 , 335.Xr camcontrol 8 336.Sh HISTORY 337The 338.Nm 339driver first appeared in 340.Fx 10.1 341and was ported to 342.Dx 3.9 . 343.Bd -ragged 344.Cd "mfi Driver:" 345.Xr mfi 4 346is the old 347.Fx 348driver which started with support for Gen-1 Controllers and 349was extended to support up to MR-Fusion (Device ID = 0x005B, 0x005D, 0x005F). 350.Ed 351.Bd -ragged 352.Cd "mrsas Driver:" 353.Nm 354is the new driver reworked by LSI which supports Thunderbolt and onward 355products. 356The SAS+SATA RAID controller with device id 0x005b is referred to as 357the Thunderbolt controller throughout this man page. 358.Ed 359.Bd -ragged 360.Nm cam aware HBA drivers: 361.Fx 362has a 363.Xr cam 4 364layer which attaches storage devices and provides a common access mechanism to 365storage controllers and attached devices. 366The 367.Nm 368driver is 369.Xr cam 4 370aware and devices associated with 371.Nm 372can be seen using 373.Xr camcontrol 8 . 374The 375.Xr mfi 4 376driver does not understand the 377.Xr cam 4 378layer and it directly associates storage disks to the block layer. 379.Pp 380.Nm Thunderbolt Controller: 381This is the 6Gb/s MegaRAID HBA card which has device id 0x005B. 382.Pp 383.Nm Invader Controller: 384This is 12Gb/s MegaRAID HBA card which has device id 0x005D. 385.Pp 386.Nm Fury Controller: 387This is the 12Gb/s MegaRAID HBA card which has device id 0x005F. 388.Ed 389.Sh AUTHORS 390The 391.Nm 392driver and this manual page were written by 393.An Kashyap Desai Aq Mt Kashyap.Desai@lsi.com . 394It was ported to 395.Dx 396by 397.An Sascha Wildner Aq Mt swildner@dragonflybsd.org . 398.Sh TODO 399.\"The driver does not support big-endian architectures at this time. 400.\".Pp 401The driver does not support alias for device name (it is required when the user 402switches between two drivers and does not want to edit 403.Pa /etc/fstab 404manually for 405.Pa /dev/mfid? 406device nodes). 407It is recommended to use the approriate device nodes in 408.Pa /dev/serno 409instead. 410They should be available for all controllers supported by 411.Nm . 412.Pp 413The 414.Nm 415driver exposes devices as 416.Pa /dev/da? , 417whereas 418.Xr mfi 4 419exposes devices as 420.Pa /dev/mfid? . 421.Pp 422.Nm 423does not support the Linux Emulator interface. 424.Pp 425.Nm 426will not work with 427.Xr mfiutil 8 . 428