Nithin,
The driver is never blocked and it always executes in asynchronous fashion. A 
driver can immediately complete an I/O request by returning a status success 
code or an error. If the I/O is not completed the driver returns a pending 
status and the I/O will be completed later from a different thread context 
(this enables asynchronous/overlapped I/O for user mode process).
Regardless of the driver specific I/O implementation, User mode thread can opt 
to wait on a I/O device request or not. If an overlapped structure  is sent in 
the DeviceIoControl, the DeviceIOControl returns immediately regardless if the 
I/O has been completed or not.
If a NULL sent rather than an overlapped structure, the thread which calls 
DeviceIOControl is blocked until the I/O is completed by the driver.

With respect to WFP related I/O I don't think we need to return pending status 
from the driver. It should be fine to block the user mode thread during the WFP 
transaction processing.
Thanks,
Eitan


-----Original Message-----
From: Nithin Raju 
Sent: Wednesday, May 20, 2015 11:04 AM
To: Eitan Eliahu; Sorin Vinturis; dev@openvswitch.org
Subject: Re: [ovs-dev] [PATCH v2 3/4] netlink: support for asynchronous NL 
transactions

Sorin/Eitan,
Do we need this patch or not?

Eitan tells me that if return status is STATUS_PENDING, then the context is 
blocked in the kernel. If that is true, we probably don’t need this patch since 
control won’t return to userspace at all, till the IRP is complete. This is 
especially true since we are passing NULL for the ‘lpOverlapped’ parameter to 
DeviceIoControl().

Pls. see the following documentation on MSDN:
======
https://msdn.microsoft.com/en-us/library/windows/desktop/aa363216%28v=vs.85%29.aspx

lpOverlapped [in, out, optional]:
For overlapped operations, DeviceIoControl returns immediately, and the event 
object is signaled when the operation has been completed. Otherwise, the 
function does not return until the operation has been completed or an error 
occurs.
======

Based on this, my belief is that the call to DeviceIoControl() would block 
indefinitely until the IRP is completed.

In your testing, did you think this patch was necessary?

thanks,
-- Nithin
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to