[ofw] [PATCH][RFC] winverbs/cq: CQ notification should be done in userspace

Sean Hefty sean.hefty at intel.com
Fri May 2 07:04:15 PDT 2008


>How do you distinguish between error-only and completion notify requests?
>
>You could have a mix of error-only and completion requests, and upon completion
>only the completion requests should be completed.
>
>On error, both error-only and completion notification requests should get
>completed.

The only real purpose of allowing error notification was to avoid rearming the
CQ.  I can see how you could miss the error notification.

>>Index: core/winverbs/user/wv_cq.cpp
>>===================================================================
>>--- core/winverbs/user/wv_cq.cpp        (revision 1007)
>>+++ core/winverbs/user/wv_cq.cpp        (working copy)
>>@@ -222,14 +222,21 @@
>> STDMETHODIMP CWVCompletionQueue::
>> Notify(WV_CQ_NOTIFY_TYPE Type, OVERLAPPED* pOverlapped)
>> {
>>-       WV_IO_ID        id;
>>        DWORD           bytes;
>>        HRESULT         hr;
>>
>>-       id.Id = m_Id;
>>-       id.Data = (UINT32) Type;
>>-       if (DeviceIoControl(m_hFile, WV_IOCTL_CQ_NOTIFY, &id, sizeof id,
>>+       if (DeviceIoControl(m_hFile, WV_IOCTL_CQ_NOTIFY, &m_Id, sizeof m_Id,
>>                                                NULL, 0, &bytes, pOverlapped))
>{
>
>Note that you expect DeviceIoControl to return FALSE with GetLastError
>returning ERROR_IO_PENDING.

DeviceIoControl is a BOOL.  Are you saying that the return code from the kernel
should be ERROR_IO_PENDING, rather than STATUS_SUCCESS?

- Sean





More information about the ofw mailing list