Driver Problems? Questions? Issues?
Put OSR's experience to work for you! Contact us for assistance with:
  • Creating the right design for your requirements
  • Reviewing your existing driver code
  • Analyzing driver reliability/performance issues
  • Custom training mixed with consulting and focused directly on your specific areas of interest/concern.
Check us out. OSR, the Windows driver experts.

Monthly Seminars at OSR Headquarters

East Coast USA
Windows Internals and SW Drivers, Dulles (Sterling) VA, 13 November 2017

Kernel Debugging & Crash Analysis for Windows, Nashua (Amherst) NH, 4 December 2017

Writing WDF Drivers I: Core Concepts, Nashua (Amherst) NH, 8 January 2018

WDF Drivers II: Advanced Implementation Techniques, Nashua (Amherst) NH, 15 January 2018


Go Back   OSR Online Lists > ntdev
Welcome, Guest
You must login to post to this list
  Message 1 of 4  
08 Sep 17 09:55
Mridul Pentapalli
xxxxxx@mediafour.com
Join Date: 14 Apr 2008
Posts To This List: 41
Virtual Storport Miniport driver for RAID

Hi, I am working on a cross-platform Software RAID driver. I already have a working KMDF bus driver that creates virtual disks (PDOs) once the RAID set is mounted. I am trying to develop a Virtual Storport Miniport driver that accomplishes the same thing. I have a few questions though: 1. Is it possible to write a Virtual Storport Miniport driver in KMDF? It's not entirely clear from the KMDF documentation. 2. How can I get my miniport driver to be notified when a physical disk is connected or disconnected? (Is it PnpRegisterPlugPlayNotification for GUID_DEVINTERFACE_DISK? or something else?) 3. Is it possible to just expose a RAID volume rather than a virtual disk? How do I do that? Regards, Mridul.
  Message 2 of 4  
11 Sep 17 19:39
Jan Bottorff
xxxxxx@pmatrix.com
Join Date: 16 Apr 2013
Posts To This List: 394
Virtual Storport Miniport driver for RAID

>1. Is it possible to write a Virtual Storport Miniport driver in KMDF?=20 >It's not entirely clear from the KMDF documentation. No, you might be able to use a few of the KMDF utility objects but there is= limited value in doing so. Storport request queueing and KMDF queueing are= different universes. >2. How can I get my miniport driver to be notified when a physical disk is= connected or=20 >disconnected? (Is it PnpRegisterPlugPlayNotification for GUID_DEVINTERFACE= _DISK? or something else?) There have been a number of devices that used virtual bus drivers, implemen= ted in KMDF of not, to attach to some unusual physical/logical device, whic= h then exposes some virtual storage adapter devices, which get instances of= a storport miniport attached. These storport miniport instances may enumer= ate only a single disk, as the multi-instancing has already been handled by= the lower virtual bus. The add/remove of physical devices is managed by th= e virtual bus driver. The virtual storport driver will then often have some= private call based interface down to the virtual bus driver. In designs li= ke this, the storport miniport acts more of an interface translator convert= ing SRBs from the attached disk PDO into some request the virtual bus drive= r uses. A storage virtual bus driver is also sometimes root enumerated (like the iS= CSI driver) and talks to other physical devices. The PnP interface notifica= tions can be used to detect device changes. A problem of root enumerated st= orage drivers is it's problematic to support things like crash dumps. You a= lso have to use care in power relationships, so on system shutdown, your ph= ysical devices don't get powered down before you storage flushes cached dat= a. Devices in a normal PnP hierarchy almost automagically have an appropria= te power management hierarchy. I'm reluctant to even bring up root enumerat= ed storage devices, because in past projects, we ultimately had to move eve= rything to a correct PnP device hierarchy to get everything to work exactly= correctly.=20 >3. Is it possible to just expose a RAID volume rather than a virtual disk?= How do I do that? I believe one of the sample drivers exposes a ramdisk volume device. A big problem with many of these unusual storage driver architectures is th= ey can't pass Microsoft driver certification, which is essential if you wan= t to sell a commercial product. One reason the storage stack is deeply tied= to storport is the crash dump/hibernate support runs the storport miniport= in a fake environment. Technically, you could just create a KDMF bus drive= r on your hardware that exposed disk PDOs (which know how to process SRBs),= and let the disk FDOs attach, but there is no way to pass certification te= sts with this kind of architecture. Another problem is much of the management infrastructure wants the storage = stack to look a certain way, like storage spaces layered on storport/nvme p= hysical devices. If you make your own storage stack architecture, this mana= gement infrastructure has no idea how to control it, and your product will = integrate poorly with management layers like System Center Virtual Machine = Manager.=20 I'm not optimistic the deep certification dependence on storport is likely = to change in the near future. Measurements also suggest storport has some s= ignificant performance bottlenecks. It would be better to not expose a comp= ound/raid disk from the top edge of storport, because requests for a disk a= re forced though a queue which performs poorly on multi-socket servers. =20 Jan
  Message 3 of 4  
14 Sep 17 17:19
Mridul Pentapalli
xxxxxx@mediafour.com
Join Date: 14 Apr 2008
Posts To This List: 41
Virtual Storport Miniport driver for RAID

Thank you for your wonderful answers. I have regular physical disks whose GPT partitions correspond to RAID information and RAID data. I want to read the RAID Information partition and then mount the RAID volume as a virtual disk (or pref. volume) once all the disks in the RAID set are connected. If I understand you correctly, I should create a Disk Filter driver and a Virtual Storport Miniport Driver. The Disk Filter driver will keep track of the RAID Member disks, and will inform the Storport Miniport Driver once all RAID Member disks are connected so that the Storport Miniport Driver can call StorPortNotification with BusChanged and inform Windows that a disk is online? Regards, Mridul.
  Message 4 of 4  
14 Sep 17 20:14
Sven Kreamer
xxxxxx@gmail.com
Join Date: 27 Oct 2016
Posts To This List: 9
Virtual Storport Miniport driver for RAID

> If I understand you correctly, I should create a Disk Filter > driver and a Virtual Storport Miniport Driver Creating a companion disk filter is a design alternative, but is not required. Some use them and some don't because making a second type of driver adds complexity and time. Disk tracking can be performed in a miniport as you outlined. An example of a standalone miniport driver can be seen with the perisoft software raid source code. It sounds like you already understand miniport workings.
Posting Rules  
You may not post new threads
You may not post replies
You may not post attachments
You must login to OSR Online AND be a member of the ntdev list to be able to post.

All times are GMT -5. The time now is 03:04.


Copyright ©2015, OSR Open Systems Resources, Inc.
Based on vBulletin Copyright ©2000 - 2005, Jelsoft Enterprises Ltd.
Modified under license