ib/cm: fix handling failed send completions
__cep_mad_send_cb() assumes that the mad being processed is
associated with the current state of the CEP. This may not be
the case.
For example, for a short lived connection, it was observed that
a REP mad completed with status canceled. This is normal. However,
the user already attempted to disconnect the connection by sending
a DREQ. This left the cep in the DREQ_SENT state by the time that
the REP mad completed. Since the REP failed, but the state was
DREQ_SENT, the code assumed that the DREQ had failed and transitioned
the cep into TIMEWAIT. The result is that the DREQ is never
matched with a DREP or canceled, but holds a reference on the CEP.
Until the DREQ times out (time depends on connection, but easily
up to a minute), attempts to destroy the CEP are blocked.
Fix this by simply discarding any completed sends that were not
sent from the current state of the cep when the completion handler
is invoked.
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
git-svn-id: svn://openib.tc.cornell.edu/gen1@2650
ad392aa1-c5ef-ae45-8dd8-
e69d62a5ef86