IPoIB/cm: Fix SRQ WR leak
authorMichael S. Tsirkin <mst@dev.mellanox.co.il>
Mon, 21 May 2007 12:04:59 +0000 (15:04 +0300)
committerRoland Dreier <rolandd@cisco.com>
Mon, 21 May 2007 20:35:40 +0000 (13:35 -0700)
commit518b1646f8a31904ca637b8df0c1e31c34a7a3c2
treeb72e7d9b6b3e5338d636746e77d326bd42aa4e29
parent24bd1e4e32e88cd3d0675482d15bea498a922ca8
IPoIB/cm: Fix SRQ WR leak

SRQ WR leakage has been observed with IPoIB/CM: e.g. flipping ports on
and off will, with time, leak out all WRs and then all connections
will start getting RNR NAKs.  Fix this in the way suggested by spec:
move the QP being destroyed to the error state, wait for "Last WQE
Reached" event and then post WR on a "drain QP" connected to the same
CQ.  Once we observe a completion on the drain QP, it's safe to call
ib_destroy_qp.

Signed-off-by: Michael S. Tsirkin <mst@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/ulp/ipoib/ipoib.h
drivers/infiniband/ulp/ipoib/ipoib_cm.c
drivers/infiniband/ulp/ipoib/ipoib_verbs.c