IB/rdmavt: Don't wait for resources in QP reset
authorAlex Estrin <alex.estrin@intel.com>
Mon, 9 Oct 2017 19:38:33 +0000 (12:38 -0700)
committerDoug Ledford <dledford@redhat.com>
Wed, 18 Oct 2017 14:13:00 +0000 (10:13 -0400)
commitf9586abfa333143d67e3362dfb2a19ae45d82441
tree6e6fe5990dff922feea6c4ba9360392d8e591329
parenta8979cc55c0034fbe129904936cfc4b5bf41e59b
IB/rdmavt: Don't wait for resources in QP reset

Per the IBTA spec, QP destroy shall fail if the QP is attached
to multicast groups, although the spec is silent on modify_qp
to reset state. It implies that ULP must deregister QP from
all mcast groups for destroy to succeed.
The faulty patch "IB/ipoib: Update broadcast object if PKey value
was changed in index 0" exposed two issues in rdmavt:
1. Rvt QP reset waits for qp references to go to zero.
This will hang if QP is attached to multicast groups.
2. The mcast group detach will fail for a QP in reset state
therefore preventing ULP from correcting the issue.
This patch moves the reference count wait to the the destroy QP
path and allows a QP mcast detach to work in the reset state.

Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Alex Estrin <alex.estrin@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/sw/rdmavt/mcast.c
drivers/infiniband/sw/rdmavt/qp.c