Setup:
I have an application using which I perform IO operations (IOCTL SCSI PASSTHROUGH) on a disk which is connected to a SAS controller.
Requirement:
I need to perform asynchronous IO operations in this setup.
Options:
1- I create threads in a filter driver
2- Create threads in Application
3- Use Overlapped objects
Problem:
I read about SCSI PASS THROUGH and found that the port driver makes these requests synchronous even if we implement it asynchronous(threading) at upper layers. Please refer to the following link:
https://support.microsoft.com/en-us/kb/251369
Kindly suggest from your experience, if my understanding is correct that if I want to use SPT, I can not perform asynchronous operations.
Also, please share if there is any other option to achieve this (I cannot use IOCTL SCSI MINIPORT).
Thanks
We did implement a filter driver for this didn’t we? Use of threading and
overlapped objects didn’t help at that time. Remember ?
J.S.R.Sarma
On Tue, 26 Jul 2016 at 12:03 pm wrote:
> Setup:
> I have an application using which I perform IO operations (IOCTL SCSI
> PASSTHROUGH) on a disk which is connected to a SAS controller.
>
> Requirement:
> I need to perform asynchronous IO operations in this setup.
>
> Options:
> 1- I create threads in a filter driver
> 2- Create threads in Application
> 3- Use Overlapped objects
>
> Problem:
> I read about SCSI PASS THROUGH and found that the port driver makes these
> requests synchronous even if we implement it asynchronous(threading) at
> upper layers. Please refer to the following link:
> https://support.microsoft.com/en-us/kb/251369
>
> Kindly suggest from your experience, if my understanding is correct that
> if I want to use SPT, I can not perform asynchronous operations.
> Also, please share if there is any other option to achieve this (I cannot
> use IOCTL SCSI MINIPORT).
>
> Thanks
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list online at: <
> http://www.osronline.com/showlists.cfm?list=ntdev>
>
> MONTHLY seminars on crash dump analysis, WDF, Windows internals and
> software drivers!
> Details at http:
>
> To unsubscribe, visit the List Server section of OSR Online at <
> http://www.osronline.com/page.cfm?name=ListServer>
></http:>
Hi JSR
Thanks for your response.
Yes, we did implement filter driver, but that is used with IOCTL SCSI MINIPORT.
For the current requirement, I cannot use that. My application is supposed to use only SCSI PASS THROUGH.
I don’t know why should that matter as long as we are talking to port
driver. The filter driver sits above the port driver and intercepts every
request sent to port driver irrespective of the icctl code.
If I am wrong somewhere please correct me.
On 26-Jul-2016 12:23 PM, wrote:
Hi JSR
Thanks for your response.
Yes, we did implement filter driver, but that is used with IOCTL SCSI
MINIPORT.
For the current requirement, I cannot use that. My application is supposed
to use only SCSI PASS THROUGH.
—
NTDEV is sponsored by OSR
Visit the list online at: http:>
MONTHLY seminars on crash dump analysis, WDF, Windows internals and
software drivers!
Details at http:
To unsubscribe, visit the List Server section of OSR Online at <
http://www.osronline.com/page.cfm?name=ListServer></http:></http:>
Yes, that matters.
Please refer to the following link once :
https://support.microsoft.com/en-us/kb/251369
The port driver does differentiates between the two types of IOCTLS. If it SPT, it blocks the requests in this layer and lets a request go down only when the previous one has completed. Thus making it synchronous.
I confirmed this behavior by initiating two SPT requests (commands which take good time to complete) simultaneously. And found that the 2nd one is sent only after 1st one completed which was after 14 minutes.
> I have an application using which I perform IO operations (IOCTL SCSI PASSTHROUGH) on a disk
which is connected to a SAS controller.
Requirement:
I need to perform asynchronous IO operations in this setup.
Impossible.
IOCTL_SCSI_PASS_THROUGH_(DIRECT) are serialized internally by the port driver.
So, start a separate thread for this. Or write a disk filter which will send IRP_MJ_SCSI (which are async) down to the port.
–
Maxim S. Shatskih
Microsoft MVP on File System And Storage
xxxxx@storagecraft.com
http://www.storagecraft.com
I wonder why did they want the port driver to serialize all SCSI requests
when the SAS adapters and drives are perfectly capable of handling multiple
requests…
Even ioctl_scsi_miniport requests are serialized?
On 26-Jul-2016 23:43, “Maxim S. Shatskih” wrote:
> > I have an application using which I perform IO operations (IOCTL SCSI
> PASSTHROUGH) on a disk
> >which is connected to a SAS controller.
> >
> > Requirement:
> > I need to perform asynchronous IO operations in this setup.
>
> Impossible.
>
> IOCTL_SCSI_PASS_THROUGH_(DIRECT) are serialized internally by the port
> driver.
>
> So, start a separate thread for this. Or write a disk filter which will
> send IRP_MJ_SCSI (which are async) down to the port.
>
> –
> Maxim S. Shatskih
> Microsoft MVP on File System And Storage
> xxxxx@storagecraft.com
> http://www.storagecraft.com
>
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list online at: <
> http://www.osronline.com/showlists.cfm?list=ntdev>
>
> MONTHLY seminars on crash dump analysis, WDF, Windows internals and
> software drivers!
> Details at http:
>
> To unsubscribe, visit the List Server section of OSR Online at <
> http://www.osronline.com/page.cfm?name=ListServer>
></http:>
This is only about IOCTL_SCSI_PASS_THROUGH, not about IRP_MJ_SCSI requests sent by the kernel mode clients, which are async.
The answer is that it probably simplifies the buffer management.
–
Maxim S. Shatskih
Microsoft MVP on File System And Storage
xxxxx@storagecraft.com
http://www.storagecraft.com
“jayanth sharma” wrote in message news:xxxxx@ntdev…
I wonder why did they want the port driver to serialize all SCSI requests when the SAS adapters and drives are perfectly capable of handling multiple requests…
Even ioctl_scsi_miniport requests are serialized?
On 26-Jul-2016 23:43, “Maxim S. Shatskih” wrote:
> I have an application using which I perform IO operations (IOCTL SCSI PASSTHROUGH) on a disk
>which is connected to a SAS controller.
>
> Requirement:
> I need to perform asynchronous IO operations in this setup.
Impossible.
IOCTL_SCSI_PASS_THROUGH_(DIRECT) are serialized internally by the port driver.
So, start a separate thread for this. Or write a disk filter which will send IRP_MJ_SCSI (which are async) down to the port.
–
Maxim S. Shatskih
Microsoft MVP on File System And Storage
xxxxx@storagecraft.com
http://www.storagecraft.com
—
NTDEV is sponsored by OSR
Visit the list online at: http:
MONTHLY seminars on crash dump analysis, WDF, Windows internals and software drivers!
Details at http:
To unsubscribe, visit the List Server section of OSR Online at http:</http:></http:></http:>
Hi Maxim
Thanks for the suggestion.
I would like to understand which level of thread you meant here:
" start a separate thread for this".
And, regarding the other option you suggested :
“Or write a disk filter which will send IRP_MJ_SCSI (which are async) down to the port”,
I tried threading in upper class(disk) filter driver. But found that the IOcall driver returns pending status. In this driver i am just forwarding the same IRP to the next object in the stack, from a new thread.
Should I create a new IRP and send it down?
IoCallDriver returning STATUS_PENDING is correct for asynchronous requests
right? You need to send that STATUS_PENDING back to the application and let
the application send another command.
Even in the upper port filter driver we did the same thing. The thread
sends down the SRB and sends a pending status back to the application (or
to the io manager ).
Is this understand correct? Or am I missing anything?
On 27-Jul-2016 11:56 AM, wrote:
Hi Maxim
Thanks for the suggestion.
I would like to understand which level of thread you meant here:
" start a separate thread for this".
And, regarding the other option you suggested :
“Or write a disk filter which will send IRP_MJ_SCSI (which are async) down
to the port”,
I tried threading in upper class(disk) filter driver. But found that the
IOcall driver returns pending status. In this driver i am just forwarding
the same IRP to the next object in the stack, from a new thread.
Should I create a new IRP and send it down?
—
NTDEV is sponsored by OSR
Visit the list online at: http:>
MONTHLY seminars on crash dump analysis, WDF, Windows internals and
software drivers!
Details at http:
To unsubscribe, visit the List Server section of OSR Online at <
http://www.osronline.com/page.cfm?name=ListServer></http:></http:>