Query on Virtual Storport Miniport Driver

Hi All,

As per my understanding Virtual Storport Miniport Driver interface is designed for miniport drivers that currently have no strict association with the physical hardware like storage controller. But is it possible that Storpot Virtual miniport driver can communicate with storport mimiport driver owning some storage controller? Are there any defined interfaces in Storport? For ex, can a virtual storport driver that implements RAID logic, and another storport driver that controls controller, interact with each other directly (with or without involvement of Storport)?.

In other words, suppose we have two controllers C1,C2 and these two controllers will be manage by miniport driver (RAID functionality). And OS interacts with these controllers through virtual storport miniport driver and virtual miniport driver interact with C1,C2 through storport miniport driver. So do windows have any specific interface for this communication between Virtual Storport Miniport and Storport Miniport. Is Virtual Storport Miniport drivers will be feasible solution for managing such multiple controllers scenario and providing RAID functionality on it?

Thanks in Advance!!

Easy answer: yes. The communication is done by sending SRBs from the virtual miniport down to the hardware miniports. There is even source code available for exactly what you are taking about–just google for miniport raid.

>Storport Miniport. Is Virtual Storport Miniport drivers will be feasible solution for managing such

multiple controllers scenario and providing RAID functionality on it?

Surely yes, inbox Storage Spaces are such


Maxim S. Shatskih
Microsoft MVP on File System And Storage
xxxxx@storagecraft.com
http://www.storagecraft.com

Thanks Eriksson and Maxim.

As you suggested it is possible. But still I have one questions, VMiniport will get SRBs from storport and if those SRBs are indented for Miniport then, we need to complete it through miniport driver then are there any specific function we need to expose from minport using which VMiniport will provide these SRBs to Miniport or there are some standard functions windows provide for this communication between VMiniport and miniport.

Moreover during reboot, hibernation/crash dump scenario when VMiniport get ScsiStopAdapter from storport how to deal with it, if we have boot virtual disk spanned across controllers?

Eriksson, we have the source available for similar solution on perisoft.net/miniport/index.htm but it is not free :(. Do we have sample available from any other source?

There are no special miniport APIs for communicating with another miniport. In fact the vminiport does not need to detect or access physical miniports directly; it just sees disk drives and doesn’t care about their parent controller architecture. In a nutshell what you can do is have the virtual miniport open handles to the disk drives of interest and send IRPs to the disks all using normal kernel functions. The IRP contains an SRB which contains a read or write CDB. Nothing special needs done at any level.

It is unlikely you will be able to boot from a virtual miniport. At boot time, there is no windows, no drivers, no virtual miniports. One of the few ways is to have a special custom BIOS burned into the machine that can read from your RAID. Also there are some mirroring tricks and other proprietary solutions. There may be other sources as software raid is a hot area lately. Starting with a working driver is going to save time and money. If you aren’t very kernel savvy maybe a year give or take to get to equivalent functionality. There are a lot of things you need to do that may not be obvious now such as hiding drive letters of the physical drives.

Thanks Eriksson for all the clarification !!

I got more question. Suppose we have Vminiport driver provides RAID functionality and we have boot Virtual-disk(VD) created across USB-disk, SATA-disk, PCIe-SSD/HDD. In this case when system will go to hibernation what will happen? Do OS will initialize full stack for all these three different devices (USB-disk, SATA-disk, PCIe-SSD/HDD) separately before dumping hiber file/dump file(In case of Crash dump). As we know create OS will create different storage stack as per the boot-vd and Initialize those respective miniport drivers. I am curious to know do hibernation and crash dump scenario will work if we have such if we have boot VD on such heterogeneous interfaces and can VMiniport will able to manage this and solve this problem?

During a crash dump, the system is running at HIGH_IRQL, with no interrupts, it can?t call any OS APIs (except a physical storage mini port can call only the miniport wrapper functions).you can?t call any other drivers (unless you own that driver and have made arrangement for it to have crash dump compatible function which you already know the address of).

The OS will not just magically make a full environment to write crash dumps in. One way to think of the environment is: imagine the OS was frozen at ANY moment, critical spin locks may be held, data structures may be half updated, hardware may be in any state. A crash dump driver is responsible for getting the storage driver that controls the crash dump file back to a state that functions well enough to very carefully make some writes.

If you driver is a virtual storport, that passes the actual I/O down to other device stacks, you are almost certainly not going to be able to write crash dump. I say almost certainly, because some years ago I worked on a set of drivers for virtual networking and virtual storage using Infiniband that had a virtual storport driver that was able to write crash dumps. It was only able to do this because we had control over all the drivers down to the hardware. It sounds like you’re hoping to just have a RAID layer that works with arbitrary storage devices. The hardware storport miniport support functions are carefully chosen to be things that work, or can be simulated, at crash dump time.

Jan

On Aug 21, 2014, at 12:26 AM, xxxxx@gmail.com wrote:

Thanks Eriksson for all the clarification !!

I got more question. Suppose we have Vminiport driver provides RAID functionality and we have boot Virtual-disk(VD) created across USB-disk, SATA-disk, PCIe-SSD/HDD. In this case when system will go to hibernation what will happen? Do OS will initialize full stack for all these three different devices (USB-disk, SATA-disk, PCIe-SSD/HDD) separately before dumping hiber file/dump file(In case of Crash dump). As we know create OS will creahe te different storage stack as per the boot-vd and Initialize those respective miniport drivers. I am curious to know do hibernation and crash dump scenario will work if we have such if we have boot VD on such heterogeneous interfaces and can VMiniport will able to manage this and solve this problem?


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

There are virtual miniports that support crash dump and hibernation, but those:

a) are sitting on top of proprietary driver stack and use hardware-specific dump/hibernate single-binary miniport; or
b) are provided by Microsoft (msiscsi) and require that the dependent NDIS miniport drivers are non-virtual (or had a non-virtual substitution).