Commands submitted to a SCSI StorPort driver in Windows Server 2003 will not
overlap. Standard R/W SRB's are being submitted to the StorPort driver
via another driver. A compressed summary of the other driver flow is:

Get the host adapter device object via IoGetDeviceObjectPointer().
Get driver object from host adapter object
Get physical device object from driver object. (This ends up being a
handle to \device\physicalDriveX)
....
....
Allocate IRP via IoBuildAsynchronousFsdRequest()
set completion routine via IoSetCompletionRoutine()
fill SRB and submit ansync R/W request via IoCallDriver() to physical
device object. Major function IRP_MJ_SCSI.

This method overlaps commands properly when submitted to a SCSIPort driver.
However a StorPort driver does not return from the IoCallDriver()
request until the command has completed. The identical code works properly
with SCSIPort drivers.

Any thoughts as to why the StorPort driver won't overlap commands when
submitted via another driver? The StorPort driver will overlap commands
when called via IOmeter, so I believe the StorPort driver itself is working
properly.

Re: StorPort driver won't overlap commands from another driver by Maxim

Maxim
Fri Jul 25 09:30:26 CDT 2008

> This method overlaps commands properly when submitted to a SCSIPort driver.
> However a StorPort driver does not return from the IoCallDriver()

What about the tagged queue settings in the SRB?

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com


Re: StorPort driver won't overlap commands from another driver by fuzzyduck

fuzzyduck
Mon Jul 28 11:16:02 CDT 2008

Tagged queue settings of SRB. These look OK to me?

When the SRB is received by the StorPort driver:
Srb->SrbFlags = 0x42 = SRB_FLAGS_QUEUE_ACTION_ENABLE | SRB_FLAGS_DATA_IN
(for read case)
Srb->QueueTag = 0xFD -- set to 0 when submitted by my driver. This value
is supposed to be assigned by Port driver(at least for ScsiPort).
Srb->QueueAction = 0x20 = SRB_SIMPLE_TAG_REQUEST

On Storport init:
hwInitializationData.TaggedQueuing = TRUE;

On Inquiry:
StorPortSetDeviceQueueDepth() is called with a depth of 250.

When queued commands work,(reads sent by IOMETER):
Srb->SrbFlags = 0x342 = SRB_FLAGS_QUEUE_ACTION_ENABLE | SRB_FLAGS_DATA_IN |
SRB_FLAGS_NO_QUEUE_FREEZE | SRB_FLAGS_ADAPTER_CACHE_ENABLE

Interestingly enough, when I set the SRB_FLAGS_NO_QUEUE_FREEZE bit in my
driver, the commands overlap(or queue), but I don't believe I am
supposed to be setting this bit(according to documentation). The only bits
I should set are data direction and queue action enable? Did something
change for StorPort?


"Maxim S. Shatskih" wrote:

> > This method overlaps commands properly when submitted to a SCSIPort driver.
> > However a StorPort driver does not return from the IoCallDriver()
>
> What about the tagged queue settings in the SRB?
>
> --
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> maxim@storagecraft.com
> http://www.storagecraft.com
>
>