freebsd-skq/sys/dev/mps
Kenneth D. Merry 8881681b24 Disable T10 Protection Information / EEDP handling for type 2 protection.
The mps(4) and mpr(4) drivers and hardware handle T10 Protection
Information, which is a system of checksums and guard blocks to protect
data while it is being transferred and while it is on disk.  It is also
known as T10 DIF.  For more details, see section 4.22 of the SBC-4 spec.

Supporting Type 2 protection requires using 32 byte CDBs, and filling in
the fields in those CDBs.  We don't yet support that in the da(4) driver.

Type 1 and Type 3 protection don't require that, and can be handled by
the mps(4)/mpr(4) driver's code and firmware without any additional
input from the da(4) driver.

If a drive has Type 2 protection enabled (you frequently see this with
SAS drives shipped from Dell), don't set the various EEDP fields in the
mps(4)/mpr(4) driver command fields.  Otherwise, you wind up with errors
like this that would otherwise make no sense:

(da9:mpr0:0:18:0): READ(10). CDB: 28 00 00 00 00 00 00 02 00 00
(da9:mpr0:0:18:0): CAM status: SCSI Status Error
(da9:mpr0:0:18:0): SCSI status: Check Condition
(da9:mpr0:0:18:0): SCSI sense: ILLEGAL REQUEST asc:20,0 (Invalid command operation code)
(da9:mpr0:0:18:0):
(da9:mpr0:0:18:0): Field Replaceable Unit: 0
(da9:mpr0:0:18:0): Command Specific Info: 0
(da9:mpr0:0:18:0):
(da9:mpr0:0:18:0): Descriptor 0x80: f8 21
(da9:mpr0:0:18:0): Descriptor 0x81: 00 00 00 00 00 00
(da9:mpr0:0:18:0): Error 22, Unretryable error

In other words, what kind of strange SAS hard drive doesn't support a
standard 10 byte SCSI READ command?  In this case, one that has Type 2
protection enabled.

We can revisit this when we put Type 2 protection support in the da(4)
driver, but for now this will help people who put Type 2 formatted drives
in a system and wonder what in the world is going on.

MFC after:	3 days
Sponsored by:	Spectra Logic
2018-03-23 13:52:26 +00:00
..
mpi sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
mps_config.c sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
mps_ioctl.h sys/dev: further adoption of SPDX licensing ID tags. 2017-11-20 19:36:21 +00:00
mps_mapping.c Revert r327828, r327949, r327953, r328016-r328026, r328041: 2018-01-21 15:42:36 +00:00
mps_mapping.h sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
mps_pci.c sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
mps_sas_lsi.c Fix mps deadlock when handling panic 2018-03-14 21:32:23 +00:00
mps_sas.c Disable T10 Protection Information / EEDP handling for type 2 protection. 2018-03-23 13:52:26 +00:00
mps_sas.h sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
mps_table.c sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
mps_table.h sys/dev: further adoption of SPDX licensing ID tags. 2017-11-27 14:52:40 +00:00
mps_user.c Cache the value of the request and reply frame size since it's used quite 2018-02-06 21:01:38 +00:00
mps.c Implement a sysctl to dump in-flight I/O state for debugging. The tool to 2018-03-12 05:02:22 +00:00
mpsvar.h Fix mps deadlock when handling panic 2018-03-14 21:32:23 +00:00