What is DIF/DIX (also known as PI)? Does Red Hat support it?

Solution Unverified - Updated -


  • Red Hat Enterprise Linux, various versions
  • Data Integrity Field / Data Integrity Extension (DIF/DIX)


  • What is DIF/DIX (also known as PI)? Does Red Hat support it?


DIF is a new feature recently added to the SCSI Standard. It adds 8 bytes to the end of each sector on disk.

↓byte       7        6         5         4         3         2         1         0
  0    |                                                                              |
       +---                                                                        ---+
       :                                  User Data                                   :
       +---                                                                        ---+
 n-1   |                                                                              | where n=512|4096
  n    | (msb)                                                                        |
       +--------          Logical Block Guard (CRC16 e.g.)                   ---------+
 n+1   |                                                                        (lsb) |
 n+2   | (msb)                                                                        |
       +--------          Logical Block Application Tag                      ---------+
 n+3   |                                                                        (lsb) |
 n+4   |                                                                              |
       +---                                                                        ---+
       :                  Logical Block Reference Tag                                 :
       +---                                                                        ---+
 n+7   |                                                                              | 

It increases the size of the commonly-used 512-byte disk block from 512 to 520 bytes. The extra bytes comprise the Data Integrity Field (DIF). The basic idea is that the HBA will calculate a checksum value for the data block on writes, and store it in the DIF. The storage device will confirm the checksum on receive, and store the data plus checksum. On a read, the checksum will be checked by the storage device and by the receiving HBA.

The Data Integrity Extension (DIX) allows this check to move up the stack: the application calculates the checksum and passes it to the HBA, to be appended to the 512 byte data block. This provides a full end-to-end data integrity check.


Some vendors have adopted the name Protection Information (PI) to refer to the DIF/DIX functionality. There is one difficulty associated with DIF/DIX on Linux - the memory management system may change the data buffer while it is queued for a write. If it does this, then the memory management system must remember to keep that page marked dirty after the I/O succeeds. If the memory management system changes the data in the buffer after the checksum is calculated, but before the write is done, then the checksum test will fail, the write will fail, and the filesystem will go read-only, or some similar failure will occur.

Because of this, users of Red Hat Enterprise Linux 6 should note the following: The DIF/DIX hardware checksum feature must only be used with applications that exclusively issue O_DIRECT I/O. These applications may use the raw block device, or the XFS file system in O_DIRECT mode. (XFS is the only filesystem that does not fall back to buffered IO when doing certain allocation operations). Only applications designed for use with O_DIRECT I/O and DIF/DIX hardware should enable this feature.

DIF/DIX is a Tech Preview in RHEL 6.0 and later. There are currently just two driver/hba combinations that have this support: Emulex lpfc and LSI mpt2sas. There are just a few storage vendors who support it: the Netapp Engenio FC RAID array, FUJITSU ETERNUS Storage system, and certain Hitachi SAS disks. We expect additional storage vendors to support this feature in the future.


DIF/DIX is fully supported in RHEL 7.6 and later, provided that the hardware vendor has qualified it and provides full support for the particular HBA and storage array configuration it is connected to on RHEL. Contact your storage vendor for determination if the HBA/storage combination has been tested and fully supported on RHEL 7.6 or later. DIF/DIX is not supported on other configurations. It is not supported for use on the boot device, and it is not supported on virtualized guests. Red Hat does not support using ASMLib when DIF/DIX is enabled. DIF/DIX is enabled/disabled at the storage device, which involves various layers up to (and including) the application. The method for activating DIF on storage devices is device-dependent.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.


In a case of RHEL6 if we need to disable DIF/DIX support what should we need to do?

You should disable the DIF/DIX attribute for the LUN on the storage device. This would be storage array dependent.

There is a sysfs parameter "protection_type" for the scsi_disk object, which if set to 0 (e.g. echo "0" > {sysfs node}) will disable the use of the READ_32/WRITE_32 commands with the protection information, but this does not stop the block layer code from computing the checksums, and I'm not sure the storage device would even accept non-DIF/DIX commands on a DIF/DIX LUN. If it did, write operations would not update the tags properly. If the device was later used with DIF/DIX enabled on the host, errors would likely result (unless the exact same sectors were overwritten).

When the storage device is configured as non-DIF/DIX, the LUN attributes reported to the SCSI layer cause everything to be configured properly at device scan time.

Do any of the Redhat kernels support DIX (PI data stored in a separate buffer? I thought the linux kernel did not support DIX and only supported DIF mode. The text above seems to consider both DIF and DIX as the same thing which is not the case.

I think the kbase tries to separate DIF and DIX. Both are supported on rhel7.6 and later, if the involved storage vendor has qualified/tested it, as per above. So that means that from Linux kernel side, we have tested DIF/DIX, which also includes DIX (using extra checksum to ensure the data moves through all layers) from the kernel side. To then declare it supported, it needs to be tested together with the storage vendor, I know that we have run through this with at least one.