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