linux/drivers/infiniband/core
Sean Hefty 8d8ac86564 IB/cm: Cancel pending LAP message when exiting IB_CM_ESTABLISH state
This problem was reported by Moni Shoua <monis@mellanox.com> and Amir
Vadai <amirv@mellanox.com>:

	When destroying a cm_id from a context of a work queue and if
	the lap_state of this cm_id is IB_CM_LAP_SENT, we need to
	release the reference of this id that was taken upon the send
	of the LAP message.  Otherwise, if the expected APR message
	gets lost, it is only after a long time that the reference
	will be released, while during that the work handler thread is
	not available to process other things.

It turns out that we need to cancel any pending LAP messages whenever
we transition out of the IB_CM_ESTABLISH state.  This occurs when
disconnecting - either sending or receiving a DREQ.  It can also
happen in a corner case where we receive a REJ message after sending
an RTU, followed by a LAP.  Add checks and cancel any outstanding LAP
messages in these three cases.

Canceling the LAP when sending a DREQ fixes the destroy problem
reported by Moni.  When a cm_id is destroyed in the IB_CM_ESTABLISHED
state, it sends a DREQ to the remote side to notify the peer that the
connection is going away.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
2011-03-15 10:56:12 -07:00
..
addr.c infiniband: remove dev_base_lock use 2010-11-24 11:41:56 -08:00
agent.c IB/mad: IBoE supports only QP1 (no QP0) 2010-10-13 09:38:11 -07:00
agent.h RDMA: Remove subversion $Id tags 2008-07-14 23:48:44 -07:00
cache.c RDMA: Update workqueue usage 2011-01-16 21:16:31 -08:00
cm.c IB/cm: Cancel pending LAP message when exiting IB_CM_ESTABLISH state 2011-03-15 10:56:12 -07:00
cm_msgs.h IB: Remove __constant_{endian} uses 2009-01-17 17:11:57 -08:00
cma.c RDMA/cma: Fix crash in request handlers 2011-03-15 10:00:28 -07:00
core_priv.h IB/core: Allow device-specific per-port sysfs files 2010-05-21 10:34:44 -07:00
device.c RDMA: Update workqueue usage 2011-01-16 21:16:31 -08:00
fmr_pool.c RDMA: Remove subversion $Id tags 2008-07-14 23:48:44 -07:00
iwcm.c RDMA/iwcm: Fix hang in uninterruptible wait on cm_id destroy 2010-10-11 20:24:04 -07:00
iwcm.h
mad.c IB/mad: IBoE supports only QP1 (no QP0) 2010-10-13 09:38:11 -07:00
mad_priv.h IB/mad: Allow tuning of QP0 and QP1 sizes 2009-09-07 08:28:48 -07:00
mad_rmpp.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
mad_rmpp.h RDMA: Remove subversion $Id tags 2008-07-14 23:48:44 -07:00
Makefile IB/uverbs: Export ib_umem_get()/ib_umem_release() to modules 2007-05-08 18:00:37 -07:00
multicast.c IB/mad: IBoE supports only QP1 (no QP0) 2010-10-13 09:38:11 -07:00
packer.c RDMA: Remove subversion $Id tags 2008-07-14 23:48:44 -07:00
sa.h IB: Remove garbage non-ASCII characters from comments 2007-07-09 16:17:32 -07:00
sa_query.c RDMA: Update missed conversion of flush_scheduled_work() 2011-01-28 16:39:08 -08:00
smi.c IB/mad: Check hop count field in directed route MAD to avoid array overflow 2009-09-05 20:24:10 -07:00
smi.h IB/mad: Enable loopback of DR SMP responses from userspace 2008-01-25 14:15:25 -08:00
sysfs.c IB/core: Add link layer type information to sysfs 2010-10-25 10:20:39 -07:00
ucm.c IB/ucm: Use memdup_user() 2010-05-25 21:10:57 -07:00
ucma.c RDMA/ucma: Copy iWARP route information on queries 2011-01-28 16:34:05 -08:00
ud_header.c IB/pack: Remove some unused code added by the IBoE patches 2010-12-01 16:30:18 -08:00
umem.c RDMA: Update workqueue usage 2011-01-16 21:16:31 -08:00
user_mad.c IB/umad: Make user_mad semaphore a real one 2010-09-28 20:52:21 -07:00
uverbs.h Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6 2010-03-04 08:15:33 -08:00
uverbs_cmd.c IB/uverbs: Handle large number of entries in poll CQ 2010-12-08 15:23:49 -08:00
uverbs_main.c IB: Explicitly rule out llseek to avoid BKL in default_llseek() 2010-04-21 12:17:38 -07:00
uverbs_marshall.c IB: Fix information leak in marshalling code 2010-12-01 16:33:18 -08:00
verbs.c IB/core: Add link layer property to ports 2010-09-27 17:51:10 -07:00