[ofw] RE: WV:Disconnect return values
Sean Hefty
sean.hefty at intel.com
Wed Feb 11 17:31:21 PST 2009
>I'm trying to figure out the expected status values for disconnection in
>WinVerbs.
>
>If both sides call Disconnect at roughly the same time, both Disconnect
>requests will get completed in error with STATUS_CONNECTION_DISCONNECTED.
>
>If one side calls Disconnect after receiving the DREQ, it sends the DREP and
>returns STATUS_SUCCESS.
>
>If one side initiates disconnection by calling Disconnect, when the DREP is
>received the call fails with STATUS_CONNECTION_DISCONNECTED.
>
>It seems to me all of these should complete with STATUS_SUCCESS.
Are you referring to the function call return values or the overlapped values?
Using STATUS_CONNECTION_DISCONNECTED clearly indicates that, well, the
connection has been disconnected.
I don't have an issue changing the status values, but the endpoint state would
determine the correct value. For example, you can get DREQ received while
waiting for an RTU. This would be STATUS_CONNECTION_DISCONNECTED, rather than
STATUS_SUCCESS, since you're completing the Connect().
>Also, it doesn't seem that the code checks to see what IRP is being completed.
>For example, if a NotifyDisconnect request is outstanding, it will get
>completed with STATUS_CONNECTION_DISCONNECTED, along with the Disconnect
>request and whatever other IRP might be queued.
It's an error for the user to call NotifyDisconnect on an unconnected endpoint.
There can only be one outstanding IRP during connection establishment, and only
NotifyDisconnect IRPs afterwards. It's not expected that the user will call
NotifyDisconnect multiple times, but it's supported. The design allows using a
single overlapped structure for managing the endpoint, including transitioning
the QP.
>Also, if a user requested NotifyDisconnect, and then initiates disconnection,
>shouldn't that satisfy the NotifyDisconnect request? Isn't NotifyDisconnect
>used to detect when disconnection begins? Or is it strictly for remotely
>initiated disconnection?
The NotifyDisconnect indicates that the remote side has confirmed the
disconnect, or the disconnect timed out. (DREQ received, DREP received, or DREQ
timeout). The completion of NotifyDisconnect() indicates that it is safe to
transition the QP to error.
- Sean
More information about the ofw
mailing list