winverbs: transition QP to error on disconnect
authorshefty <shefty@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Wed, 27 May 2009 19:13:36 +0000 (19:13 +0000)
committershefty <shefty@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Wed, 27 May 2009 19:13:36 +0000 (19:13 +0000)
commit6c86da078c80dce17a39d37dfaf2c9dc6a18919e
treea1fc78eb80d5132152b56ed13f4d763ec6d02e66
parent589399c0041e97ac57711a7ac355dcfa06622a66
winverbs: transition QP to error on disconnect

The QP transition into the error state must occur after a DREQ has been
received and acknowledged by the user (by a subsequent call to Disconnect),
or after a DREP has been received.  The current winverbs API requires the
user to call QP:Modify after their NotifyDisconnect completes.  This
presents challenges to implementing an ND provider, which expects a single
function call to perform both operations.

Unlike during connection establishment, the QP transition to error must
sometimes be delayed until after a CM callback.  And since CM callbacks
are at dispatch, we must queue the modify call to a system thread.

Regardless of the outcome of the disconnect attempt or other failures,
the driver tries to transition the QP to error.  This results in some
minor checks to ensure that the correct status is reported to the user.

A couple of additional changes were made to the Accept path to keep the
code consistent, since both Accept and Disconnect have active/passive
code paths.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@2214 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86
core/winverbs/kernel/wv_driver.c
core/winverbs/kernel/wv_ep.c
core/winverbs/kernel/wv_ep.h
core/winverbs/kernel/wv_provider.c
core/winverbs/kernel/wv_provider.h
core/winverbs/user/wv_ep.cpp
core/winverbs/user/wv_ep.h
core/winverbs/wv_ioctl.h
inc/user/rdma/winverbs.h
ulp/librdmacm/src/cma.cpp