Multipath I/O now supports extended storage request blocks
- Servers – Windows Server 2012
In Windows Server 2012, a new structure, the STORAGE_REQUEST_BLOCK (extended SRB) replaces the SCSI_REQUEST_BLOCK (legacy SRB) in the core storage stack. Extended SRBs replicate the functionality of the legacy SRBs, but are also extensible and scalable.
Multipath I/O (MPIO) supports extended SRBs and allows Device Specific Modules (DSMs) to specify extended SRB support as well. However, in order for a multipath device’s storage stack to use extended SRBs, all components in the stack must support extended SRBs, including the DSM. Note that the Microsoft in-box DSM, MSDSM, does support extended SRBs.
The SCSI_PASS_THROUGH_EX structure is not part of the extended MPIO pass through structure since the extended SCSI pass through can be of a variable size, depending on the command line debugger (CDB). Instead, the extended MPIO pass through has a field that describes the offset from the beginning of the extended MPIO pass through structure to the SCSI_PASS_THROUGH_EX structure. The caller must make sure they allocate a buffer of the appropriate size and set the SCSI pass through offset correctly. As long as the caller follows the rules for extended SCSI pass-throughs, then there should not be any extra work for them to use the extended MPIO pass through.
Note If the DSM does not support extended SRBs, MPIO will fail extended MPIO pass through requests that have the MPIO_IOCTL_FLAG_INVOLVE_DSM flag set.
If any part of the device’s storage stack, including DSM, does not support extended SRBs, the storage stack will revert to using legacy SRBs.
There are only two MPIO requirements for a DSM to support STORAGE_REQUEST_BLOCKS:
- The DSM must report its type as DsmType6
- The DSM must provide the DSM_ADDRESS_TYPE_SUPPORTED function
If the DSM does not report DsmType6 or if it reports DsmType6 but does not provide the DSM_ADDRESS_TYPE_SUPPORTED function, MPIO will assume the DSM does not support extended SRBs.
The DSM_ADDRESS_TYPE_SUPPORTED function accepts two parameters, one of which is an address type. This address type must be one of the STORAGE_ADDRESS_TYPE_* values defined in srb.h. The DSM must return TRUE if it supports the given address type and FALSE if it does not. The definition of “support” is ultimately up to the DSM. MPIO uses this function to ensure that the DSM will not misbehave if it is handed an extended SRB with a STOR_ADDRESS structure of the given type. As such, MPIO generally calls this function when a multipath device is being enumerated, but the function could be called at any time.
If a DSM never touches an extended SRB’s STOR_ADDRESS, then it can return TRUE for any valid STORAGE_ADDRESS_TYPE_* value. Review the sample DSM in the WDK.
Other important notes
- DSMs that support extended SRBs must be able to handle both SCSI_REQUEST_BLOCK structures and STORAGE_REQUEST_BLOCK structures. Just because a DSM reports that it supports extended SRBs does not mean that it will exclusively receive extended SRBs. It may still receive any number of legacy SRBs in addition to extended SRBs, and therefore must be able to handle both.
- We have provided a header file in the WDK called srbhelper.h that contains inline functions to help drivers that must handle both extended and legacy SRBs. Our sample DSM uses this header so you can use it as an example of how to use these functions.
- A DSM that does not support extended SRBs will never have to handle extended SRBs.
- It’s possible that a MPIO will cause the storage stack to fall back on legacy SRBs in the event that the DSM does not support a given STORAGE_ADDRESS_TYPE_* (but otherwise supports extended SRBs).
- “BTL8” is the only STORAGE_ADDRESS_TYPE_*currently defined for Windows Server 2012.