The Windows Storage Driver Stack In Depth Storport And The Future Of Windows Storage Bob Griswold Program Manager WDEG Storage Microsoft Corporation.
Download ReportTranscript The Windows Storage Driver Stack In Depth Storport And The Future Of Windows Storage Bob Griswold Program Manager WDEG Storage Microsoft Corporation.
The Windows Storage
Driver Stack In Depth
Storport And The Future Of
Windows Storage
Bob Griswold
Program Manager
WDEG Storage
Microsoft Corporation
Windows Storage Devices
Strategic Pillars
Storage Fabrics
Server/Enterprise
Personal Storage
Client/Consumer
Optical Platform
Client/Consumer
Preferred
Storage Platform
Partner/Customer
Leading platform enabling storage
fabric adoption
Optimized platform features enabling your
Windows experience, here and now
Timely, comprehensive, quality platform
support for optical devices
Preferred platform for developing,
deploying, and using storage devices
Agenda
Windows Storage Port Driver History
Where Storport comes from and why
Storport – the Here and Now
How Storport serves the current customer
Recent Storport changes – investments in
the platform
The future of Storport – near and Far
Windows Vista and Windows Server
codenamed “Longhorn”
Windows Storage Port
Driver History
The birth of a driver
Windows Storage Driver
History
Windows NT and SCSIport, c. 1994
Created a HW-independent SCSI interface
Built for extensibility, features and API
Laid groundwork for future storage ports
Released with Windows NT 3.X
Adaptec, others instrumental in design
SCSIport established baseline for
Storport, USBstor, and ATAport
SCSIport
Old Man SCSI
Extensive customer issue resolution
Security servicing to be continued
Most mature Microsoft storage driver
No Fast Resume support
Queue and reset limitations will not
be considered
No back-porting of Storport features planned
SCSIport EOL planning not started, but…
Prepare for this event – move to Storport sooner
rather than later
SCSIport Minutiae
SCSIport remained *only* solution
for years
Only SPB2Port (IEEE-1394) evolved
All ATA drivers remained “non-extensible”
SCSIport “Chock-full-o-Fixes”
Many specific to particular devices
Original SCSIport was 47 KB
Current SCSIport is 104 KB
Storport – The Here and Now
Windows Server 2003
Original Storport Requirements
API, IOCTL, SRB handling and other “miniport” methods
compatible with SCSIport
Improve on SCSIport with
Better sequential I/O handling
Per Adapter and Per LUN
Expanded queue depth and alignment
Increased outstanding I/O limits
Spin Lock not required between start and completion
Added BuildIo at passive level
Hierarchical Resets and Registry Access
Better miniport integration with
IRQ level handing and queue control (Adapter and LUNs)
Scatter Gather List (SGL) methods
Storport: Right For The Future
The Storport driver model was built on
new code – not from the existing SCSIport
Eliminated forced workarounds and patches
Focus on RAID and I/O Performance
New features and extensions will not be
ported or back-ported into SCSIport
Built with focus on serial storage
Duplex I/O handling, IRQL methods
Built to industry storage specifications
Error handling and hierarchical resets
Equates To Stable Architecture
Device Class
Driver
Device
Class Driver
Better
Error
Handling
Filter Drivers
IOCTLs
Storport
Pass-through
SATA RAID
Storport
Miniport
Built for
Serial
Storage
Fibre Channel
Storport
Miniport
Microsoft’s
iSCSI
Miniport
Driver
TDI/WSK
Virtual
Miniport
Support
Coming
Recent Storport Investments
Advancing SATA RAID implementations
All new Storport Extensions called through
STORPORT_EXTENDED_FUNCTIONS, as a Table
Referenced Call
Extended memory pool methods
Scratch space for RAID Functions
SGL Extensions
Implementation of PCI MSI functions
Enhancements in Power Management
Implements “Fast Resume”; miniports must process
SRB_FUNCTION_POWER in a timely manner
Memory Pool Extensions
StorPortAllocatePool
For allocating blocks of memory from the
non-paged pool
Memory allocation up to system limitation
Well-suited for RAID calculations
StorPortFreePool
Frees memory that was previously allocated
by StorPortAllocatePool
Memory Allocation Example
PSTORPORT_EXTENDED_FUNCTIONS ExtendedFunctions;
#define MEMORY_BLOCK_POOL_TAG 'tpbm'
PVOID PMemoryBlock;
PVOID PMdl;
PMemoryBlock =
ExtendedFunctions->AllocatePool(
4096,
MEMORY_BLOCK_POOL_TAG,
HwDeviceExtension,
&PMdl
);
if (PMemoryBlock == NULL)
{
// Failed to allocate the memory block
...
}
Scatter/Gather List Extensions
StorPortBuildScatterGatherList
A miniport driver calls StorPortBuildScatterGatherList
to create an SGL for a specified data buffer using a
miniport driver-provided memory buffer [ Use Pool
Extensions ] to contain the SGL
StorPortPutScatterGatherList
StorPortPutScatterGatherList function releases any
resources associated with an SGL that was
previously created by a call to the
StorPortBuildScatterGatherList function
SGL Allocation Example
PSTORPORT_EXTENDED_FUNCTIONS ExtendedFunctions;
VOID
ExecutionRoutine(
IN PVOID *DeviceObject,
IN PVOID *Irp,
IN PSTOR_SCATTER_GATHER_LIST
IN PVOID Context
);
ScatterGather,
BUILDSGSTATUS Status;
Status =
ExtendedFunctions->BuildScatterGatherList(
HwDeviceExtension,
DataBufferMdl,
DataBuffer,
DataBufferLength,
ExecutionRoutine,
Context,
TRUE,
ScatterGatherListBuffer,
ScatterGatherListBufferLength
);
Storport SGL Flow Example
Flow in memory allocation, SGL Build, SGL
teardown, memory teardown
Call StorPortAllocatePool ->
Call StorPortBuildScatterGatherList ->
Call StorPortPutScatterGatherList ->
Call StorPortFreePool (See Below)
PSTORPORT_EXTENDED_FUNCTIONS ExtendedFunctions;
ExtendedFunctions->PutScatterGatherList(
HwDeviceExtension,
ScatterGatherListBuffer,
TRUE
);
Message Signaled Interrupts
Defined by the PCI-SIG
Not “Brand-New”, defined in PCI 2.2
Extended to MCI-X in PCI 3.0
Extends configuration space
Identifies which type of MSI is used
Bandwidth management
Allows faster full-duplex transfers
Transaction management
Splits interrupts across tasks
Storport MSI Example
Required: Hardware and OS support MSI
discovery and compatibility
A system board that is MSI capable (i.e.
chipset, and BIOS are MSI capable)
A PCI-X or PCI-E Adapter plugged into an
appropriate slot
A Registry entry that defines MSI support
Required: Miniport’s implements MSI
Implementation within miniport code
Storport MSI Example
The MSISupported Registry entry
Setup INF to create this entry in Registry
//
//
//
//
This will create entries under:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\PCI\VEN_xxxx&
DEV_yyyy&SUBSYS_zzzzvvvv&REV_xx\3&61aaa01&0&FA\Device
Parameters\Interrupt Management\MessageSignaledInterruptProperties
[XYZdriver_Inst.nt.HW]
AddReg = MsiEnable_addreg
[MsiEnable_addreg]
HKR, Interrupt Management\MessageSignaledInterruptProperties,
0x00000010
HKR, Interrupt Management\MessageSignaledInterruptProperties,
MSISupported, 0x00010001, 1
//
This code courtesy of Adaptec Corporation
Storport MSI Example
In FindAdapter routine set two new fields of the
PORT_CONFIGURATION_INFORMATION
//
//
//
//
//
(NOTE: InterruptSynchronizationMode can be set to
InterruptSynchronizeAll or InterruptSynchronizePerMessage, please
consult the storport-msi.doc for details. InterruptSynchronizeAll
is the simple choice where all message signaled interrupts will be
synchronized with each other).
ConfigInfo->HwMSInterruptRoutine = MSInterruptHandler;
ConfigInfo->InterruptSynchronizationMode = InterruptSynchronizeAll;
//
This code courtesy of Adaptec Corporation
Storport MSI Example
In MSInterruptHandler routine the miniport
would do the following
// following line necessary in case of multiple messages,
// to find out the Message ID and uniquely identify the message
MESSAGE_INTERRUPT_INFORMATION interruptInfo;
// Handles the interrupt that the message indicates
StorPortGetMessageInterruptInformation(pDeviceExtension, MessageId,
&interruptInfo);
//
This code courtesy of Adaptec Corporation
Clearing the PCI-X MSI register ensures
interrupts are enabled again before exiting
this routine
The Future Of Storport –
Near And Far
Windows Vista, Windows Server
coenamed “Longhorn,” and Back-porting
Windows Vista Fast Resume
Storport enabled “Fast Resume”
Storport receive S-IRPs for HBA and devices
Storport requests corresponding D-IRPs and then
completes S-IRPs with “Success” status
Storport receives D-IRPs for HBA and devices
Storport does normal processing to power-up HBA
and then completes HBA D-IRP
Storport waits for completion of HBA D-IRP, does
normal processing to power up devices, then
completes device D-IRPs
Enables Systems with SATA RAID or SCSI to
Support WHQL Fast Resume
Storport Virtual Miniports
Developed as consolidation of iSCSIPrt
Allows non-HW based “HBA” to
process SRBs
Hardware initialization data structure
changes, obviously
New flags required in Port Configuration
Structure – only for VM Miniports
I/O Log and Build I/O are not used
No spin-locks, No interrupts
Storage Port Driver
Futures
Feature And API Considerations
Microsoft will look to the HBA / Device industry
for long-term feature suggestions
Is additional SW-RAID support beneficial?
Expansion of Virtual Miniport interfaces
Investigation of allowing WDM calls directly from
miniports, linking to Kernel Resources
Investigation of extending VM Miniports into allowing
miniport-initiated call-back routines
Exposing Miniport Device Object to Miniport Instance
Extension of management interfaces and
extended management data reporting
Storport Roadmap
All current Windows Server 2003 features
included in Windows Vista and
Windows Server Longhorn
Next Windows Server 2003 QFE release
scheduled
Back-port release of Storport Virtual Miniport
support for Windows Server 2003 coming
Windows XP Back-port under review
Next generation SW RAID functions in
architectural discussion
Continued Support
Using Microsoft’s Investments in Storport
Storport Miniport Best Practices
Use Storport – SCSIport will go away
Do not code to ATAport for SATA RAID, only
use Storport
ATAport not supported for Third-Parties
Take advantage of Full Duplex Synchronization
Prepare for use of Virtual Miniports for extending
storage through Storport
Documentation underway – stay tuned!
Do not link to Kernel or HAL
Implement HBA-API – WHQL required
Use IOCTL_SCSI_MINIOPORT_ for private
miniport APIs
Non-Compliant Drivers
Any driver of the types defined below cannot be
WHQL Logo’d – Further, they are classified as
unsupportable by Microsoft PSS Organization
Drivers that bypass any Microsoft supplied driver
Drivers that supplement, or create private
APIs to Miniports
Drivers that create a full stack from HW to Class, or
replace Port/Miniport model (Monolithic Drivers)
Drivers that overtly link to the Kernel or HAL
While Microsoft defines futures for miniports,
continue to follow current guidelines – especially
for soon-to-release products
x64 Kernel Boot Driver Signing
Manufacturers of boot start HBAs that support
AMD or Intel emt64 must “embed” sign drivers,
vis-a-vi Code Integrity
Boot drivers set flags at compile time to identify “boot
start” drivers
Code Integrity validates driver hash against
Trusted Certificate Stores
Boot-time and run-time checking to be enabled
Attend Code Integrity Session – Windows Vista
and Windows Server Longhorn Security Platform
Enhancements, Wednesday, 2 PM
Call To Action
Storage Driver focus – above all others – must
be quality and reliability
Develop new HW support using Storport, not
SCSIport or ATAport
All Future SCSI- or ATA-based technologies will be
supported through Storport
Monolithic drivers are not open for consideration
in Storport futures
Code High End Storage systems to the MSI
Specification – best bet for increased
performance
Stay involved with WDEG Storage Driver
Inclusion (WSDI) program
Additional Resources
Web Resources
SATA in the Enterprise
http://www.microsoft.com/whdc/device/storage/stor-tech.mspx
Storport Miniport Development (DDC 2005)
Storport Architecture and Miniport Development, Part 1 and 2
White Papers
http://download.microsoft.com/download/5/6/6/5664b85a-ad06-45ec979e-ec4887d715eb/Storport.doc
WHQL Resources http://www.microsoft.com/whdc/device/storage
Microsoft’s WHDC (WHQL) Storage Requirements
Related Sessions
x64 Platform Code Integrity (CI) Development
Microsoft’s Storage Server Futures
Robert “Bob” Griswold Rogris @ microsoft.com
WDEG Storage Driver Inclusion – wsdi @ microsoft.com
© 2006 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.
The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market
conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation.
MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.