the windows storage driver stack in depth storport and the future of windows storage bob griswold...
TRANSCRIPT
The Windows Storage The Windows Storage Driver Stack In DepthDriver Stack In DepthStorport And The Future Of Storport And The Future Of Windows StorageWindows Storage
Bob GriswoldBob GriswoldProgram ManagerProgram ManagerWDEG StorageWDEG StorageMicrosoft CorporationMicrosoft Corporation
Windows Storage DevicesWindows Storage DevicesStrategic PillarsStrategic Pillars
Optical Platform Client/Consumer
Storage Fabrics Server/Enterprise
Personal Storage Client/Consumer
Preferred Storage Platform Partner/Customer
Timely, comprehensive, quality platform Timely, comprehensive, quality platform support for optical devicessupport for optical devices
Optimized platform features enabling your Optimized platform features enabling your Windows experience, here and nowWindows experience, here and now
Leading platform enabling storage Leading platform enabling storage fabric adoptionfabric adoption
Preferred platform for developing, Preferred platform for developing, deploying, and using storage devices deploying, and using storage devices
AgendaAgenda
Windows Storage Port Driver HistoryWindows Storage Port Driver HistoryWhere Storport comes from and whyWhere Storport comes from and why
Storport – the Here and NowStorport – the Here and NowHow Storport serves the current customerHow Storport serves the current customer
Recent Storport changes – investments in Recent Storport changes – investments in the platformthe platform
The future of Storport – near and FarThe future of Storport – near and FarWindows Vista and Windows Server Windows Vista and Windows Server codenamed “Longhorn”codenamed “Longhorn”
Windows Storage Port Windows Storage Port Driver HistoryDriver HistoryThe birth of a driverThe birth of a driver
Windows Storage Driver Windows Storage Driver HistoryHistory
Windows NT and SCSIport, c. 1994Windows NT and SCSIport, c. 1994Created a HW-independent SCSI interfaceCreated a HW-independent SCSI interface
Built for extensibility, features and APIBuilt for extensibility, features and API
Laid groundwork for future storage portsLaid groundwork for future storage ports
Released with Windows NT 3.XReleased with Windows NT 3.XAdaptec, others instrumental in designAdaptec, others instrumental in design
SCSIport established baseline for Storport, USBstor, and ATAportSCSIport established baseline for Storport, USBstor, and ATAport
SCSIportSCSIportOld Man SCSIOld Man SCSI
Extensive customer issue resolutionExtensive customer issue resolutionSecurity servicing to be continued Security servicing to be continued
Most mature Microsoft storage driver Most mature Microsoft storage driver
No Fast Resume supportNo Fast Resume support
Queue and reset limitations will not Queue and reset limitations will not be consideredbe considered
No back-porting of Storport features plannedNo back-porting of Storport features planned
SCSIport EOL planning not started, but…SCSIport EOL planning not started, but…Prepare for this event – move to Storport sooner rather than laterPrepare for this event – move to Storport sooner rather than later
SCSIport MinutiaeSCSIport Minutiae
SCSIport remained *only* solution SCSIport remained *only* solution for yearsfor years
Only SPB2Port (IEEE-1394) evolved Only SPB2Port (IEEE-1394) evolved
All ATA drivers remained “non-extensible”All ATA drivers remained “non-extensible”
SCSIport “Chock-full-o-Fixes”SCSIport “Chock-full-o-Fixes”Many specific to particular devicesMany specific to particular devices
Original SCSIport was 47 KBOriginal SCSIport was 47 KB
Current SCSIport is 104 KBCurrent SCSIport is 104 KB
Storport – The Here and NowStorport – The Here and NowWindows Server 2003Windows Server 2003
Original Storport RequirementsOriginal Storport Requirements
API, IOCTL, SRB handling and other “miniport” methods compatible with SCSIportAPI, IOCTL, SRB handling and other “miniport” methods compatible with SCSIport
Improve on SCSIport withImprove on SCSIport withBetter sequential I/O handlingBetter sequential I/O handling
Per Adapter and Per LUNPer Adapter and Per LUNExpanded queue depth and alignmentExpanded queue depth and alignment
Increased outstanding I/O limitsIncreased outstanding I/O limits
Spin Lock not required between start and completionSpin Lock not required between start and completion
Added BuildIo at passive levelAdded BuildIo at passive level
Hierarchical Resets and Registry AccessHierarchical Resets and Registry Access
Better miniport integration withBetter miniport integration withIRQ level handing and queue control (Adapter and LUNs)IRQ level handing and queue control (Adapter and LUNs)
Scatter Gather List (SGL) methodsScatter Gather List (SGL) methods
Storport: Right For The FutureStorport: Right For The Future
The Storport driver model was built on new code – not from the existing SCSIport The Storport driver model was built on new code – not from the existing SCSIport Eliminated forced workarounds and patchesEliminated forced workarounds and patches
Focus on RAID and I/O PerformanceFocus on RAID and I/O Performance
New features and extensions New features and extensions will notwill not be ported or back-ported into SCSIport be ported or back-ported into SCSIport
Built with focus on serial storageBuilt with focus on serial storageDuplex I/O handling, IRQL methodsDuplex I/O handling, IRQL methods
Built to industry storage specificationsBuilt to industry storage specifications
Error handling and hierarchical resetsError handling and hierarchical resets
Equates To Stable ArchitectureEquates To Stable Architecture
Device Class Driver
Fibre ChannelStorportMiniport
Storport
Microsoft’siSCSI
MiniportDriver
Filter Drivers
Device Class Driver
SATA RAIDStorportMiniport
TDI/WSK
IOCTLs
Pass-through
Better Error
Handling
Virtual Miniport Support Coming
Built for Serial
Storage
Recent Storport InvestmentsRecent Storport InvestmentsAdvancing SATA RAID implementationsAdvancing SATA RAID implementations
All new Storport Extensions called through All new Storport Extensions called through STORPORT_EXTENDED_FUNCTIONS, as a Table Referenced Call
Extended memory pool methodsExtended memory pool methodsScratch space for RAID FunctionsScratch space for RAID Functions
SGL ExtensionsSGL Extensions
Implementation of PCI MSI functionsImplementation of PCI MSI functions
Enhancements in Power ManagementEnhancements in Power ManagementImplements “Fast Resume”; miniports must process SRB_FUNCTION_POWER in a timely mannerImplements “Fast Resume”; miniports must process SRB_FUNCTION_POWER in a timely manner
Memory Pool ExtensionsMemory Pool Extensions
StorPortAllocatePoolStorPortAllocatePoolFor allocating blocks of memory from the For allocating blocks of memory from the non-paged pool non-paged pool
Memory allocation up to system limitation Memory allocation up to system limitation
Well-suited for RAID calculationsWell-suited for RAID calculations
StorPortFreePoolStorPortFreePoolFrees memory that was previously allocated Frees memory that was previously allocated by StorPortAllocatePoolby StorPortAllocatePool
Memory Allocation ExampleMemory Allocation ExamplePSTORPORT_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 ExtensionsScatter/Gather List Extensions
StorPortBuildScatterGatherListStorPortBuildScatterGatherListA miniport driver calls StorPortBuildScatterGatherList A miniport driver calls StorPortBuildScatterGatherList to create an SGL for a specified data buffer using a to create an SGL for a specified data buffer using a miniport driver-provided memory buffer [ miniport driver-provided memory buffer [ Use Pool Use Pool ExtensionsExtensions ] to contain the SGL ] to contain the SGL
StorPortPutScatterGatherListStorPortPutScatterGatherListStorPortPutScatterGatherList function releases any StorPortPutScatterGatherList function releases any resources associated with an SGL that was resources associated with an SGL that was previously created by a call to the previously created by a call to the StorPortBuildScatterGatherList functionStorPortBuildScatterGatherList function
SGL Allocation ExampleSGL Allocation ExamplePSTORPORT_EXTENDED_FUNCTIONS ExtendedFunctions;
VOID ExecutionRoutine( IN PVOID *DeviceObject, IN PVOID *Irp, IN PSTOR_SCATTER_GATHER_LIST ScatterGather, IN PVOID Context );
BUILDSGSTATUS Status;
Status = ExtendedFunctions->BuildScatterGatherList( HwDeviceExtension, DataBufferMdl, DataBuffer, DataBufferLength, ExecutionRoutine, Context, TRUE, ScatterGatherListBuffer, ScatterGatherListBufferLength );
Storport SGL Flow ExampleStorport SGL Flow Example
PSTORPORT_EXTENDED_FUNCTIONS ExtendedFunctions;
ExtendedFunctions->PutScatterGatherList( HwDeviceExtension, ScatterGatherListBuffer, TRUE );
Flow in memory allocation, SGL Build, SGL Flow in memory allocation, SGL Build, SGL teardown, memory teardownteardown, memory teardown
Call StorPortAllocatePool -> Call StorPortAllocatePool ->
Call StorPortBuildScatterGatherList -> Call StorPortBuildScatterGatherList ->
Call StorPortPutScatterGatherList -> Call StorPortPutScatterGatherList ->
Call StorPortFreePool (See Below)Call StorPortFreePool (See Below)
Message Signaled InterruptsMessage Signaled Interrupts
Defined by the PCI-SIGDefined by the PCI-SIGNot “Brand-New”, defined in PCI 2.2Not “Brand-New”, defined in PCI 2.2
Extended to MCI-X in PCI 3.0Extended to MCI-X in PCI 3.0
Extends configuration spaceExtends configuration spaceIdentifies which type of MSI is usedIdentifies which type of MSI is used
Bandwidth managementBandwidth managementAllows faster full-duplex transfersAllows faster full-duplex transfers
Transaction managementTransaction managementSplits interrupts across tasksSplits interrupts across tasks
Storport MSI ExampleStorport MSI Example
Required:Required: Hardware and OS support MSI Hardware and OS support MSI discovery and compatibility discovery and compatibility
A system board that is MSI capable (i.e. A system board that is MSI capable (i.e. chipset, and BIOS are MSI capable) chipset, and BIOS are MSI capable)
A PCI-X or PCI-E Adapter plugged into an A PCI-X or PCI-E Adapter plugged into an appropriate slot appropriate slot
A Registry entry that defines MSI support A Registry entry that defines MSI support
Required:Required: Miniport’s implements MSI Miniport’s implements MSI Implementation within miniport code Implementation within miniport code
Storport MSI ExampleStorport MSI Example
The MSISupported Registry entryThe MSISupported Registry entrySetup INF to create this entry in RegistrySetup 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, 0x00000010HKR, Interrupt Management\MessageSignaledInterruptProperties, MSISupported, 0x00010001, 1
// This code courtesy of Adaptec Corporation
Storport MSI ExampleStorport MSI Example
In FindAdapter routine set two new fields of the In FindAdapter routine set two new fields of the PORT_CONFIGURATION_INFORMATION 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 ExampleStorport MSI Example
In MSInterruptHandler routine the miniport In MSInterruptHandler routine the miniport would do the followingwould 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 Clearing the PCI-X MSI register ensures interrupts are enabled again before exiting enabled again before exiting this routinethis routine
The Future Of Storport – The Future Of Storport – Near And FarNear And FarWindows Vista, Windows Server Windows Vista, Windows Server coenamed “Longhorn,” and Back-portingcoenamed “Longhorn,” and Back-porting
Windows Vista Fast ResumeWindows Vista Fast Resume
Storport enabled “Fast Resume”Storport enabled “Fast Resume”Storport receive S-IRPs for HBA and devicesStorport receive S-IRPs for HBA and devices
Storport requests corresponding D-IRPs and then Storport requests corresponding D-IRPs and then completes S-IRPs with “Success” statuscompletes S-IRPs with “Success” status
Storport receives D-IRPs for HBA and devicesStorport receives D-IRPs for HBA and devices
Storport does normal processing to power-up HBA Storport does normal processing to power-up HBA and then completes HBA D-IRPand then completes HBA D-IRP
Storport waits for completion of HBA D-IRP, does Storport waits for completion of HBA D-IRP, does normal processing to power up devices, then normal processing to power up devices, then completes device D-IRPscompletes device D-IRPs
Enables Systems with SATA RAID or SCSI to Enables Systems with SATA RAID or SCSI to Support WHQL Fast ResumeSupport WHQL Fast Resume
Storport Virtual MiniportsStorport Virtual Miniports
Developed as consolidation of iSCSIPrtDeveloped as consolidation of iSCSIPrt
Allows non-HW based “HBA” to Allows non-HW based “HBA” to process SRBsprocess SRBs
Hardware initialization data structure Hardware initialization data structure changes, obviouslychanges, obviously
New flags required in Port Configuration New flags required in Port Configuration Structure – only for VM MiniportsStructure – only for VM Miniports
I/O Log and Build I/O are not used I/O Log and Build I/O are not used
No spin-locks, No interruptsNo spin-locks, No interrupts
Storage Port Driver Storage Port Driver FuturesFutures
Feature And API ConsiderationsFeature And API Considerations
Microsoft will look to the HBA / Device industry Microsoft will look to the HBA / Device industry for long-term feature suggestionsfor long-term feature suggestions
Is additional SW-RAID support beneficial?Is additional SW-RAID support beneficial?
Expansion of Virtual Miniport interfacesExpansion of Virtual Miniport interfacesInvestigation of allowing WDM calls directly from Investigation of allowing WDM calls directly from miniports, linking to Kernel Resourcesminiports, linking to Kernel Resources
Investigation of extending VM Miniports into allowing Investigation of extending VM Miniports into allowing miniport-initiated call-back routinesminiport-initiated call-back routines
Exposing Miniport Device Object to Miniport InstanceExposing Miniport Device Object to Miniport Instance
Extension of management interfaces and Extension of management interfaces and extended management data reportingextended management data reporting
Storport RoadmapStorport Roadmap
All current Windows Server 2003 features All current Windows Server 2003 features included in Windows Vista and included in Windows Vista and Windows Server LonghornWindows Server Longhorn
Next Windows Server 2003 QFE release Next Windows Server 2003 QFE release scheduledscheduled
Back-port release of Storport Virtual Miniport Back-port release of Storport Virtual Miniport support for Windows Server 2003 comingsupport for Windows Server 2003 coming
Windows XP Back-port under reviewWindows XP Back-port under review
Next generation SW RAID functions in Next generation SW RAID functions in architectural discussionarchitectural discussion
Continued SupportContinued SupportUsing Microsoft’s Investments in StorportUsing Microsoft’s Investments in Storport
Storport Miniport Best PracticesStorport Miniport Best Practices
Use Storport – SCSIport will go awayUse Storport – SCSIport will go awayDo not code to ATAport for SATA RAID, only Do not code to ATAport for SATA RAID, only use Storportuse Storport
ATAport not supported for Third-PartiesATAport not supported for Third-Parties
Take advantage of Full Duplex SynchronizationTake advantage of Full Duplex SynchronizationPrepare for use of Virtual Miniports for extending Prepare for use of Virtual Miniports for extending storage through Storportstorage through Storport
Documentation underway – stay tuned!Documentation underway – stay tuned!
Do not link to Kernel or HALDo not link to Kernel or HALImplement HBA-API – WHQL requiredImplement HBA-API – WHQL requiredUse IOCTL_SCSI_MINIOPORT_ for private Use IOCTL_SCSI_MINIOPORT_ for private miniport APIsminiport APIs
Non-Compliant DriversNon-Compliant Drivers
Any driver of the types defined below cannot be Any driver of the types defined below cannot be WHQL Logo’d – Further, they are classified as WHQL Logo’d – Further, they are classified as unsupportable by Microsoft PSS Organizationunsupportable by Microsoft PSS Organization
Drivers that bypass any Microsoft supplied driverDrivers that bypass any Microsoft supplied driverDrivers that supplement, or create private Drivers that supplement, or create private APIs to MiniportsAPIs to MiniportsDrivers that create a full stack from HW to Class, or Drivers that create a full stack from HW to Class, or replace Port/Miniport model (Monolithic Drivers)replace Port/Miniport model (Monolithic Drivers)Drivers that overtly link to the Kernel or HALDrivers that overtly link to the Kernel or HAL
While Microsoft defines futures for miniports, While Microsoft defines futures for miniports, continue to follow current guidelines – especially continue to follow current guidelines – especially for soon-to-release productsfor soon-to-release products
x64 Kernel Boot Driver Signingx64 Kernel Boot Driver Signing
Manufacturers of boot start HBAs that support Manufacturers of boot start HBAs that support AMD or Intel emt64 must “embed” sign drivers, AMD or Intel emt64 must “embed” sign drivers, vis-a-vi Code Integrityvis-a-vi Code Integrity
Boot drivers set flags at compile time to identify “boot Boot drivers set flags at compile time to identify “boot start” driversstart” drivers
Code Integrity validates driver hash against Code Integrity validates driver hash against Trusted Certificate StoresTrusted Certificate Stores
Boot-time and run-time checking to be enabledBoot-time and run-time checking to be enabled
Attend Code Integrity Session – Windows Vista Attend Code Integrity Session – Windows Vista and Windows Server Longhorn Security Platform and Windows Server Longhorn Security Platform Enhancements, Wednesday, 2 PMEnhancements, Wednesday, 2 PM
Call To ActionCall To Action
Storage Driver focus – above all others – must Storage Driver focus – above all others – must be quality and reliabilitybe quality and reliabilityDevelop new HW support using Storport, not Develop new HW support using Storport, not SCSIport or ATAportSCSIport or ATAport
All Future SCSI- or ATA-based technologies will be All Future SCSI- or ATA-based technologies will be supported through Storportsupported through Storport
Monolithic drivers Monolithic drivers are notare not open for consideration open for consideration in Storport futuresin Storport futuresCode High End Storage systems to the MSI Code High End Storage systems to the MSI Specification – best bet for increased Specification – best bet for increased performanceperformanceStay involved with WDEG Storage Driver Stay involved with WDEG Storage Driver Inclusion (WSDI) programInclusion (WSDI) program
Web ResourcesWeb ResourcesSATA in the EnterpriseSATA in the Enterprisehttp://www.microsoft.com/whdc/device/storage/stor-tech.mspxhttp://www.microsoft.com/whdc/device/storage/stor-tech.mspxStorport Miniport Development (DDC 2005)Storport Miniport Development (DDC 2005)Storport Architecture and Miniport Development, Part 1 and 2Storport Architecture and Miniport Development, Part 1 and 2White PapersWhite Papers
http://download.microsoft.com/download/5/6/6/5664b85a-ad06-45ec-http://download.microsoft.com/download/5/6/6/5664b85a-ad06-45ec-979e-ec4887d715eb/Storport.doc979e-ec4887d715eb/Storport.docWHQL Resources WHQL Resources http://www.microsoft.com/whdc/device/storagehttp://www.microsoft.com/whdc/device/storage
Microsoft’s WHDC (WHQL) Storage RequirementsMicrosoft’s WHDC (WHQL) Storage Requirements
Related SessionsRelated Sessionsx64 Platform Code Integrity (CI) Developmentx64 Platform Code Integrity (CI) DevelopmentMicrosoft’s Storage Server FuturesMicrosoft’s Storage Server Futures
Robert “Bob” Griswold Robert “Bob” Griswold WDEG Storage Driver Inclusion – WDEG Storage Driver Inclusion –
Additional ResourcesAdditional Resources
Rogris @ microsoft.comRogris @ microsoft.comwsdi @ microsoft.comwsdi @ 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.